From 3c51ad07f1c608a32bb1b7665a3756babef8de75f7d3bdf0c155cde9c9c811ad Mon Sep 17 00:00:00 2001 From: Oliver Kurz Date: Thu, 26 Sep 2024 18:20:07 +0000 Subject: [PATCH 1/2] Accepting request 1203592 from home:glaubitz:branches:devel:languages:python - Cherry-pick upstream patch to fix testsuite segfault with Python 3.13 * fix-testsuite-segfault.patch OBS-URL: https://build.opensuse.org/request/show/1203592 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-zope.interface?expand=0&rev=72 --- fix-testsuite-segfault.patch | 25 +++++++++++++++++++++++++ python-zope.interface.changes | 6 ++++++ python-zope.interface.spec | 3 +++ 3 files changed, 34 insertions(+) create mode 100644 fix-testsuite-segfault.patch diff --git a/fix-testsuite-segfault.patch b/fix-testsuite-segfault.patch new file mode 100644 index 0000000..64935cd --- /dev/null +++ b/fix-testsuite-segfault.patch @@ -0,0 +1,25 @@ +diff --git a/src/zope/interface/common/tests/test_collections.py b/src/zope/interface/common/tests/test_collections.py +index 6d23f6f..122351a 100644 +--- a/src/zope/interface/common/tests/test_collections.py ++++ b/src/zope/interface/common/tests/test_collections.py +@@ -12,6 +12,7 @@ + + + import array ++import sys + import unittest + from collections import OrderedDict + from collections import abc +@@ -127,6 +128,12 @@ class TestVerifyObject(VerifyObjectMixin, + 'async_generator': unittest.SkipTest, + type(iter(tuple())): lambda: iter(tuple()), + } ++ if sys.version_info >= (3, 13): ++ def FrameLocalsProxy_constructor(): ++ FrameLocalsProxy = type([sys._getframe().f_locals for x in range(1)][0]) ++ return FrameLocalsProxy(sys._getframe()) ++ FrameLocalsProxy = type([sys._getframe().f_locals for x in range(1)][0]) ++ CONSTRUCTORS[FrameLocalsProxy] = FrameLocalsProxy_constructor + + UNVERIFIABLE_RO = { + # ``array.array`` fails the ``test_auto_ro_*`` tests with and diff --git a/python-zope.interface.changes b/python-zope.interface.changes index f25c7c2..f44f88f 100644 --- a/python-zope.interface.changes +++ b/python-zope.interface.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Sep 25 13:39:50 UTC 2024 - John Paul Adrian Glaubitz + +- Cherry-pick upstream patch to fix testsuite segfault with Python 3.13 + * fix-testsuite-segfault.patch + ------------------------------------------------------------------- Sun Sep 8 13:11:24 UTC 2024 - Dirk Müller diff --git a/python-zope.interface.spec b/python-zope.interface.spec index b4a9082..ebd8675 100644 --- a/python-zope.interface.spec +++ b/python-zope.interface.spec @@ -33,6 +33,8 @@ Summary: Interfaces for Python License: ZPL-2.1 URL: https://pypi.python.org/pypi/zope.interface Source: https://files.pythonhosted.org/packages/source/z/zope.interface/%{modname}-%{version}.tar.gz +# PATCH-FIX-UPSTREAM - gh/zopefoundation/zope.interface#323#issuecomment-2374076122 - Fix testsuite segfault with Python 3.13 +Patch: https://github.com/zopefoundation/zope.interface/pull/324.patch#/fix-testsuite-segfault.patch # needed for tests that try to compile things BuildRequires: %{python_module devel >= 3.7} BuildRequires: %{python_module pip} @@ -61,6 +63,7 @@ the Design By Contract methodology support in Python. %prep %setup -q -n %{modname}-%{version} +%patch -P0 -p1 %build %if !%{with test} From 048c7ac55a6f363cd5043a9780a88cd2d77b48be720e5e111ac11503f2c64052 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 14 Oct 2024 03:38:40 +0000 Subject: [PATCH 2/2] - Update to 7.1.0: * Declare support for Python 3.13. * Fix segmentation faults on Python 3.13. (#323) - Drop patch fix-testsuite-segfault.patch, included upstream. - Switch to autosetup macros. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-zope.interface?expand=0&rev=73 --- fix-testsuite-segfault.patch | 25 ------------------------- python-zope.interface.changes | 9 +++++++++ python-zope.interface.spec | 17 +++++++---------- zope.interface-7.0.3.tar.gz | 3 --- zope_interface-7.1.0.tar.gz | 3 +++ 5 files changed, 19 insertions(+), 38 deletions(-) delete mode 100644 fix-testsuite-segfault.patch delete mode 100644 zope.interface-7.0.3.tar.gz create mode 100644 zope_interface-7.1.0.tar.gz diff --git a/fix-testsuite-segfault.patch b/fix-testsuite-segfault.patch deleted file mode 100644 index 64935cd..0000000 --- a/fix-testsuite-segfault.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/src/zope/interface/common/tests/test_collections.py b/src/zope/interface/common/tests/test_collections.py -index 6d23f6f..122351a 100644 ---- a/src/zope/interface/common/tests/test_collections.py -+++ b/src/zope/interface/common/tests/test_collections.py -@@ -12,6 +12,7 @@ - - - import array -+import sys - import unittest - from collections import OrderedDict - from collections import abc -@@ -127,6 +128,12 @@ class TestVerifyObject(VerifyObjectMixin, - 'async_generator': unittest.SkipTest, - type(iter(tuple())): lambda: iter(tuple()), - } -+ if sys.version_info >= (3, 13): -+ def FrameLocalsProxy_constructor(): -+ FrameLocalsProxy = type([sys._getframe().f_locals for x in range(1)][0]) -+ return FrameLocalsProxy(sys._getframe()) -+ FrameLocalsProxy = type([sys._getframe().f_locals for x in range(1)][0]) -+ CONSTRUCTORS[FrameLocalsProxy] = FrameLocalsProxy_constructor - - UNVERIFIABLE_RO = { - # ``array.array`` fails the ``test_auto_ro_*`` tests with and diff --git a/python-zope.interface.changes b/python-zope.interface.changes index f44f88f..5c202ae 100644 --- a/python-zope.interface.changes +++ b/python-zope.interface.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon Oct 14 03:37:17 UTC 2024 - Steve Kowalik + +- Update to 7.1.0: + * Declare support for Python 3.13. + * Fix segmentation faults on Python 3.13. (#323) +- Drop patch fix-testsuite-segfault.patch, included upstream. +- Switch to autosetup macros. + ------------------------------------------------------------------- Wed Sep 25 13:39:50 UTC 2024 - John Paul Adrian Glaubitz diff --git a/python-zope.interface.spec b/python-zope.interface.spec index ebd8675..7ba1d13 100644 --- a/python-zope.interface.spec +++ b/python-zope.interface.spec @@ -24,26 +24,24 @@ %define psuffix %{nil} %bcond_with test %endif -%global modname zope.interface +%global modname zope_interface %{?sle15_python_module_pythons} Name: python-zope.interface%{psuffix} -Version: 7.0.3 +Version: 7.1.0 Release: 0 Summary: Interfaces for Python License: ZPL-2.1 URL: https://pypi.python.org/pypi/zope.interface -Source: https://files.pythonhosted.org/packages/source/z/zope.interface/%{modname}-%{version}.tar.gz -# PATCH-FIX-UPSTREAM - gh/zopefoundation/zope.interface#323#issuecomment-2374076122 - Fix testsuite segfault with Python 3.13 -Patch: https://github.com/zopefoundation/zope.interface/pull/324.patch#/fix-testsuite-segfault.patch +Source: https://files.pythonhosted.org/packages/source/z/%{modname}/%{modname}-%{version}.tar.gz # needed for tests that try to compile things -BuildRequires: %{python_module devel >= 3.7} +BuildRequires: %{python_module devel >= 3.8} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} # SECTION test requirements %if %{with test} BuildRequires: %{python_module zope.event} -BuildRequires: %{python_module zope.interface} +BuildRequires: %{python_module zope.interface = %{version}} BuildRequires: %{python_module zope.testing} %endif # /SECTION @@ -62,8 +60,7 @@ API or contract. So, this package can be considered as implementation of the Design By Contract methodology support in Python. %prep -%setup -q -n %{modname}-%{version} -%patch -P0 -p1 +%autosetup -p1 -n %{modname}-%{version} %build %if !%{with test} @@ -87,7 +84,7 @@ cd src %files %{python_files} %license LICENSE.txt COPYRIGHT.txt %doc CHANGES.rst README.rst -%{python_sitearch}/zope.interface-%{version}*-info +%{python_sitearch}/zope.interface-%{version}.dist-info %{python_sitearch}/zope.interface-%{version}*-nspkg.pth %dir %{python_sitearch}/zope %{python_sitearch}/zope/interface diff --git a/zope.interface-7.0.3.tar.gz b/zope.interface-7.0.3.tar.gz deleted file mode 100644 index 00a24d2..0000000 --- a/zope.interface-7.0.3.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cd2690d4b08ec9eaf47a85914fe513062b20da78d10d6d789a792c0b20307fb1 -size 252504 diff --git a/zope_interface-7.1.0.tar.gz b/zope_interface-7.1.0.tar.gz new file mode 100644 index 0000000..583a2de --- /dev/null +++ b/zope_interface-7.1.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f005869a1a05e368965adb2075f97f8ee9a26c61898a9e52a9764d93774f237 +size 300239