2022-11-28 04:04:00 +00:00
#
2023-09-01 17:05:19 +00:00
# spec file for package python-mypy
2022-11-28 04:04:00 +00:00
#
- update to 1.8.0:
* https://mypy-lang.blogspot.com/2023/12/mypy-18-released.html
* https://mypy-lang.blogspot.com/2023/11/mypy-17-released.html
* https://mypy-lang.blogspot.com/2023/10/mypy-16-released.html
- fix dependencies
- Support better __post_init__ method signature for dataclasses (Nikita Sobolev, PR 15503)
- Don't explicitly assign NULL values in setup functions (Logan Hunt, PR 15379)
- Fix crash on non-str docstring (Ali Hamdan, PR 15623)
- Remove confusing instance variable example in cheat sheet (Adel Atallah, PR 15441)
- Check for abstract class objects in tuples (Nikita Sobolev, PR 15366)
- Fix frozen behavior for base classes with direct metaclasses (Wesley Collin Wright, PR 14878)
- Fixes to float to int conversion (Jukka Lehtosalo, PR 14936)
- Faster classmethod calls via cls (Jukka Lehtosalo, PR 14789)
- Fix crash on ParamSpec in incremental mode (Ivan Levkivskyi, PR 14885)
- Improve documentation of top level mypy: disable-error-code comment (Nikita Sobolev, PR 14810)
- Add suggestions for pandas-stubs and lxml-stubs (Shantanu, PR 14737)
- Honor NoReturn as __setitem__ return type to mark unreachable code (sterliakov, PR 12572)
- Sadly, six is still required for tests, re-add to BuildRequires.
The full release notes can be found here:
- Fix types of inherited attributes in generic dataclasses (Jukka Lehtosalo, PR 12656)
- add missing g++ compiler for tests
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-mypy?expand=0&rev=6
2024-01-02 17:27:14 +00:00
# Copyright (c) 2024 SUSE LLC
2022-11-28 04:04:00 +00:00
#
# 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/
#
2023-05-08 15:30:06 +00:00
%{?sle15_python_module_pythons}
2022-11-28 04:04:00 +00:00
%bcond_without test
2024-10-14 13:07:55 +00:00
%define types_psutil_version 6.0.0.20241011
%define types_setuptools_version 75.1.0.20241014
2023-09-01 17:05:19 +00:00
Name : python-mypy
- Update to officially released version 1.12.0:
- Support Python 3.12 Syntax for Generics (PEP 695)
- Related improvements are included:
- Document Python 3.12 type parameter syntax (Jukka
Lehtosalo, PR 17816)
- Further documentation updates (Jukka Lehtosalo, PR 17826)
- Allow Self return types with contravariance (Jukka
Lehtosalo, PR 17786)
- Enable new type parameter syntax by default (Jukka
Lehtosalo, PR 17798)
- Generate error if new-style type alias used as base class
(Jukka Lehtosalo, PR 17789)
- Inherit variance if base class has explicit variance (Jukka
Lehtosalo, PR 17787)
- Fix crash on invalid type var reference (Jukka Lehtosalo,
PR 17788)
- Fix covariance of frozen dataclasses (Jukka Lehtosalo, PR
17783)
- Allow covariance with attribute that has "_" name prefix
(Jukka Lehtosalo, PR 17782)
- Support Annotated[...] in new-style type aliases (Jukka
Lehtosalo, PR 17777)
- Fix nested generic classes (Jukka Lehtosalo, PR 17776)
- Add detection and error reporting for the use of incorrect
expressions within the scope of a type parameter and a type
alias (Kirill Podoprigora, PR 17560)
- Basic Support for Python 3.13 This release adds partial
support for Python 3.13 features and compiled binaries for
Python 3.13. Mypyc now also supports Python 3.13.
- Various new stdlib features and changes (through typeshed
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-mypy?expand=0&rev=24
2024-10-14 13:04:21 +00:00
Version : 1.12.0
2022-11-28 04:04:00 +00:00
Release : 0
Summary : Optional static typing for Python
License : MIT
2023-09-01 17:05:19 +00:00
URL : https://www.mypy-lang.org/
- Update to officially released version 1.12.0:
- Support Python 3.12 Syntax for Generics (PEP 695)
- Related improvements are included:
- Document Python 3.12 type parameter syntax (Jukka
Lehtosalo, PR 17816)
- Further documentation updates (Jukka Lehtosalo, PR 17826)
- Allow Self return types with contravariance (Jukka
Lehtosalo, PR 17786)
- Enable new type parameter syntax by default (Jukka
Lehtosalo, PR 17798)
- Generate error if new-style type alias used as base class
(Jukka Lehtosalo, PR 17789)
- Inherit variance if base class has explicit variance (Jukka
Lehtosalo, PR 17787)
- Fix crash on invalid type var reference (Jukka Lehtosalo,
PR 17788)
- Fix covariance of frozen dataclasses (Jukka Lehtosalo, PR
17783)
- Allow covariance with attribute that has "_" name prefix
(Jukka Lehtosalo, PR 17782)
- Support Annotated[...] in new-style type aliases (Jukka
Lehtosalo, PR 17777)
- Fix nested generic classes (Jukka Lehtosalo, PR 17776)
- Add detection and error reporting for the use of incorrect
expressions within the scope of a type parameter and a type
alias (Kirill Podoprigora, PR 17560)
- Basic Support for Python 3.13 This release adds partial
support for Python 3.13 features and compiled binaries for
Python 3.13. Mypyc now also supports Python 3.13.
- Various new stdlib features and changes (through typeshed
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-mypy?expand=0&rev=24
2024-10-14 13:04:21 +00:00
Source0 : https://files.pythonhosted.org/packages/source/m/mypy/mypy-%{version} .tar.gz
# Source0: mypy-%%{version}.tar.gz
2022-11-28 04:04:00 +00:00
# License Source1: Apache-2.0. Only for the test suite, not packaged here.
2024-06-17 05:39:18 +00:00
Source1 : https://files.pythonhosted.org/packages/source/t/types-psutil/types-psutil-%{types_psutil_version} .tar.gz
2023-05-08 15:30:06 +00:00
# License Source2: Apache-2.0. Only for the test suite, not packaged here.
2024-06-17 05:39:18 +00:00
Source2 : https://files.pythonhosted.org/packages/source/t/types-setuptools/types-setuptools-%{types_setuptools_version} .tar.gz
2023-09-01 17:05:19 +00:00
Source99 : python-mypy-rpmlintrc
2024-03-22 14:16:08 +00:00
BuildRequires : %{python_module exceptiongroup}
2023-09-01 17:05:19 +00:00
BuildRequires : %{python_module mypy_extensions >= 1.0.0}
2024-03-22 14:16:08 +00:00
BuildRequires : %{python_module pip}
2022-11-28 04:04:00 +00:00
BuildRequires : %{python_module setuptools}
2024-03-22 13:47:03 +00:00
BuildRequires : %{python_module tomli >= 1.1.0}
2024-09-11 06:59:56 +00:00
BuildRequires : %{python_module typing_extensions >= 4.6.0}
2023-09-01 17:05:19 +00:00
BuildRequires : %{python_module wheel}
2024-03-22 14:16:08 +00:00
BuildRequires : %{python_module wheel}
2022-11-28 04:04:00 +00:00
BuildRequires : fdupes
BuildRequires : python-rpm-macros
Requires : python-mypy_extensions >= 0.4.3
Requires : python-typing_extensions >= 3.10
- update to 1.8.0:
* https://mypy-lang.blogspot.com/2023/12/mypy-18-released.html
* https://mypy-lang.blogspot.com/2023/11/mypy-17-released.html
* https://mypy-lang.blogspot.com/2023/10/mypy-16-released.html
- fix dependencies
- Support better __post_init__ method signature for dataclasses (Nikita Sobolev, PR 15503)
- Don't explicitly assign NULL values in setup functions (Logan Hunt, PR 15379)
- Fix crash on non-str docstring (Ali Hamdan, PR 15623)
- Remove confusing instance variable example in cheat sheet (Adel Atallah, PR 15441)
- Check for abstract class objects in tuples (Nikita Sobolev, PR 15366)
- Fix frozen behavior for base classes with direct metaclasses (Wesley Collin Wright, PR 14878)
- Fixes to float to int conversion (Jukka Lehtosalo, PR 14936)
- Faster classmethod calls via cls (Jukka Lehtosalo, PR 14789)
- Fix crash on ParamSpec in incremental mode (Ivan Levkivskyi, PR 14885)
- Improve documentation of top level mypy: disable-error-code comment (Nikita Sobolev, PR 14810)
- Add suggestions for pandas-stubs and lxml-stubs (Shantanu, PR 14737)
- Honor NoReturn as __setitem__ return type to mark unreachable code (sterliakov, PR 12572)
- Sadly, six is still required for tests, re-add to BuildRequires.
The full release notes can be found here:
- Fix types of inherited attributes in generic dataclasses (Jukka Lehtosalo, PR 12656)
- add missing g++ compiler for tests
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-mypy?expand=0&rev=6
2024-01-02 17:27:14 +00:00
Requires : (python-tomli >= 1.1.0 if python-base < 3.11)
2022-11-28 04:04:00 +00:00
Requires(post) : update-alternatives
2024-04-04 04:59:52 +00:00
Requires(postun) : update-alternatives
2022-11-28 04:04:00 +00:00
%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}
2024-06-17 05:39:18 +00:00
BuildRequires : %{python_module pytest >= 8.1}
2022-11-28 04:04:00 +00:00
BuildRequires : %{python_module pytest-forked >= 1.3}
BuildRequires : %{python_module pytest-xdist >= 1.34}
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 " d u c k " ) 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
2024-06-17 05:39:18 +00:00
%setup -q -a 1 -a 2 -n mypy-%{version}
2023-05-08 15:30:06 +00:00
%autopatch -p1
2022-11-28 04:04:00 +00:00
sed -i '/env python3/d' ./mypy/stubgenc.py
sed -i '/env python3/d' ./mypy/stubgen.py
mkdir mystubs
2023-05-08 15:30:06 +00:00
mv types-setuptools-%{types_setuptools_version} /setuptools-stubs* mystubs/
mv types-psutil-%{types_psutil_version} /psutil-stubs* mystubs/
2022-11-28 04:04:00 +00:00
2023-09-01 17:05:19 +00:00
# "E: wrong-script-end-of-line-encoding" and "E: spurious-executable-perm", file is not needed anyways
rm docs/make.bat
2022-11-28 04:04:00 +00:00
%build
2024-03-22 14:16:08 +00:00
%pyproject_wheel
2022-11-28 04:04:00 +00:00
# building docs fails due to missing theme 'furo'
#pushd docs
#%%make_build html
#rm build/html/.buildinfo
#popd
%install
2024-03-22 14:16:08 +00:00
%pyproject_install
2022-11-28 04:04:00 +00:00
%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
2023-09-01 17:05:19 +00:00
# solve "W: python-doc-in-package" in 3.9, 3.10 and 3.11, but not in 3.8 (thus -f to ignore the error)
%python_expand rm -rf %{buildroot} %{$python_sitelib}/mypyc/doc
2022-11-28 04:04:00 +00:00
%python_expand %fdupes %{buildroot} %{$python_sitelib}
%if %{with test}
%check
2024-03-28 08:08:12 +00:00
%if 0%{?suse_version} > 1600
2022-11-28 04:04:00 +00:00
%{python_expand # self-check with manually provided stubs for typed_ast
2023-05-08 15:30:06 +00:00
export PYTHONPATH=%{buildroot} %{$python_sitelib}:./mystubs
2022-11-28 04:04:00 +00:00
$python -m mypy --config-file mypy_self_check.ini -p mypy
}
2024-03-28 08:08:12 +00:00
%endif
2022-11-28 04:04:00 +00:00
unset PYTHONPATH
# cannot compile unoptimized with suse headers
export MYPYC_OPT_LEVEL=2
if [ $(getconf LONG_BIT) -ne 64 ]; then
2023-05-08 15:30:06 +00:00
# gh#python/mypy#11148
2022-11-28 04:04:00 +00:00
donttest+=" o r t e s t S u b c l a s s S p e c i a l i z e o r t e s t M u l t i M o d u l e S p e c i a l i z e "
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+=" o r t e s t s t u b t e s t "
2024-04-04 08:33:29 +00:00
# gh#python/mypy#15221
donttest+=" o r t e s t M a t h O p s o r t e s t F l o a t O p s "
2023-09-01 17:05:19 +00:00
# fails on Python 3.11.4, see gh#python/mypy#15446. Patch db5b5af1201fff03465b0684d16b6489a62a3d78 does not apply clean, better wait for a new upstream version
donttest+=" o r P E P 5 6 1 S u i t e "
2024-04-04 08:33:29 +00:00
%pytest -n auto -k " n o t ( t e s t a l l e x c e p t $ { d o n t t e s t } ) "
2022-11-28 04:04:00 +00:00
%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
2024-10-10 12:17:41 +00:00
# %{python_sitelib}/mypy-%%{version}.dist-info
%{python_sitelib} /mypy-*.dist-info
2022-11-28 04:04:00 +00:00
%python_alternative %{_bindir} /dmypy
%python_alternative %{_bindir} /mypy
%python_alternative %{_bindir} /mypyc
%python_alternative %{_bindir} /stubgen
%python_alternative %{_bindir} /stubtest
%changelog