From 8f758fc96e5123348d566da53f92a2a8c0d01ad6e1c7b357b458c09dd758cd5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Mon, 9 Sep 2024 10:55:05 +0000 Subject: [PATCH] Accepting request 1199649 from home:glaubitz:branches:devel:languages:python - Cherry-pick proposed patch from Fedora to fix testsuite with Python 3.13 * Fix-test_extract_class_dict-for-Python-313.patch OBS-URL: https://build.opensuse.org/request/show/1199649 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cloudpickle?expand=0&rev=56 --- ...est_extract_class_dict-for-Python-313.patch | 18 ++++++++++++++++++ python-cloudpickle.changes | 6 ++++++ python-cloudpickle.spec | 2 ++ 3 files changed, 26 insertions(+) create mode 100644 Fix-test_extract_class_dict-for-Python-313.patch diff --git a/Fix-test_extract_class_dict-for-Python-313.patch b/Fix-test_extract_class_dict-for-Python-313.patch new file mode 100644 index 0000000..3f7684d --- /dev/null +++ b/Fix-test_extract_class_dict-for-Python-313.patch @@ -0,0 +1,18 @@ +diff --git a/tests/cloudpickle_test.py b/tests/cloudpickle_test.py +index 5aa4bac..af5ef3e 100644 +--- a/tests/cloudpickle_test.py ++++ b/tests/cloudpickle_test.py +@@ -110,7 +110,12 @@ def test_extract_class_dict(): + return "c" + + clsdict = _extract_class_dict(C) +- assert sorted(clsdict.keys()) == ["C_CONSTANT", "__doc__", "method_c"] ++ expected_keys = ["C_CONSTANT", "__doc__", "method_c"] ++ # New attribute in Python 3.13 beta 1 ++ # https://github.com/python/cpython/pull/118475 ++ if sys.version_info >= (3, 13): ++ expected_keys.insert(2, "__firstlineno__") ++ assert sorted(clsdict.keys()) == expected_keys + assert clsdict["C_CONSTANT"] == 43 + assert clsdict["__doc__"] is None + assert clsdict["method_c"](C()) == C().method_c() diff --git a/python-cloudpickle.changes b/python-cloudpickle.changes index 23d6b24..015f8e2 100644 --- a/python-cloudpickle.changes +++ b/python-cloudpickle.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Sep 9 09:43:13 UTC 2024 - John Paul Adrian Glaubitz + +- Cherry-pick proposed patch from Fedora to fix testsuite with Python 3.13 + * Fix-test_extract_class_dict-for-Python-313.patch + ------------------------------------------------------------------- Thu Aug 29 15:43:09 UTC 2024 - Ben Greiner diff --git a/python-cloudpickle.spec b/python-cloudpickle.spec index 1a90a6b..fa4dc1c 100644 --- a/python-cloudpickle.spec +++ b/python-cloudpickle.spec @@ -24,6 +24,8 @@ Summary: Extended pickling support for Python objects License: BSD-3-Clause URL: https://github.com/cloudpipe/cloudpickle Source: https://github.com/cloudpipe/cloudpickle/archive/refs/tags/v{%version}.tar.gz#/cloudpickle-%{version}-gh.tar.gz +# PATCH-FIX-UPSTREAM gh/cloudpipe/cloudpickle#534 - Fix test_extract_class_dict for Python 3.13 beta 1 +Patch: Fix-test_extract_class_dict-for-Python-313.patch BuildRequires: %{python_module base >= 3.8} BuildRequires: %{python_module flit-core} BuildRequires: %{python_module pip}