From eb5aa2418a0f41fbee1d184da6857674d26eebaffc38377ed717f5131f2cbb38 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 20 Jan 2026 01:52:27 +0000 Subject: [PATCH] - Update to 0.4.1: * drop formal support for python 3.8 * use get_file_type to open _pyio file types * update rtfd to 3.12 and docs requirements * formal support for 3.14; init support for 3.15 * dict and weakref descriptors are singletons in 3.15 * sync with rtd 15.4.1 * ensure valid class qualname in getsource * avoid numpy segfault for 3.15.0a3 * update copyright for 2026, urllib3 to 2.6.0 - Drop patch fix-contextvars.patch, merged upstream. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dill?expand=0&rev=45 --- .gitattributes | 23 ++++ .gitignore | 1 + dill-0.4.0.tar.gz | 3 + dill-0.4.1.tar.gz | 3 + fix-contextvars.patch | 36 ++++++ python-dill.changes | 270 ++++++++++++++++++++++++++++++++++++++++++ python-dill.spec | 104 ++++++++++++++++ 7 files changed, 440 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 dill-0.4.0.tar.gz create mode 100644 dill-0.4.1.tar.gz create mode 100644 fix-contextvars.patch create mode 100644 python-dill.changes create mode 100644 python-dill.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/dill-0.4.0.tar.gz b/dill-0.4.0.tar.gz new file mode 100644 index 0000000..d84a3fc --- /dev/null +++ b/dill-0.4.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac4fe8071bf2859cc02b6ca8ed75d2727b24b564de09f37b59d666bafd7848a7 +size 180077 diff --git a/dill-0.4.1.tar.gz b/dill-0.4.1.tar.gz new file mode 100644 index 0000000..5cd74ec --- /dev/null +++ b/dill-0.4.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6fc954a2b757aaf7a38cf41e7feddcf5109230bc72888e51df1fb7d799946ef5 +size 180239 diff --git a/fix-contextvars.patch b/fix-contextvars.patch new file mode 100644 index 0000000..cba62c2 --- /dev/null +++ b/fix-contextvars.patch @@ -0,0 +1,36 @@ +From a84c1a6baf4ba3f8d119da7166a6624ace6b8fc0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Thu, 22 May 2025 20:13:40 +0200 +Subject: [PATCH] Pickle _contextvars.Context objects, for threads in Python + 3.14+ + +Fixes https://github.com/uqfoundation/dill/issues/716 +--- + dill/_dill.py | 7 +++++++ + 1 file changed, 7 insertions(+) + +Index: dill-0.4.0/dill/_dill.py +=================================================================== +--- dill-0.4.0.orig/dill/_dill.py ++++ dill-0.4.0/dill/_dill.py +@@ -54,6 +54,7 @@ OLD312a7 = (sys.hexversion < 0x30c00a7) + import builtins as __builtin__ + from pickle import _Pickler as StockPickler, Unpickler as StockUnpickler + from pickle import GLOBAL, POP ++from _contextvars import Context + from _thread import LockType + from _thread import RLock as RLockType + try: +@@ -2119,6 +2120,12 @@ if HAS_CTYPES and hasattr(ctypes, 'pytho + else: + _testcapsule = None + ++@register(Context) ++def save_context(pickler, obj): ++ logger.trace(pickler, "Cx: %s", obj) ++ pickler.save_reduce(Context, tuple(obj.items()), obj=obj) ++ logger.trace(pickler, "# Cx") ++ + + ############################# + # A quick fix for issue #500 diff --git a/python-dill.changes b/python-dill.changes new file mode 100644 index 0000000..701b200 --- /dev/null +++ b/python-dill.changes @@ -0,0 +1,270 @@ +------------------------------------------------------------------- +Tue Jan 20 01:52:03 UTC 2026 - Steve Kowalik + +- Update to 0.4.1: + * drop formal support for python 3.8 + * use get_file_type to open _pyio file types + * update rtfd to 3.12 and docs requirements + * formal support for 3.14; init support for 3.15 + * dict and weakref descriptors are singletons in 3.15 + * sync with rtd 15.4.1 + * ensure valid class qualname in getsource + * avoid numpy segfault for 3.15.0a3 + * update copyright for 2026, urllib3 to 2.6.0 +- Drop patch fix-contextvars.patch, merged upstream. + +------------------------------------------------------------------- +Fri Nov 14 10:48:35 UTC 2025 - Marius Grossu + +- added a fix-contextvars.patch: + * Pickle _contextvars.Context objects, for threads in Python 3.14+ + +------------------------------------------------------------------- +Tue Aug 19 14:30:27 UTC 2025 - Markéta Machová + +- Still use update-alternatives on SLE-15 + +------------------------------------------------------------------- +Thu Jul 10 15:29:34 UTC 2025 - Dirk Müller + +- do not depend on alts for sle15 + +------------------------------------------------------------------- +Tue Jul 8 13:59:14 UTC 2025 - Markéta Machová + +- Convert to libalternatives + +------------------------------------------------------------------- +Mon May 5 02:47:52 UTC 2025 - Steve Kowalik + +- Update to 0.4.0: + * add initial support for python 3.14 + * fix typo in requirements.txt + * updated copyright for 2025 +- Switch to pyproject macros. + +------------------------------------------------------------------- +Tue Oct 22 13:27:09 UTC 2024 - Dirk Müller + +- update to 0.3.9: + * further skip BufferedRandomType if does not exist + * remove stray import of dbm in objects + * Add `UnpicklingError` import for `dill.load_session()` to fix + #648 + * fix fencepost error when getting source inside decorator in + interpreter (fixes #603) + * type check for Integral, bool by value + * diff USE_NUMPY imports numpy.ma + * adjust testing to account for frame.f_locals as a proxy in + 3.13 + * better handle import strings of numpy scalars + * handle a ThreadHandleType + * more extensive testing for dill.source + * add formal support for python 3.13 + +------------------------------------------------------------------- +Thu Aug 29 14:56:31 UTC 2024 - Frantisek Simorda + +- update to 0.3.8: + * test for qualname in get_typedef_type + * drop formal support for python 3.7 + * define html_theme as rtd workaround + * update install doc in tests by + * formal support for 3.12, initial support for 3.13 + * add build to rtfd config by + * add guard for math.log in Logger record size calculation by + * updated copyright for 2024 by + * Bump jinja2 from 3.1.1 to 3.1.3 in /docs by + * Import submodule properly when there is an attribute of the module with the same name + * update sphinx to 6.2.1 + * Bump readthedocs-sphinx-search from 0.3.1 to 0.3.2 in /docs by + * skip BufferedRandomType on pyodide + + +------------------------------------------------------------------- +Sat Nov 25 13:01:37 UTC 2023 - Dirk Müller + +- update to 0.3.7: + * Fix _is_builtin_module + * minor changes from PR #554 + * align LICENSE wording with BSD-3-Clause + * Python 3 Metaclasses [Support ABC and Enums - Part 1] + * Abstract Base Classes [Support ABC and Enums - Part 2] + * fix typo + * Bump requests from 2.27.1 to 2.31.0 in /docs + * Fixed crashed in _dill._is_builtin_module when a module's + __file__ is None + * Bump pygments from 2.11.2 to 2.15.0 in /docs + +------------------------------------------------------------------- +Thu May 4 15:20:33 UTC 2023 - Dirk Müller + +- build for python 3.7+ only + +------------------------------------------------------------------- +Thu Feb 16 23:13:45 UTC 2023 - Dirk Müller + +- restore installation of dbm module on SLE15 and older + +------------------------------------------------------------------- +Mon Nov 21 06:58:20 UTC 2022 - Daniel Garcia + +- Update the source from github and use the correct folder for setup and tests + +------------------------------------------------------------------- +Thu Nov 17 13:02:13 UTC 2022 - Daniel Garcia + +- Remove python_module macro definition +- Use sources from github, current release doesn't have tests +- Use autosetup instead of setup +- Update how to run tests +- More specific python_sitelib in %files +- Update to 0.3.6: + * fix: #480 create_code for 3.11.0a7 and 3.11.0b1 + * fix: #413, fix: #453, drop 2.7 support + * adjust save_code and _create_code for co_lnotab in PEP626 (#495) + * Lookup qualname instead of name in Python 3 (#486) + * Support PyCapsule (#477) + * Fix `dill._dill` submodule being saved as `GLOBAL "dill._shims" "_dill"` + (#490) + * Create a soft_def shim to combine move_to and Getattr (#473) + * Incidental implementation specific types (#472) + * Fix bug in pickling MappingProxyType in PyPy 3.7+ (#506) + * Bring back old method pickling function (#511) + * protect against sys.modules contents change + * correct failures and succeeds dicts + * correct failures for registered + * unregister SymtableEntryType + * Add detailed trace mode showing saved object size and visual depth level + (#471) + * Kickstart support drop for Python < 3.7 (#499) + * fix #521: support develop mode + * Rewrite _create_code() with Structural Pattern Matching (limited to tuples) + (#496) + * fix #522: unify README and module doc + * add some no-indent bullets + * Fix load_session() and restrict loading a session in a different module + (#507) + * update load_module dump_module docs + * fix dump_module() bugs and rename parameter 'main' to 'module' (#526) + * A temporary quick fix for dataclass serialization (#500) (#503) + * fix: #528, test_registered syncs objects w typemap + * print on fail for test_registered + * CLibraryLoader on unix in 3.11 + * add logger module to sphinx + * Move session-related code to new session module (#530) + * fix: #517 special handling of typing module + * test special case typing.Any + * more clearly note cpython bug + * Temporary quick fix for getsource() on IPython interpreter (fixes #346) + (#531) + * Fix pickling errors thrown when saving some Stdlib modules (#529) + * Fix `pickles()` flagging `__builtins__` as unpickleable due to the `all()` + function (#538) + * Use proper SPDX identifier for License (#539) + * Disable logging propagation, use current stderr as output (#541) + * move numpy special register to save + * fix pickling of CLibraryLoaderType + * Optimize the numpy hook (#542) + * patch to dump_module as in #535 + * ensure tempfiles are deleted by default + +------------------------------------------------------------------- +Mon Oct 3 15:54:56 UTC 2022 - Dirk Müller + +- update to 0.3.5.1: + * requires python 3.7 + * skip tests with broken stftime + * resolve symlinks when determining if module is builtin + * support python 3.10 + * adjust for python 3.11 + * Support recursive and empty closure cells + * use CAN_NULL for 3.11a7 and above + * better check for travis in tests + * parse init file for dist meta + * drop rtfd build to 3.8 + +------------------------------------------------------------------- +Sun Dec 19 17:30:19 UTC 2021 - Ben Greiner + +- Update to v0.3.4 + * no release notes, works with python310 +- Drop 07e24913.patch released upstream + +------------------------------------------------------------------- +Fri Feb 26 23:46:51 UTC 2021 - John Vandenberg + +- Add 07e24913.patch to fix s390x and ppc64 + +------------------------------------------------------------------- +Fri Feb 26 04:58:06 UTC 2021 - John Vandenberg + +- Update to v0.3.3 + * See https://github.com/uqfoundation/dill/compare/dill-0.3.2...dill-0.3.3 +- from v0.3.2 + * See https://github.com/uqfoundation/dill/compare/dill-0.3.1.1...dill-0.3.2 + +------------------------------------------------------------------- +Sun Dec 6 23:05:33 UTC 2020 - Benjamin Greiner + +- Require dbm for all python3 flavors in Tumbleweed + gh#openSUSE/python-rpm-macros#66 + +------------------------------------------------------------------- +Thu Jan 30 17:21:16 UTC 2020 - Todd R + +- version update to 0.3.1.1 + * Add support for pickling MappingProxyType on Python3 + * Fix GetSetDescriptorType unpickling error in test_selected.py + * add python 3.x keywords to dump and load + * add save_socket method for socket objects + * add support for pickling MappingProxyType + * cleanup of Pickler,Unpickler; move dump to Pickler.dump + * don't use multiple inheritance in Pickler,Unpickler + * enabled to pickle __kwdefaults__ property + * fix pickling keyword only arguments + * fix typo in readline error message (#327) + * more handling of 3.8 SyntaxWarnings + * rollback register(SocketType) due to multiprocess test_pickling failure + * unified handling of MappingProxyType and DictProxyType + +------------------------------------------------------------------- +Fri Jul 26 08:54:42 UTC 2019 - pgajdos@suse.com + +- version update to 0.3.0 + * no upstream changelog + +------------------------------------------------------------------- +Sat Mar 16 00:44:29 UTC 2019 - Jan Engelhardt + +- Use noun phrase in summary. +- Trim description a bit, for size. + +------------------------------------------------------------------- +Fri Mar 8 12:50:34 UTC 2019 - Tomáš Chvátal + +- Update to 0.2.9: + * Various test/flake updates + +------------------------------------------------------------------- +Tue Dec 4 12:47:17 UTC 2018 - Matej Cepl + +- Remove superfluous devel dependency for noarch package + +------------------------------------------------------------------- +Thu May 3 14:07:08 UTC 2018 - toddrme2178@gmail.com + +- Use %license tag + +------------------------------------------------------------------- +Wed Oct 18 16:42:55 UTC 2017 - toddrme2178@gmail.com + +- Implement single-spec version +- Update to 0.2.7.1 + * No changelog + +------------------------------------------------------------------- +Tue Sep 30 10:44:58 UTC 2014 - toddrme2178@gmail.com + +- Initial version + diff --git a/python-dill.spec b/python-dill.spec new file mode 100644 index 0000000..834d147 --- /dev/null +++ b/python-dill.spec @@ -0,0 +1,104 @@ +# +# spec file for package python-dill +# +# Copyright (c) 2026 SUSE LLC and contributors +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif +%{?sle15_python_module_pythons} +Name: python-dill +Version: 0.4.1 +Release: 0 +Summary: Module to serialize all of Python +License: BSD-3-Clause +URL: https://github.com/uqfoundation/dill +Source: https://github.com/uqfoundation/dill/archive/refs/tags/%{version}.tar.gz#/dill-%{version}.tar.gz +BuildRequires: %{python_module dbm} +BuildRequires: %{python_module devel >= 3.9} +BuildRequires: %{python_module objgraph >= 1.7.2} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildRequires: unzip +Recommends: python-objgraph >= 1.7.2 +%if %{with libalternatives} +BuildRequires: alts +Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif +BuildArch: noarch +%python_subpackages + +%description +Dill extends python's `pickle` module for serializing and de-serializing +python objects to the majority of the built-in python types. Serialization +is the process of converting an object to a byte stream, and the inverse +of which is converting a byte stream back to on python object hierarchy. + +Dill provides the user the same interface as the `pickle` module, and +also includes some additional features. In addition to pickling python +objects, `dill` provides the ability to save the state of an interpreter +session in a single command. + +%prep +%autosetup -p1 -n dill-%{version} +find dill -name '*.py' -exec sed -i '1{\@^#!%{_bindir}/env python@d}' {} \; + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand rm -r %{buildroot}%{$python_sitelib}/dill/tests +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%python_clone -a %{buildroot}%{_bindir}/undill +%python_clone -a %{buildroot}%{_bindir}/get_gprof +%python_clone -a %{buildroot}%{_bindir}/get_objgraph +%python_group_libalternatives undill get_gprof get_objgraph + +%check +export PYTHONDONTWRITEBYTECODE=1 +export PYTHONPATH=%{_builddir}/dill-%{version} +# Creative; copied from tox.ini +%python_exec dill/tests/__main__.py + +%post +%python_install_alternative undill get_gprof get_objgraph + +%postun +%python_uninstall_alternative undill + +%pre +%python_libalternatives_reset_alternative undill + +%files %{python_files} +%doc README.md +%license LICENSE +%python_alternative %{_bindir}/undill +%python_alternative %{_bindir}/get_gprof +%python_alternative %{_bindir}/get_objgraph +%{python_sitelib}/dill +%{python_sitelib}/dill-%{version}.dist-info + +%changelog