Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-cloudpickle for openSUSE:Factory checked in at 2022-10-28 19:28:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-cloudpickle (Old) and /work/SRC/openSUSE:Factory/.python-cloudpickle.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-cloudpickle" Fri Oct 28 19:28:38 2022 rev:17 rq:1031943 version:2.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-cloudpickle/python-cloudpickle.changes 2022-10-01 17:42:16.461573704 +0200 +++ /work/SRC/openSUSE:Factory/.python-cloudpickle.new.2275/python-cloudpickle.changes 2022-10-28 19:28:41.650379738 +0200 @@ -1,0 +2,6 @@ +Fri Oct 28 12:04:27 UTC 2022 - Daniel Garcia <daniel.gar...@suse.com> + +- Add Move-builtin-classmethod_descriptor-to-a-different-t.patch to fix the + tests with python 3.10.8 gh#cloudpipe/cloudpickle#486 + +------------------------------------------------------------------- New: ---- Move-builtin-classmethod_descriptor-to-a-different-t.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-cloudpickle.spec ++++++ --- /var/tmp/diff_new_pack.sJEHPC/_old 2022-10-28 19:28:42.326383129 +0200 +++ /var/tmp/diff_new_pack.sJEHPC/_new 2022-10-28 19:28:42.334383169 +0200 @@ -25,6 +25,8 @@ License: BSD-3-Clause URL: https://github.com/cloudpipe/cloudpickle Source: https://files.pythonhosted.org/packages/source/c/cloudpickle/cloudpickle-%{version}.tar.gz +# PATCH-FIX-UPSTREAM Move-builtin-classmethod_descriptor-to-a-different-t.patch gh#cloudpipe/cloudpickle#486 +Patch0: Move-builtin-classmethod_descriptor-to-a-different-t.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -53,7 +55,7 @@ functions and classes defined interactively in the __main__ module. %prep -%setup -q -n cloudpickle-%{version} +%autosetup -p1 -n cloudpickle-%{version} %build %python_build @@ -71,6 +73,7 @@ %files %{python_files} %doc README.md %license LICENSE -%{python_sitelib}/* +%{python_sitelib}/cloudpickle +%{python_sitelib}/cloudpickle-%{version}*-info %changelog ++++++ Move-builtin-classmethod_descriptor-to-a-different-t.patch ++++++ >From 9b332800fa09bec1f03fd4dd10ca69d1655c809c Mon Sep 17 00:00:00 2001 From: Daniel Garcia Moreno <daniel.gar...@suse.com> Date: Fri, 28 Oct 2022 13:55:45 +0200 Subject: [PATCH] Move builtin classmethod_descriptor to a different test This patch mvoes the builtin classmethod descriptor test to a different one and mark it to skip for python >= 3.10.8. The classmethod descriptor serializarion was removed from python in these releases: https://docs.python.org/3.10/whatsnew/changelog.html#id3 More information in the github issue: https://github.com/python/cpython/issues/95196 Fix https://github.com/cloudpipe/cloudpickle/issues/485 --- tests/cloudpickle_test.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/tests/cloudpickle_test.py b/tests/cloudpickle_test.py index 7bb0322..2701852 100644 --- a/tests/cloudpickle_test.py +++ b/tests/cloudpickle_test.py @@ -868,21 +868,16 @@ class CloudPickleTest(unittest.TestCase): assert depickled_unbound_meth is unbound_classicmethod assert depickled_clsdict_meth is clsdict_classicmethod - def test_builtin_classmethod(self): obj = 1.5 # float object bound_clsmethod = obj.fromhex # builtin_function_or_method unbound_clsmethod = type(obj).fromhex # builtin_function_or_method - clsdict_clsmethod = type( - obj).__dict__['fromhex'] # classmethod_descriptor depickled_bound_meth = pickle_depickle( bound_clsmethod, protocol=self.protocol) depickled_unbound_meth = pickle_depickle( unbound_clsmethod, protocol=self.protocol) - depickled_clsdict_meth = pickle_depickle( - clsdict_clsmethod, protocol=self.protocol) # float.fromhex takes a string as input. arg = "0x1" @@ -893,6 +888,21 @@ class CloudPickleTest(unittest.TestCase): assert depickled_bound_meth(arg) == bound_clsmethod(arg) assert depickled_unbound_meth(arg) == unbound_clsmethod(arg) + @pytest.mark.skipif( + sys.version_info >= (3, 10, 8), + reason="Disabled classmethod_descriptor pickle https://github.com/python/cpython/issues/95196" + ) + def test_builtin_classmethod_descriptor(self): + obj = 1.5 # float object + + clsdict_clsmethod = type( + obj).__dict__['fromhex'] # classmethod_descriptor + + depickled_clsdict_meth = pickle_depickle( + clsdict_clsmethod, protocol=self.protocol) + + # float.fromhex takes a string as input. + arg = "0x1" if platform.python_implementation() == 'CPython': # Roundtripping a classmethod_descriptor results in a # builtin_function_or_method (CPython upstream issue). -- 2.38.0