diff --git a/mypy-1.10.0.tar.gz b/mypy-1.10.0.tar.gz new file mode 100644 index 0000000..3ca6b75 --- /dev/null +++ b/mypy-1.10.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d087fcbec056c4ee34974da493a826ce316947485cef3901f511848e687c131 +size 3022145 diff --git a/mypy-1.9.0.tar.gz b/mypy-1.9.0.tar.gz deleted file mode 100644 index 6b1ab37..0000000 --- a/mypy-1.9.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3cc5da0127e6a478cddd906068496a97a7618a21ce9b54bde5bf7e539c7af974 -size 2995901 diff --git a/python-mypy.changes b/python-mypy.changes index 9cee944..d938a77 100644 --- a/python-mypy.changes +++ b/python-mypy.changes @@ -1,3 +1,28 @@ +------------------------------------------------------------------- +Mon Jun 17 05:39:04 UTC 2024 - Steve Kowalik + +- Update to 1.10.0: + * Support TypeIs (PEP 742) + * Support TypeVar Defaults (PEP 696) + * Support TypeAliasType (PEP 695) + * Detect Additional Unsafe Uses of super() + * Fix incorrect inferred type when accessing descriptor on union type + * Fix crash when expanding invalid Unpack in a Callable alias + * Fix false positive when string formatting with string enum + * Narrow individual items when matching a tuple to a sequence pattern + * Fix false positive from type variable within TypeGuard or TypeIs + * Improve yield from inference for unions of generators + * Fix emulating hash method logic in attrs classes + * Add reverted typeshed commit that uses ParamSpec for functools.wraps + * Fix type narrowing for types.EllipsisType + * Fix single item enum match type exhaustion + * Improve type inference with empty collections + * Fix override checking for decorated property + * Fix narrowing on match with function subject +- Drop including types-ast, no longer required. +- Drop patch workaround-parenthesized-context-managers.patch, now + included upstream. + ------------------------------------------------------------------- Thu Apr 4 08:32:32 UTC 2024 - Steve Kowalik diff --git a/python-mypy.spec b/python-mypy.spec index 067852e..22e415e 100644 --- a/python-mypy.spec +++ b/python-mypy.spec @@ -18,31 +18,25 @@ %{?sle15_python_module_pythons} %bcond_without test -%define typed_ast_version 1.5.8.7 -%define types_psutil_version 5.9.5.16 -%define types_setuptools_version 68.1.0.0 +%define types_psutil_version 5.9.5.17 +%define types_setuptools_version 68.2.0.0 Name: python-mypy -Version: 1.9.0 +Version: 1.10.0 Release: 0 Summary: Optional static typing for Python License: MIT URL: https://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 +Source1: https://files.pythonhosted.org/packages/source/t/types-psutil/types-psutil-%{types_psutil_version}.tar.gz # License Source2: Apache-2.0. Only for the test suite, not packaged here. -Source2: https://files.pythonhosted.org/packages/source/t/types-psutil/types-psutil-%{types_psutil_version}.tar.gz -# License Source3: Apache-2.0. Only for the test suite, not packaged here. -Source3: https://files.pythonhosted.org/packages/source/t/types-setuptools/types-setuptools-%{types_setuptools_version}.tar.gz +Source2: https://files.pythonhosted.org/packages/source/t/types-setuptools/types-setuptools-%{types_setuptools_version}.tar.gz Source99: python-mypy-rpmlintrc -# PATCH-FIX-UPSTREAM gh#python/mypy#16949 -Patch0: workaround-parenthesized-context-managers.patch BuildRequires: %{python_module exceptiongroup} BuildRequires: %{python_module mypy_extensions >= 1.0.0} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module tomli >= 1.1.0} -BuildRequires: %{python_module typed-ast >= 1.4.0 if %python-base < 3.8} BuildRequires: %{python_module typing_extensions >= 4.1.0} BuildRequires: %{python_module wheel} BuildRequires: %{python_module wheel} @@ -51,7 +45,6 @@ BuildRequires: python-rpm-macros Requires: python-mypy_extensions >= 0.4.3 Requires: python-typing_extensions >= 3.10 Requires: (python-tomli >= 1.1.0 if python-base < 3.11) -Requires: (python-typed-ast >= 1.4.0 if python-base < 3.8) Requires(post): update-alternatives Requires(postun): update-alternatives %if "%{python_flavor}" == "python3" || "%{?python_provides}" == "python3" @@ -67,11 +60,9 @@ 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 >= 8.1} BuildRequires: %{python_module pytest-forked >= 1.3} BuildRequires: %{python_module pytest-xdist >= 1.34} -BuildRequires: %{python_module six} -BuildRequires: %{python_module typed-ast >= 1.4.0} BuildRequires: %{python_module virtualenv >= 20.6} BuildRequires: gcc-c++ %endif @@ -93,14 +84,13 @@ Mypy's type system features type inference, gradual typing, generics and union types. %prep -%setup -q -a 1 -a 2 -a 3 -n mypy-%{version} +%setup -q -a 1 -a 2 -n mypy-%{version} %autopatch -p1 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/ mv types-setuptools-%{types_setuptools_version}/setuptools-stubs* mystubs/ mv types-psutil-%{types_psutil_version}/psutil-stubs* mystubs/ diff --git a/types-psutil-5.9.5.16.tar.gz b/types-psutil-5.9.5.16.tar.gz deleted file mode 100644 index ead8aab..0000000 --- a/types-psutil-5.9.5.16.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4e9b219efb625d3d04f6bf106934f87cab49aa41a94b0a3b3089403f47a79228 -size 14060 diff --git a/types-psutil-5.9.5.17.tar.gz b/types-psutil-5.9.5.17.tar.gz new file mode 100644 index 0000000..01df401 --- /dev/null +++ b/types-psutil-5.9.5.17.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7d8769812d72a4b513d7ec9eb5580fe2f6013fc270394a603cb6534811f3e4d +size 14260 diff --git a/types-setuptools-68.1.0.0.tar.gz b/types-setuptools-68.1.0.0.tar.gz deleted file mode 100644 index a4ee202..0000000 --- a/types-setuptools-68.1.0.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2bc9b0c0818f77bdcec619970e452b320a423bb3ac074f5f8bc9300ac281c4ae -size 32689 diff --git a/types-setuptools-68.2.0.0.tar.gz b/types-setuptools-68.2.0.0.tar.gz new file mode 100644 index 0000000..14a0bb0 --- /dev/null +++ b/types-setuptools-68.2.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4216f1e2ef29d089877b3af3ab2acf489eb869ccaf905125c69d2dc3932fd85 +size 32945 diff --git a/types-typed-ast-1.5.8.7.tar.gz b/types-typed-ast-1.5.8.7.tar.gz deleted file mode 100644 index 69c23cd..0000000 --- a/types-typed-ast-1.5.8.7.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f7795f6f9d597b35212314040b993f6613b51d81738edce3c1e3a3e9ef655124 -size 5581 diff --git a/workaround-parenthesized-context-managers.patch b/workaround-parenthesized-context-managers.patch deleted file mode 100644 index bd9fdc9..0000000 --- a/workaround-parenthesized-context-managers.patch +++ /dev/null @@ -1,131 +0,0 @@ -From fb610cb043ea990046d3665ac39238d5223e3eb3 Mon Sep 17 00:00:00 2001 -From: hauntsaninja -Date: Sun, 25 Feb 2024 14:01:07 -0800 -Subject: [PATCH 1/4] Workaround parenthesised context manager issue - -Fixes #16945 ---- - mypy/checker.py | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - -diff --git a/mypy/checker.py b/mypy/checker.py -index 56be3db3f9e7..5081265c9cac 100644 ---- a/mypy/checker.py -+++ b/mypy/checker.py -@@ -526,16 +526,18 @@ def check_second_pass( - # print("XXX in pass %d, class %s, function %s" % - # (self.pass_num, type_name, node.fullname or node.name)) - done.add(node) -- with ( -+ tscope_class_ctx = ( - self.tscope.class_scope(active_typeinfo) - if active_typeinfo - else nullcontext() -- ): -- with ( -+ ) -+ with tscope_class_ctx: -+ checker_scope_class_ctx = ( - self.scope.push_class(active_typeinfo) - if active_typeinfo - else nullcontext() -- ): -+ ) -+ with checker_scope_class_ctx: - self.check_partial(node) - return True - - -From 4c9d637919ef5262b94d6dc160f63d12bd126167 Mon Sep 17 00:00:00 2001 -From: hauntsaninja -Date: Sun, 25 Feb 2024 14:14:56 -0800 -Subject: [PATCH 2/4] . - ---- - mypy/checker.py | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/mypy/checker.py b/mypy/checker.py -index 5081265c9cac..426e5a805893 100644 ---- a/mypy/checker.py -+++ b/mypy/checker.py -@@ -526,6 +526,7 @@ def check_second_pass( - # print("XXX in pass %d, class %s, function %s" % - # (self.pass_num, type_name, node.fullname or node.name)) - done.add(node) -+ # Alias context managers to work around https://github.com/python/cpython/issues/115881 - tscope_class_ctx = ( - self.tscope.class_scope(active_typeinfo) - if active_typeinfo - -From 9e33616ec8405b4e3c3b345c8461e77c4786a22c Mon Sep 17 00:00:00 2001 -From: hauntsaninja -Date: Sun, 25 Feb 2024 14:18:34 -0800 -Subject: [PATCH 3/4] . - ---- - mypy/checker.py | 21 ++++++--------------- - 1 file changed, 6 insertions(+), 15 deletions(-) - -diff --git a/mypy/checker.py b/mypy/checker.py -index 426e5a805893..d60f223036ea 100644 ---- a/mypy/checker.py -+++ b/mypy/checker.py -@@ -4,7 +4,7 @@ - - import itertools - from collections import defaultdict --from contextlib import contextmanager, nullcontext -+from contextlib import contextmanager, ExitStack - from typing import ( - AbstractSet, - Callable, -@@ -526,20 +526,11 @@ def check_second_pass( - # print("XXX in pass %d, class %s, function %s" % - # (self.pass_num, type_name, node.fullname or node.name)) - done.add(node) -- # Alias context managers to work around https://github.com/python/cpython/issues/115881 -- tscope_class_ctx = ( -- self.tscope.class_scope(active_typeinfo) -- if active_typeinfo -- else nullcontext() -- ) -- with tscope_class_ctx: -- checker_scope_class_ctx = ( -- self.scope.push_class(active_typeinfo) -- if active_typeinfo -- else nullcontext() -- ) -- with checker_scope_class_ctx: -- self.check_partial(node) -+ with ExitStack() as stack: -+ if active_typeinfo: -+ stack.enter_context(self.tscope.class_scope(active_typeinfo)) -+ stack.enter_context(self.scope.push_class(active_typeinfo)) -+ self.check_partial(node) - return True - - def check_partial(self, node: DeferredNodeType | FineGrainedDeferredNodeType) -> None: - -From f7f9f114451065a27a7d0d734ea38f1b80a965df Mon Sep 17 00:00:00 2001 -From: hauntsaninja -Date: Sun, 25 Feb 2024 14:18:46 -0800 -Subject: [PATCH 4/4] . - ---- - mypy/checker.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mypy/checker.py b/mypy/checker.py -index d60f223036ea..9f987cb5ccdf 100644 ---- a/mypy/checker.py -+++ b/mypy/checker.py -@@ -4,7 +4,7 @@ - - import itertools - from collections import defaultdict --from contextlib import contextmanager, ExitStack -+from contextlib import ExitStack, contextmanager - from typing import ( - AbstractSet, - Callable,