From a0cf5fa7c0ce8daf5d5d08cd47be28ee8933dfc23a09c947432cbec3544f674a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Tue, 15 Aug 2023 08:40:38 +0000 Subject: [PATCH] Accepting request 1103944 from home:dirkmueller:branches:openSUSE:Factory:Rings:1-MinimalX - add python312.patch to build with python 3.12 OBS-URL: https://build.opensuse.org/request/show/1103944 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-persistent?expand=0&rev=32 --- python-persistent.changes | 5 ++ python-persistent.spec | 3 +- python312.patch | 96 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 python312.patch diff --git a/python-persistent.changes b/python-persistent.changes index 0c8d215..04e39a7 100644 --- a/python-persistent.changes +++ b/python-persistent.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Aug 14 21:52:43 UTC 2023 - Dirk Müller + +- add python312.patch to build with python 3.12 + ------------------------------------------------------------------- Fri Jun 9 12:35:32 UTC 2023 - ecsos diff --git a/python-persistent.spec b/python-persistent.spec index a4ebf78..26e9c5e 100644 --- a/python-persistent.spec +++ b/python-persistent.spec @@ -25,6 +25,7 @@ Summary: Translucent persistent objects License: ZPL-2.1 URL: https://github.com/zopefoundation/persistent Source: https://files.pythonhosted.org/packages/source/p/persistent/persistent-%{version}.tar.gz +Patch1: python312.patch BuildRequires: %{python_module cffi} BuildRequires: %{python_module devel} BuildRequires: %{python_module manuel} @@ -51,7 +52,7 @@ Requires: python-devel This package contains the files needed for binding the %{name} C module. %prep -%setup -q -n persistent-%{version} +%autosetup -p1 -n persistent-%{version} rm -rf persistent.egg-info # this two tests fail persistently (pun intended): disable them here allows to build with 15.4 as well sed -i 's|test__p_repr_exception|tst__p_repr_exception|' src/persistent/tests/test_persistence.py diff --git a/python312.patch b/python312.patch new file mode 100644 index 0000000..90bb0fc --- /dev/null +++ b/python312.patch @@ -0,0 +1,96 @@ +From 2195d2edd96ad209568cbaa8499eb87c2fb8fc4e Mon Sep 17 00:00:00 2001 +From: Michael Howitz +Date: Thu, 30 Mar 2023 08:34:00 +0200 +Subject: [PATCH] Add preliminary support for Python 3.12a6. + +--- + .github/workflows/tests.yml | 34 +++++++++++++++++++++--- + .manylinux-install.sh | 11 ++++++-- + .meta.toml | 4 +-- + CHANGES.rst | 2 +- + appveyor.yml | 3 +++ + setup.cfg | 2 +- + src/persistent/tests/test_persistence.py | 5 ---- + src/persistent/tests/test_picklecache.py | 5 ---- + tox.ini | 5 +++- + 9 files changed, 50 insertions(+), 21 deletions(-) + +Index: persistent-5.0/.manylinux-install.sh +=================================================================== +--- persistent-5.0.orig/.manylinux-install.sh ++++ persistent-5.0/.manylinux-install.sh +@@ -28,6 +28,7 @@ yum -y install libffi-devel + + tox_env_map() { + case $1 in ++ *"cp312"*) echo 'py312';; + *"cp37"*) echo 'py37';; + *"cp38"*) echo 'py38';; + *"cp39"*) echo 'py39';; +@@ -40,13 +41,19 @@ tox_env_map() { + # Compile wheels + for PYBIN in /opt/python/*/bin; do + if \ ++ [[ "${PYBIN}" == *"cp312"* ]] || \ + [[ "${PYBIN}" == *"cp311"* ]] || \ + [[ "${PYBIN}" == *"cp37"* ]] || \ + [[ "${PYBIN}" == *"cp38"* ]] || \ + [[ "${PYBIN}" == *"cp39"* ]] || \ + [[ "${PYBIN}" == *"cp310"* ]] ; then +- "${PYBIN}/pip" install -e /io/ +- "${PYBIN}/pip" wheel /io/ -w wheelhouse/ ++ if [[ "${PYBIN}" == *"cp312"* ]] ; then ++ "${PYBIN}/pip" install --pre -e /io/ ++ "${PYBIN}/pip" wheel /io/ --pre -w wheelhouse/ ++ else ++ "${PYBIN}/pip" install -e /io/ ++ "${PYBIN}/pip" wheel /io/ -w wheelhouse/ ++ fi + if [ `uname -m` == 'aarch64' ]; then + cd /io/ + ${PYBIN}/pip install tox +Index: persistent-5.0/setup.cfg +=================================================================== +--- persistent-5.0.orig/setup.cfg ++++ persistent-5.0/setup.cfg +@@ -19,7 +19,7 @@ ignore = + force_single_line = True + combine_as_imports = True + sections = FUTURE,STDLIB,THIRDPARTY,ZOPE,FIRSTPARTY,LOCALFOLDER +-known_third_party = six, docutils, pkg_resources ++known_third_party = six, docutils, pkg_resources, pytz + known_zope = + known_first_party = + default_section = ZOPE +Index: persistent-5.0/src/persistent/tests/test_persistence.py +=================================================================== +--- persistent-5.0.orig/src/persistent/tests/test_persistence.py ++++ persistent-5.0/src/persistent/tests/test_persistence.py +@@ -29,11 +29,6 @@ from collections import UserDict as Iter + + class _Persistent_Base: + +- # py2/3 compat +- assertRaisesRegex = getattr(unittest.TestCase, +- 'assertRaisesRegex', +- unittest.TestCase.assertRaisesRegexp) +- + def _getTargetClass(self): + # concrete testcase classes must override + raise NotImplementedError() +Index: persistent-5.0/src/persistent/tests/test_picklecache.py +=================================================================== +--- persistent-5.0.orig/src/persistent/tests/test_picklecache.py ++++ persistent-5.0/src/persistent/tests/test_picklecache.py +@@ -60,11 +60,6 @@ def _len(seq): + + class PickleCacheTestMixin: + +- # py2/3 compat +- assertRaisesRegex = getattr(unittest.TestCase, +- 'assertRaisesRegex', +- unittest.TestCase.assertRaisesRegexp) +- + def _getTargetClass(self): + from persistent.picklecache import PickleCachePy as BasePickleCache + class PickleCache(BasePickleCache):