summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Ammerlaan <andrewammerlaan@gentoo.org>2023-11-06 11:18:01 +0100
committerAndrew Ammerlaan <andrewammerlaan@gentoo.org>2023-11-06 11:46:39 +0100
commitcd4c41b233a8cadf852ad8789bb2fdc471c3d455 (patch)
tree91ec927e130af0bdfe3a5259396c62c0ceb79f72 /dev-python/joblib
parentdev-python/loky: enable py3.12 (diff)
downloadgentoo-cd4c41b233a8cadf852ad8789bb2fdc471c3d455.tar.gz
gentoo-cd4c41b233a8cadf852ad8789bb2fdc471c3d455.tar.bz2
gentoo-cd4c41b233a8cadf852ad8789bb2fdc471c3d455.zip
dev-python/joblib: enable py3.12
Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
Diffstat (limited to 'dev-python/joblib')
-rw-r--r--dev-python/joblib/files/joblib-1.3.2-py3.12-avoid-ast.num-and-node.n.patch15
-rw-r--r--dev-python/joblib/files/joblib-1.3.2-py3.12-no-depr-warn.patch15
-rw-r--r--dev-python/joblib/joblib-1.3.2.ebuild9
3 files changed, 38 insertions, 1 deletions
diff --git a/dev-python/joblib/files/joblib-1.3.2-py3.12-avoid-ast.num-and-node.n.patch b/dev-python/joblib/files/joblib-1.3.2-py3.12-avoid-ast.num-and-node.n.patch
new file mode 100644
index 000000000000..a9865e00380e
--- /dev/null
+++ b/dev-python/joblib/files/joblib-1.3.2-py3.12-avoid-ast.num-and-node.n.patch
@@ -0,0 +1,15 @@
+diff --git a/joblib/_utils.py b/joblib/_utils.py
+index 7693310e0..6cd99ad31 100644
+--- a/joblib/_utils.py
++++ b/joblib/_utils.py
+@@ -35,8 +35,8 @@ def eval_expr(expr):
+
+
+ def eval_(node):
+- if isinstance(node, ast.Num): # <number>
+- return node.n
++ if isinstance(node, ast.Constant): # <constant>
++ return node.value
+ elif isinstance(node, ast.BinOp): # <left> <operator> <right>
+ return operators[type(node.op)](eval_(node.left), eval_(node.right))
+ elif isinstance(node, ast.UnaryOp): # <operator> <operand> e.g., -1
diff --git a/dev-python/joblib/files/joblib-1.3.2-py3.12-no-depr-warn.patch b/dev-python/joblib/files/joblib-1.3.2-py3.12-no-depr-warn.patch
new file mode 100644
index 000000000000..4d5a28815e4a
--- /dev/null
+++ b/dev-python/joblib/files/joblib-1.3.2-py3.12-no-depr-warn.patch
@@ -0,0 +1,15 @@
+diff --git a/joblib/test/test_parallel.py b/joblib/test/test_parallel.py
+index 906d436..c4a727c 100644
+--- a/joblib/test/test_parallel.py
++++ b/joblib/test/test_parallel.py
+@@ -189,6 +189,10 @@ def test_main_thread_renamed_no_warning(backend, monkeypatch):
+ # warninfo catches Warnings from worker timeouts. We remove it if it exists
+ warninfo = [w for w in warninfo if "worker timeout" not in str(w.message)]
+
++ # We don't want to count DeprecationWarnings
++ warninfo = [w for w in warninfo
++ if not isinstance(w.message, DeprecationWarning)]
++
+ # The multiprocessing backend will raise a warning when detecting that is
+ # started from the non-main thread. Let's check that there is no false
+ # positive because of the name change.
diff --git a/dev-python/joblib/joblib-1.3.2.ebuild b/dev-python/joblib/joblib-1.3.2.ebuild
index 672bc72702d8..d44046dcaed6 100644
--- a/dev-python/joblib/joblib-1.3.2.ebuild
+++ b/dev-python/joblib/joblib-1.3.2.ebuild
@@ -3,7 +3,7 @@
EAPI=8
-PYTHON_COMPAT=( python3_{10..11} )
+PYTHON_COMPAT=( python3_{10..12} )
DISTUTILS_USE_PEP517=setuptools
inherit distutils-r1 pypi
@@ -31,6 +31,13 @@ BDEPEND="
)
"
+PATCHES=(
+ # Borrowed from Fedora: https://github.com/joblib/joblib/issues/1478
+ "${FILESDIR}/${P}-py3.12-no-depr-warn.patch"
+ # https://github.com/joblib/joblib/pull/1518
+ "${FILESDIR}/${P}-py3.12-avoid-ast.num-and-node.n.patch"
+)
+
distutils_enable_tests pytest
EPYTEST_DESELECT=(