Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-mypy for openSUSE:Factory checked in at 2024-04-04 22:26:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-mypy (Old) and /work/SRC/openSUSE:Factory/.python-mypy.new.1905 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-mypy" Thu Apr 4 22:26:29 2024 rev:5 rq:1164520 version:1.9.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-mypy/python-mypy.changes 2024-03-29 13:10:05.549222286 +0100 +++ /work/SRC/openSUSE:Factory/.python-mypy.new.1905/python-mypy.changes 2024-04-04 22:27:48.258725341 +0200 @@ -1,0 +2,8 @@ +Thu Apr 4 08:32:32 UTC 2024 - Steve Kowalik <steven.kowa...@suse.com> + +- Add patch workaround-parenthesized-context-managers.patch: + * Work around parenthesized context managers issue. +- Stop skipping tests under Python 3.6. +- Drop -x argument to pytest. + +------------------------------------------------------------------- New: ---- workaround-parenthesized-context-managers.patch BETA DEBUG BEGIN: New: - Add patch workaround-parenthesized-context-managers.patch: * Work around parenthesized context managers issue. BETA DEBUG END: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-mypy.spec ++++++ --- /var/tmp/diff_new_pack.h1mI7A/_old 2024-04-04 22:27:49.174759067 +0200 +++ /var/tmp/diff_new_pack.h1mI7A/_new 2024-04-04 22:27:49.178759213 +0200 @@ -35,6 +35,8 @@ # 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 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} @@ -51,7 +53,7 @@ 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 +Requires(postun): update-alternatives %if "%{python_flavor}" == "python3" || "%{?python_provides}" == "python3" Provides: mypy = %{version} Obsoletes: mypy < %{version} @@ -138,8 +140,6 @@ if [ $(getconf LONG_BIT) -ne 64 ]; then # gh#python/mypy#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 @@ -148,7 +148,7 @@ donttest+=" or testMathOps or testFloatOps" # 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+=" or PEP561Suite" -%pytest -n auto -k "not (testallexcept ${donttest} ${$python_donttest})" -x +%pytest -n auto -k "not (testallexcept ${donttest})" %endif %post @@ -162,7 +162,7 @@ %license LICENSE %{python_sitelib}/mypy %{python_sitelib}/mypyc -%{python_sitelib}/mypy-%{version}*-info +%{python_sitelib}/mypy-%{version}.dist-info %python_alternative %{_bindir}/dmypy %python_alternative %{_bindir}/mypy %python_alternative %{_bindir}/mypyc ++++++ workaround-parenthesized-context-managers.patch ++++++ >From fb610cb043ea990046d3665ac39238d5223e3eb3 Mon Sep 17 00:00:00 2001 From: hauntsaninja <hauntsani...@gmail.com> 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 <hauntsani...@gmail.com> 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 <hauntsani...@gmail.com> 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 <hauntsani...@gmail.com> 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,