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 2023-05-09 13:07:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-cloudpickle (Old) and /work/SRC/openSUSE:Factory/.python-cloudpickle.new.1533 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-cloudpickle" Tue May 9 13:07:15 2023 rev:20 rq:1085559 version:2.2.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-cloudpickle/python-cloudpickle.changes 2023-02-19 18:18:50.401434544 +0100 +++ /work/SRC/openSUSE:Factory/.python-cloudpickle.new.1533/python-cloudpickle.changes 2023-05-09 13:07:27.957066733 +0200 @@ -1,0 +2,9 @@ +Mon May 8 18:15:45 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 2.2.1: + * Back to dev mode + * Move builtin classmethod_descriptor to a different test + * Fix Python 3.9+ NamedTuple issues +- drop Move-builtin-classmethod_descriptor-to-a-different-t.patch (upstream) + +------------------------------------------------------------------- Old: ---- Move-builtin-classmethod_descriptor-to-a-different-t.patch cloudpickle-2.2.0.tar.gz New: ---- cloudpickle-2.2.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-cloudpickle.spec ++++++ --- /var/tmp/diff_new_pack.VpbSSs/_old 2023-05-09 13:07:28.565070351 +0200 +++ /var/tmp/diff_new_pack.VpbSSs/_new 2023-05-09 13:07:28.569070375 +0200 @@ -18,14 +18,12 @@ %define skip_python2 1 Name: python-cloudpickle -Version: 2.2.0 +Version: 2.2.1 Release: 0 Summary: Extended pickling support for Python objects 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 ++++++ cloudpickle-2.2.0.tar.gz -> cloudpickle-2.2.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cloudpickle-2.2.0/PKG-INFO new/cloudpickle-2.2.1/PKG-INFO --- old/cloudpickle-2.2.0/PKG-INFO 2022-09-07 18:05:22.706607000 +0200 +++ new/cloudpickle-2.2.1/PKG-INFO 2023-01-19 10:23:10.625712200 +0100 @@ -1,12 +1,11 @@ Metadata-Version: 2.1 Name: cloudpickle -Version: 2.2.0 +Version: 2.2.1 Summary: Extended pickling support for Python objects Home-page: https://github.com/cloudpipe/cloudpickle Author: Cloudpipe Author-email: cloudp...@googlegroups.com License: BSD 3-Clause License -Platform: UNKNOWN Classifier: Development Status :: 4 - Beta Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: BSD License @@ -181,5 +180,3 @@ The aim of the `cloudpickle` project is to make that work available to a wider audience outside of the Spark ecosystem and to make it easier to improve it further notably with the help of a dedicated non-regression test suite. - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cloudpickle-2.2.0/cloudpickle/__init__.py new/cloudpickle-2.2.1/cloudpickle/__init__.py --- old/cloudpickle-2.2.0/cloudpickle/__init__.py 2022-09-07 18:04:23.000000000 +0200 +++ new/cloudpickle-2.2.1/cloudpickle/__init__.py 2023-01-19 10:21:50.000000000 +0100 @@ -5,4 +5,4 @@ # expose their Pickler subclass at top-level under the "Pickler" name. Pickler = CloudPickler -__version__ = '2.2.0' +__version__ = '2.2.1' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cloudpickle-2.2.0/cloudpickle/cloudpickle_fast.py new/cloudpickle-2.2.1/cloudpickle/cloudpickle_fast.py --- old/cloudpickle-2.2.0/cloudpickle/cloudpickle_fast.py 2022-09-07 18:03:49.000000000 +0200 +++ new/cloudpickle-2.2.1/cloudpickle/cloudpickle_fast.py 2023-01-19 09:54:51.000000000 +0100 @@ -111,8 +111,8 @@ def _class_getnewargs(obj): type_kwargs = {} - if "__slots__" in obj.__dict__: - type_kwargs["__slots__"] = obj.__slots__ + if "__module__" in obj.__dict__: + type_kwargs["__module__"] = obj.__module__ __dict__ = obj.__dict__.get('__dict__', None) if isinstance(__dict__, property): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cloudpickle-2.2.0/cloudpickle.egg-info/PKG-INFO new/cloudpickle-2.2.1/cloudpickle.egg-info/PKG-INFO --- old/cloudpickle-2.2.0/cloudpickle.egg-info/PKG-INFO 2022-09-07 18:05:22.000000000 +0200 +++ new/cloudpickle-2.2.1/cloudpickle.egg-info/PKG-INFO 2023-01-19 10:23:10.000000000 +0100 @@ -1,12 +1,11 @@ Metadata-Version: 2.1 Name: cloudpickle -Version: 2.2.0 +Version: 2.2.1 Summary: Extended pickling support for Python objects Home-page: https://github.com/cloudpipe/cloudpickle Author: Cloudpipe Author-email: cloudp...@googlegroups.com License: BSD 3-Clause License -Platform: UNKNOWN Classifier: Development Status :: 4 - Beta Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: BSD License @@ -181,5 +180,3 @@ The aim of the `cloudpickle` project is to make that work available to a wider audience outside of the Spark ecosystem and to make it easier to improve it further notably with the help of a dedicated non-regression test suite. - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cloudpickle-2.2.0/cloudpickle.egg-info/SOURCES.txt new/cloudpickle-2.2.1/cloudpickle.egg-info/SOURCES.txt --- old/cloudpickle-2.2.0/cloudpickle.egg-info/SOURCES.txt 2022-09-07 18:05:22.000000000 +0200 +++ new/cloudpickle-2.2.1/cloudpickle.egg-info/SOURCES.txt 2023-01-19 10:23:10.000000000 +0100 @@ -19,6 +19,12 @@ tests/cloudpickle_testpkg/setup.py tests/cloudpickle_testpkg/_cloudpickle_testpkg/__init__.py tests/cloudpickle_testpkg/_cloudpickle_testpkg/mod.py +tests/cloudpickle_testpkg/build/lib/_cloudpickle_testpkg/__init__.py +tests/cloudpickle_testpkg/build/lib/_cloudpickle_testpkg/mod.py +tests/cloudpickle_testpkg/cloudpickle_testpkg.egg-info/PKG-INFO +tests/cloudpickle_testpkg/cloudpickle_testpkg.egg-info/SOURCES.txt +tests/cloudpickle_testpkg/cloudpickle_testpkg.egg-info/dependency_links.txt +tests/cloudpickle_testpkg/cloudpickle_testpkg.egg-info/top_level.txt tests/mock_local_folder/mod.py tests/mock_local_folder/subfolder/submod.py tests/old_pickles/cpython_36/class_with_type_hints.pkl diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cloudpickle-2.2.0/tests/cloudpickle_test.py new/cloudpickle-2.2.1/tests/cloudpickle_test.py --- old/cloudpickle-2.2.0/tests/cloudpickle_test.py 2022-09-07 15:43:43.000000000 +0200 +++ new/cloudpickle-2.2.1/tests/cloudpickle_test.py 2023-01-19 09:54:51.000000000 +0100 @@ -868,21 +868,16 @@ 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,40 @@ 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) and + platform.python_implementation() == 'CPython' + ), + + reason=( + "CPython dropped support for pickling classmethod_descriptor," + "https://github.com/python/cpython/issues/95196" + ) + + ) + def test_builtin_classmethod_descriptor(self): + # `classmethod_descriptor` is the analogue `classmethod` (used for + # pure Python classes) for builtin types. Until CPython 3.10.8, + # `classmethod_descriptor` implemented an (incorrect) reducer. After + # https://github.com/python/cpython/issues/95196 revealed its + # incorrectness, this reducer was dropped (and not fixed), on the + # ground that pickling its Pythonic equivalent, `classmethod`, + # was never supported in the first place. + # Note that cloudpickle supports pickling `classmethod` objects, + # but never patched pickle's incorrect `classmethod_descriptor` + # reducer: pickling `classmethod_descriptor` objects using cloudpickle + # has always been broken. + 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). @@ -1469,7 +1498,11 @@ def test_dynamic_pytest_module(self): # Test case for pull request https://github.com/cloudpipe/cloudpickle/pull/116 - import py + + # This test does not longer make sense with pytest >= 7.2 + py = pytest.importorskip("py") + if not hasattr(py, "builtin"): + pytest.skip("py.builtin is not available") def f(): s = py.builtin.set([1]) @@ -1564,6 +1597,24 @@ assert isinstance(depickled_t2, MyTuple) assert depickled_t2 == t2 + def test_NamedTuple(self): + class MyTuple(typing.NamedTuple): + a: int + b: int + c: int + + t1 = MyTuple(1, 2, 3) + t2 = MyTuple(3, 2, 1) + + depickled_t1, depickled_MyTuple, depickled_t2 = pickle_depickle( + [t1, MyTuple, t2], protocol=self.protocol) + + assert isinstance(depickled_t1, MyTuple) + assert depickled_t1 == t1 + assert depickled_MyTuple is MyTuple + assert isinstance(depickled_t2, MyTuple) + assert depickled_t2 == t2 + def test_interactively_defined_function(self): # Check that callables defined in the __main__ module of a Python # script (or jupyter kernel) can be pickled / unpickled / executed. @@ -2063,6 +2114,8 @@ depickled_obj = pickle_depickle( initial_obj, protocol=self.protocol) + assert depickled_obj.__class__.__slots__ == slots + for obj in [initial_obj, depickled_obj]: self.assertEqual(obj.registered_attribute, 42) with pytest.raises(AttributeError): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cloudpickle-2.2.0/tests/cloudpickle_testpkg/build/lib/_cloudpickle_testpkg/__init__.py new/cloudpickle-2.2.1/tests/cloudpickle_testpkg/build/lib/_cloudpickle_testpkg/__init__.py --- old/cloudpickle-2.2.0/tests/cloudpickle_testpkg/build/lib/_cloudpickle_testpkg/__init__.py 1970-01-01 01:00:00.000000000 +0100 +++ new/cloudpickle-2.2.1/tests/cloudpickle_testpkg/build/lib/_cloudpickle_testpkg/__init__.py 2022-09-07 15:43:43.000000000 +0200 @@ -0,0 +1,45 @@ +import typing +from . import mod # noqa + + +def package_function(): + """Function living inside a package, not a simple module""" + return "hello from a package!" + + +global_variable = "some global variable" + + +def package_function_with_global(): + global global_variable + return global_variable + + +class _SingletonClass: + def __reduce__(self): + # This reducer is only valid for the top level "some_singleton" object. + return "some_singleton" + + +def relative_imports_factory(): + """Factory creating dynamically-defined functions using relative imports + + Relative import of functions living both inside modules and packages are + tested. + """ + def f(): + # module_function belongs to _cloudpickle_testpkg.mod, which is a + # module + from .mod import module_function + return module_function() + + def g(): + # package_function belongs to _cloudpickle_testpkg, which is a package + from . import package_function + return package_function() + + return f, g + + +some_singleton = _SingletonClass() +T = typing.TypeVar('T') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cloudpickle-2.2.0/tests/cloudpickle_testpkg/build/lib/_cloudpickle_testpkg/mod.py new/cloudpickle-2.2.1/tests/cloudpickle_testpkg/build/lib/_cloudpickle_testpkg/mod.py --- old/cloudpickle-2.2.0/tests/cloudpickle_testpkg/build/lib/_cloudpickle_testpkg/mod.py 1970-01-01 01:00:00.000000000 +0100 +++ new/cloudpickle-2.2.1/tests/cloudpickle_testpkg/build/lib/_cloudpickle_testpkg/mod.py 2021-08-01 11:50:56.000000000 +0200 @@ -0,0 +1,73 @@ +import sys +import types + + +# #354: To emulate package capabilities while being a single file, an extension +# module (for instance a mod.so file) can dynamically create a module object +# (most likely using the *package_name*.*parent_module_name*.*submodule_name* +# naming convention to be compatible with ``import`` semantics). Internally, +# it will use the Python/C API ``PyImport_AddModule(submodule_qualified_name)`` +# utility, which creates a module object and adds it inside ``sys.modules``. A +# module created this way IS a dynamic module. However, because the ``import`` +# machinery automatically imports the parent package/module of a submodule +# before importing the submodule itself, and importing the parent +# package/module creates and append the submodule to sys.modules (sys.modules +# acts as a cache for the import machinery), this submodule, albeit dynamic, is +# importable. To detect this, we need to recursively check the parent modules +# of this submodule to see if the parent module is importable. If yes, we +# reasonably assume that the submodule named using the aforementioned +# hierarchised convention has been created during the import of its parent +# module. The following lines emulate such a behavior without being a compiled +# extension module. + +submodule_name = '_cloudpickle_testpkg.mod.dynamic_submodule' +dynamic_submodule = types.ModuleType(submodule_name) + +# This line allows the dynamic_module to be imported using either one of: +# - ``from _cloudpickle_testpkg.mod import dynamic_submodule`` +# - ``import _cloudpickle_testpkg.mod.dynamic_submodule`` +sys.modules[submodule_name] = dynamic_submodule +# Both lines will make importlib try to get the module from sys.modules after +# importing the parent module, before trying getattr(mod, 'dynamic_submodule'), +# so this dynamic module could be binded to another name. This behavior is +# demonstrated with `dynamic_submodule_two` + +submodule_name_two = '_cloudpickle_testpkg.mod.dynamic_submodule_two' +# Notice the inconsistent name binding, breaking attribute lookup-based import +# attempts. +another_submodule = types.ModuleType(submodule_name_two) +sys.modules[submodule_name_two] = another_submodule + + +# In this third case, the module is not added to sys.modules, and can only be +# imported using attribute lookup-based imports. +submodule_three = types.ModuleType( + '_cloudpickle_testpkg.mod.dynamic_submodule_three' +) +code = """ +def f(x): + return x +""" + +exec(code, vars(submodule_three)) + +# What about a dynamic submodule inside a dynamic submodule inside an +# importable module? +subsubmodule_name = ( + '_cloudpickle_testpkg.mod.dynamic_submodule.dynamic_subsubmodule' +) +dynamic_subsubmodule = types.ModuleType(subsubmodule_name) +dynamic_submodule.dynamic_subsubmodule = dynamic_subsubmodule +sys.modules[subsubmodule_name] = dynamic_subsubmodule + + +def module_function(): + return "hello from a module!" + + +global_variable = "some global variable" + + +def module_function_with_global(): + global global_variable + return global_variable diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cloudpickle-2.2.0/tests/cloudpickle_testpkg/cloudpickle_testpkg.egg-info/PKG-INFO new/cloudpickle-2.2.1/tests/cloudpickle_testpkg/cloudpickle_testpkg.egg-info/PKG-INFO --- old/cloudpickle-2.2.0/tests/cloudpickle_testpkg/cloudpickle_testpkg.egg-info/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/cloudpickle-2.2.1/tests/cloudpickle_testpkg/cloudpickle_testpkg.egg-info/PKG-INFO 2023-01-17 19:14:47.000000000 +0100 @@ -0,0 +1,8 @@ +Metadata-Version: 2.1 +Name: cloudpickle-testpkg +Version: 0.0.0 +Summary: Package used only for cloudpickle testing purposes +Author: Cloudpipe +Author-email: cloudp...@googlegroups.com +License: BSD 3-Clause License +Requires-Python: >=3.5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cloudpickle-2.2.0/tests/cloudpickle_testpkg/cloudpickle_testpkg.egg-info/SOURCES.txt new/cloudpickle-2.2.1/tests/cloudpickle_testpkg/cloudpickle_testpkg.egg-info/SOURCES.txt --- old/cloudpickle-2.2.0/tests/cloudpickle_testpkg/cloudpickle_testpkg.egg-info/SOURCES.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/cloudpickle-2.2.1/tests/cloudpickle_testpkg/cloudpickle_testpkg.egg-info/SOURCES.txt 2023-01-17 19:14:47.000000000 +0100 @@ -0,0 +1,7 @@ +setup.py +_cloudpickle_testpkg/__init__.py +_cloudpickle_testpkg/mod.py +cloudpickle_testpkg.egg-info/PKG-INFO +cloudpickle_testpkg.egg-info/SOURCES.txt +cloudpickle_testpkg.egg-info/dependency_links.txt +cloudpickle_testpkg.egg-info/top_level.txt \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cloudpickle-2.2.0/tests/cloudpickle_testpkg/cloudpickle_testpkg.egg-info/dependency_links.txt new/cloudpickle-2.2.1/tests/cloudpickle_testpkg/cloudpickle_testpkg.egg-info/dependency_links.txt --- old/cloudpickle-2.2.0/tests/cloudpickle_testpkg/cloudpickle_testpkg.egg-info/dependency_links.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/cloudpickle-2.2.1/tests/cloudpickle_testpkg/cloudpickle_testpkg.egg-info/dependency_links.txt 2023-01-17 19:14:47.000000000 +0100 @@ -0,0 +1 @@ + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cloudpickle-2.2.0/tests/cloudpickle_testpkg/cloudpickle_testpkg.egg-info/top_level.txt new/cloudpickle-2.2.1/tests/cloudpickle_testpkg/cloudpickle_testpkg.egg-info/top_level.txt --- old/cloudpickle-2.2.0/tests/cloudpickle_testpkg/cloudpickle_testpkg.egg-info/top_level.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/cloudpickle-2.2.1/tests/cloudpickle_testpkg/cloudpickle_testpkg.egg-info/top_level.txt 2023-01-17 19:14:47.000000000 +0100 @@ -0,0 +1 @@ +_cloudpickle_testpkg