File mypy.spec of Package mypy

# spec file for package mypy
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           mypy
Version:        0.670
Release:        0
Summary:        Optional static typing for Python
License:        MIT
Group:          Development/Languages/Python
Source99:       mypy-rpmlintrc
Patch2:         0003-Pass-executable-path-into-main-when-running-installe.patch
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
BuildRequires:  python3-mypy_extensions
BuildRequires:  python3-setuptools
BuildRequires:  python3-typed-ast
Requires:       python3-mypy_extensions >= 0.4.0
Requires:       python3-psutil >= 5.4.0
Requires:       python3-typed-ast >= 1.1.0
BuildArch:      noarch
Provides:       python3-mypy = %{version}
Obsoletes:      python3-mypy < %{version}
# SECTION docs
BuildRequires:  python3-Sphinx >= 1.4.4
BuildRequires:  python3-sphinx_rtd_theme >= 0.1.9

Mypy is an optional static type checker for Python that aims to
combine the benefits of both dynamic (or "duck") typing as well as
static typing.

Mypy type checks standard Python programs. It can catch many
programming errors by analyzing programs without having to run them.
There is basically no runtime overhead when run using any Python VM.
Mypy's type system features type inference, gradual typing, generics
and union types.

%autosetup -n mypy-%{version} -p1
for scr in mypy/typeshed/tests/*.py ; do
    sed -i -e '1 s|env ||' $scr

pushd docs
make %{?_smp_mflags} html
rm build/html/.buildinfo

%fdupes %{buildroot}

export PYTHONPATH=%{buildroot}%{python3_sitelib}
python3 -m mypy --config-file mypy_self_check.ini -p mypy
# py.test3 -v … we need to analyze subset of tests which would be
# available and without large dependencies.

%doc docs/ docs/build/html/
%license LICENSE

openSUSE Build Service is sponsored by