diff options
Diffstat (limited to 'dev-python/dill')
-rw-r--r-- | dev-python/dill/Manifest | 3 | ||||
-rw-r--r-- | dev-python/dill/dill-0.3.9.ebuild | 10 | ||||
-rw-r--r-- | dev-python/dill/files/dill-0.3.9-pypy311.patch | 123 |
3 files changed, 133 insertions, 3 deletions
diff --git a/dev-python/dill/Manifest b/dev-python/dill/Manifest index 9ddb2d28bf80..a8e67c673b55 100644 --- a/dev-python/dill/Manifest +++ b/dev-python/dill/Manifest @@ -1,3 +1,4 @@ +AUX dill-0.3.9-pypy311.patch 6365 BLAKE2B 87bc78550c9593b05bad4d7292a3cdd1352455d689acfdda5836fa6be00765f2062c1271e80f94c78614689770cb81073ca754c1601c13c73e3779729e79ef3a SHA512 b3e3e50207588ad43af50b4550a9898efd84f6e6da7a0dcda517a133c0e3abd7b49f47f907c71aab4d2d5e97c53666aba0f60e323200b5095f5807a048977ce6 DIST dill-0.3.9.tar.gz 187000 BLAKE2B 56196bd04d0a050619feee6b719e9232376853a03fae3a7486fa48f90fea1e27b4f4eaa31b0df54e70cf1aa4333268213dd6350408db0b78778d92f04ae65bd0 SHA512 461943ff8a0b7212b30e7c8b9e35348d0215c1c6dca356ad813e15c8721f39692fb61809349e5ee63a00d19a39aeae34c3b4def17257f8f7820e4318b81b273f -EBUILD dill-0.3.9.ebuild 538 BLAKE2B eba7810a1a0e65b6d2e83b9639fc173021054fea59563b6ccdae10b6f0a58318cfe3511fee08caa1ea6095606189e052cd6707cd0a00f734a9815c0244f3b5ca SHA512 37adffb6bf5f73818515248c16009ce77513004659a12cefef5edb6c8902d8584cdbc0a8f78a294021b9e635453ac2d871dd99834d3f5bb50978e3e56d8f468f +EBUILD dill-0.3.9.ebuild 692 BLAKE2B 5ef475a9ae497bd64b6427ae4eb75bea024c9571c1b712a36c665c33ea9c65c35e8ed19d0733c850126f606e3c45de5fe0e21df87c88f4ea016b7bd25de81f18 SHA512 d1f36d79901a44d4f780af37eb457864b0e919ebaba4a6c05495f13c257da1d62a074d43297552a1945bfef1c7851a1ea7e7004cee8cbb8f39303320ef64f8f7 MISC metadata.xml 997 BLAKE2B ae32cd96d7a4967a9886d4903e21720459c0a963a675d301c2bb651fdb15877d845100822c1e7a7b6184ccaa666cbb6dc58f939616de9c1c22554670d841bd19 SHA512 e3dc363382bea8ed76343b62377c139ad84011a6b804f64b65d93941a7c192c268c0da273c73d5ec1cece7320b15fa88bf5a2f20a628d8845efddab24f3acc5b diff --git a/dev-python/dill/dill-0.3.9.ebuild b/dev-python/dill/dill-0.3.9.ebuild index e4e94f87b367..212a4de289db 100644 --- a/dev-python/dill/dill-0.3.9.ebuild +++ b/dev-python/dill/dill-0.3.9.ebuild @@ -1,10 +1,10 @@ -# Copyright 1999-2024 Gentoo Authors +# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..13} pypy3 ) +PYTHON_COMPAT=( python3_{10..13} pypy3 pypy3_11 ) inherit distutils-r1 pypi @@ -18,6 +18,12 @@ LICENSE="BSD" SLOT="0" KEYWORDS="~alpha amd64 arm arm64 hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux" +PATCHES=( + # https://github.com/uqfoundation/dill/pull/707 + # https://github.com/uqfoundation/dill/pull/701 + "${FILESDIR}/${P}-pypy311.patch" +) + python_test() { "${EPYTHON}" -m dill.tests || die } diff --git a/dev-python/dill/files/dill-0.3.9-pypy311.patch b/dev-python/dill/files/dill-0.3.9-pypy311.patch new file mode 100644 index 000000000000..8f73f1264a25 --- /dev/null +++ b/dev-python/dill/files/dill-0.3.9-pypy311.patch @@ -0,0 +1,123 @@ +From 599265e0a0cec406e245808105b63987077f53f2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Wed, 12 Mar 2025 03:41:39 +0100 +Subject: [PATCH] fix CodeType support for PyPy3.11 7.3.19+ (#707) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Add support for the variation of `types.CodeType` used in PyPy3.11 +7.3.19 and newer. It introduces `co_qualname` in addition +to the previous members — but it does not feature `co_exceptiontable` +like CPython 3.11. I've named the version `(3,11,'p')` for PyPy. + +Fixes #706 +--- + dill/_dill.py | 26 ++++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + +diff --git a/dill/_dill.py b/dill/_dill.py +index 152899f1..aec297c4 100644 +--- a/dill/_dill.py ++++ b/dill/_dill.py +@@ -665,6 +665,7 @@ def __getattr__(self, item): + # Version New attribute CodeType parameters + ((3,11,'a'), 'co_endlinetable', 'argcount posonlyargcount kwonlyargcount nlocals stacksize flags code consts names varnames filename name qualname firstlineno linetable endlinetable columntable exceptiontable freevars cellvars'), + ((3,11), 'co_exceptiontable', 'argcount posonlyargcount kwonlyargcount nlocals stacksize flags code consts names varnames filename name qualname firstlineno linetable exceptiontable freevars cellvars'), ++ ((3,11,'p'), 'co_qualname', 'argcount posonlyargcount kwonlyargcount nlocals stacksize flags code consts names varnames filename name qualname firstlineno linetable freevars cellvars'), + ((3,10), 'co_linetable', 'argcount posonlyargcount kwonlyargcount nlocals stacksize flags code consts names varnames filename name firstlineno linetable freevars cellvars'), + ((3,8), 'co_posonlyargcount', 'argcount posonlyargcount kwonlyargcount nlocals stacksize flags code consts names varnames filename name firstlineno lnotab freevars cellvars'), + ((3,7), 'co_kwonlyargcount', 'argcount kwonlyargcount nlocals stacksize flags code consts names varnames filename name firstlineno lnotab freevars cellvars'), +@@ -701,6 +702,22 @@ def _create_code(*args): + args[17], + ) + fields = m.fields ++ # PyPy 3.11 7.3.19+ (17 members) ++ elif m.case(( ++ 'argcount', 'posonlyargcount', 'kwonlyargcount', 'nlocals', 'stacksize', 'flags', # args[0:6] ++ 'code', 'consts', 'names', 'varnames', 'filename', 'name', 'qualname', # args[6:13] ++ 'firstlineno', 'linetable', 'freevars', 'cellvars' # args[13:] ++ )): ++ if CODE_VERSION == (3,11,'p'): ++ return CodeType( ++ *args[:6], ++ args[6].encode() if hasattr(args[6], 'encode') else args[6], # code ++ *args[7:14], ++ args[14].encode() if hasattr(args[14], 'encode') else args[14], # linetable ++ args[15], ++ args[16], ++ ) ++ fields = m.fields + # Python 3.10 or 3.8/3.9 (16 members) + elif m.case(( + 'argcount', 'posonlyargcount', 'kwonlyargcount', 'nlocals', 'stacksize', 'flags', # args[0:6] +@@ -1175,6 +1192,15 @@ def save_code(pickler, obj): + obj.co_firstlineno, obj.co_linetable, obj.co_exceptiontable, + obj.co_freevars, obj.co_cellvars + ) ++ elif hasattr(obj, "co_qualname"): # pypy 3.11 7.3.19+ (17 args) ++ args = ( ++ obj.co_lnotab, obj.co_argcount, obj.co_posonlyargcount, ++ obj.co_kwonlyargcount, obj.co_nlocals, obj.co_stacksize, ++ obj.co_flags, obj.co_code, obj.co_consts, obj.co_names, ++ obj.co_varnames, obj.co_filename, obj.co_name, obj.co_qualname, ++ obj.co_firstlineno, obj.co_linetable, obj.co_freevars, ++ obj.co_cellvars ++ ) + elif hasattr(obj, "co_linetable"): # python 3.10 (16 args) + args = ( + obj.co_lnotab, # for < python 3.10 [not counted in args] + +From a3d129f9c8aceb856a7e50277af4b7fef6ab9202 Mon Sep 17 00:00:00 2001 +From: Mike McKerns <mmckerns@caltech.edu> +Date: Mon, 17 Feb 2025 00:06:31 -0500 +Subject: [PATCH] support pypy-3.11 (#701) + +--- + dill/_dill.py | 2 +- + dill/_objects.py | 2 +- + dill/detect.py | 5 ++++- + 3 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/dill/_dill.py b/dill/_dill.py +index 987b96b..152899f 100644 +--- a/dill/_dill.py ++++ b/dill/_dill.py +@@ -571,7 +571,7 @@ if sys.hexversion >= 0x30a00a0: + _incedental_reverse_typemap['LineIteratorType'] = type(compile('3', '', 'eval').co_lines()) + ''' + +-if sys.hexversion >= 0x30b00b0: ++if sys.hexversion >= 0x30b00b0 and not IS_PYPY: + from types import GenericAlias + _incedental_reverse_typemap["GenericAliasIteratorType"] = type(iter(GenericAlias(list, (int,)))) + ''' +diff --git a/dill/_objects.py b/dill/_objects.py +index 500322f..a37cd79 100644 +--- a/dill/_objects.py ++++ b/dill/_objects.py +@@ -402,7 +402,7 @@ except ImportError: + if sys.hexversion >= 0x30a00a0 and not IS_PYPY: + x['LineIteratorType'] = compile('3', '', 'eval').co_lines() + +-if sys.hexversion >= 0x30b00b0: ++if sys.hexversion >= 0x30b00b0 and not IS_PYPY: + from types import GenericAlias + d["GenericAliasIteratorType"] = iter(GenericAlias(list, (int,))) + x['PositionsIteratorType'] = compile('3', '', 'eval').co_positions() +diff --git a/dill/detect.py b/dill/detect.py +index 1f8ae3d..2f0bea1 100644 +--- a/dill/detect.py ++++ b/dill/detect.py +@@ -145,7 +145,10 @@ def nestedglobals(func, recurse=True): + CAN_NULL = sys.hexversion >= 0x30b00a7 # NULL may be prepended >= 3.11a7 + names = set() + with capture('stdout') as out: +- dis.dis(func) #XXX: dis.dis(None) disassembles last traceback ++ try: ++ dis.dis(func) #XXX: dis.dis(None) disassembles last traceback ++ except IndexError: ++ pass #FIXME: HACK for IS_PYPY (3.11) + for line in out.getvalue().splitlines(): + if '_GLOBAL' in line: + name = line.split('(')[-1].split(')')[0] |