14
0
forked from pool/python-mypy
2022-11-28 04:04:00 +00:00
committed by Git OBS Bridge
commit a7b9f0ea27
7 changed files with 1508 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

3
mypy-0.981.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ad77c13037d3402fbeffda07d51e3f228ba078d1c7096a73759c9419ea031bf4
size 2621383

3
mypy-rpmlintrc Normal file
View File

@@ -0,0 +1,3 @@
addFilter("zero-length .*/usr/lib/python.*/site-packages/mypy/test/.*\.py")
addFilter("zero-length .*/usr/lib/python.*/site-packages/mypy/typeshed/.*\.pyi")
addFilter("devel-file-in-non-devel-package")

1316
mypy.changes Normal file

File diff suppressed because it is too large Load Diff

159
mypy.spec Normal file
View File

@@ -0,0 +1,159 @@
#
# spec file for package mypy
#
# Copyright (c) 2022 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%bcond_without test
%{?!python_module:%define python_module() python3-%{**}}
%define skip_python2 1
%define typed_ast_version 1.5.1
Name: mypy
Version: 0.981
Release: 0
Summary: Optional static typing for Python
License: MIT
Group: Development/Languages/Python
URL: http://www.mypy-lang.org/
Source0: https://files.pythonhosted.org/packages/source/m/mypy/mypy-%{version}.tar.gz
# License Source1: Apache-2.0. Only for the test suite, not packaged here.
Source1: https://files.pythonhosted.org/packages/source/t/types-typed-ast/types-typed-ast-%{typed_ast_version}.tar.gz
Source99: mypy-rpmlintrc
BuildRequires: %{python_module mypy_extensions >= 0.4.3}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module tomli >= 1.1.0 if %python-base < 3.11}
BuildRequires: %{python_module typed-ast >= 1.4.0 if %python-base < 3.8}
BuildRequires: %{python_module typing_extensions >= 3.10}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-mypy_extensions >= 0.4.3
Requires: python-typing_extensions >= 3.10
%if 0%{?python_version_nodots} < 38
Requires: python-typed-ast >= 1.4.0
%endif
%if 0%{?python_version_nodots} < 311
Requires: python-tomli >= 1.1.0
%endif
Requires(post): update-alternatives
Requires(postun):update-alternatives
%if "%{python_flavor}" == "python3" || "%{?python_provides}" == "python3"
Provides: mypy = %{version}
Obsoletes: mypy < %{version}
%endif
Suggests: python-psutil >= 4.0
BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module attrs >= 18}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module filelock >= 3.3}
BuildRequires: %{python_module importlib-metadata >= 4.6.1}
BuildRequires: %{python_module lxml >= 4}
BuildRequires: %{python_module psutil >= 4}
BuildRequires: %{python_module pytest >= 6.2}
BuildRequires: %{python_module pytest-forked >= 1.3}
BuildRequires: %{python_module pytest-xdist >= 1.34}
BuildRequires: %{python_module typed-ast >= 1.4.0}
BuildRequires: %{python_module virtualenv >= 20.6}
BuildRequires: gcc-c++
%endif
# SECTION docs
BuildRequires: python3-Sphinx >= 1.4.4
BuildRequires: python3-sphinx_rtd_theme >= 0.1.9
# /SECTION
%python_subpackages
%description
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.
%prep
%autosetup -n mypy-%{version} -p1 -a1
sed -i '/env python3/d' ./mypy/stubgenc.py
sed -i '/env python3/d' ./mypy/stubgen.py
mkdir mystubs
mv types-typed-ast-%{typed_ast_version}/typed_ast-stubs mystubs/typed_ast
%build
%python_build
# building docs fails due to missing theme 'furo'
#pushd docs
#%%make_build html
#rm build/html/.buildinfo
#popd
%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/dmypy
%python_clone -a %{buildroot}%{_bindir}/mypy
%python_clone -a %{buildroot}%{_bindir}/mypyc
%python_clone -a %{buildroot}%{_bindir}/stubgen
%python_clone -a %{buildroot}%{_bindir}/stubtest
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%if %{with test}
%check
sed -i mypy_self_check.ini \
-e '/python_version.*$/d' \
-e '/warn_unused_ignores/d'
%{python_expand # self-check with manually provided stubs for typed_ast
export PYTHONPATH=%{buildroot}%{$python_sitelib}
export MYPYPATH=./mystubs
$python -m mypy --config-file mypy_self_check.ini -p mypy
}
unset PYTHONPATH
# cannot compile unoptimized with suse headers
export MYPYC_OPT_LEVEL=2
if [ $(getconf LONG_BIT) -ne 64 ]; then
# https://github.com/python/mypy/issues/11148
donttest+=" or testSubclassSpecialize or testMultiModuleSpecialize"
# fails only in python36 (EOL)
python36_donttest+=" or testIntOps"
fi
# the fake test_module is not in the modulepath without pytest-xdist
# or with pytest-xdist >= 2.3 -- https://github.com/python/mypy/issues/11019
donttest+=" or teststubtest"
%pytest -n auto -k "not (testallexcept ${donttest} ${$python_donttest})"
%endif
%post
%python_install_alternative mypy dmypy mypyc stubgen stubtest
%postun
%python_uninstall_alternative mypy
%files %{python_files}
%doc docs/
%license LICENSE
%{python_sitelib}/mypy
%{python_sitelib}/mypyc
%{python_sitelib}/mypy-%{version}*-info
%python_alternative %{_bindir}/dmypy
%python_alternative %{_bindir}/mypy
%python_alternative %{_bindir}/mypyc
%python_alternative %{_bindir}/stubgen
%python_alternative %{_bindir}/stubtest
%changelog

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:510f3beaa95492b3544d67e81581afa2903c764b70889ffcdb286e6c6267d297
size 3946