From af5d476398b231487e708bd1e58b7134c36896812a92fc582f41e0937f31e9e3 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 28 Nov 2023 04:00:59 +0000 Subject: [PATCH] - Add patch avoid-deprecated-ast.patch: * Avoid deprecated ast classes. - Add patch also-filter-new-fork-warning.patch: * Filter DeprecationWarning due to calling fork() with multiprocessing. - Switch to pyproject macros. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-joblib?expand=0&rev=60 --- also-filter-new-fork-warning.patch | 16 ++++++++++++++++ avoid-deprecated-ast.patch | 24 ++++++++++++++++++++++++ python-joblib.changes | 9 +++++++++ python-joblib.spec | 13 ++++++++++--- 4 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 also-filter-new-fork-warning.patch create mode 100644 avoid-deprecated-ast.patch diff --git a/also-filter-new-fork-warning.patch b/also-filter-new-fork-warning.patch new file mode 100644 index 0000000..cd725ee --- /dev/null +++ b/also-filter-new-fork-warning.patch @@ -0,0 +1,16 @@ +Index: joblib-1.3.2/joblib/test/test_parallel.py +=================================================================== +--- joblib-1.3.2.orig/joblib/test/test_parallel.py ++++ joblib-1.3.2/joblib/test/test_parallel.py +@@ -193,6 +193,11 @@ def test_main_thread_renamed_no_warning( + # 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)] + ++ # There's a new warning in Python 3.12 about multiprocessing and forking ++ # that we filter out ++ warninfo = [w for w in warninfo ++ if "is multi-threaded, use of fork" not in str(w.message)] ++ + # 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/avoid-deprecated-ast.patch b/avoid-deprecated-ast.patch new file mode 100644 index 0000000..f6c8de8 --- /dev/null +++ b/avoid-deprecated-ast.patch @@ -0,0 +1,24 @@ +From 05caf0772d605799e5d2337018fd32ac829b37aa Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lo=C3=AFc=20Est=C3=A8ve?= +Date: Fri, 20 Oct 2023 19:59:00 +0200 +Subject: [PATCH] MNT fix Python 3.12 deprecation warning (#1518) + +--- + joblib/_utils.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +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): # +- return node.n ++ if isinstance(node, ast.Constant): # ++ return node.value + elif isinstance(node, ast.BinOp): # + return operators[type(node.op)](eval_(node.left), eval_(node.right)) + elif isinstance(node, ast.UnaryOp): # e.g., -1 diff --git a/python-joblib.changes b/python-joblib.changes index 7f307fd..464ff31 100644 --- a/python-joblib.changes +++ b/python-joblib.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Tue Nov 28 03:55:52 UTC 2023 - Steve Kowalik + +- Add patch avoid-deprecated-ast.patch: + * Avoid deprecated ast classes. +- Add patch also-filter-new-fork-warning.patch: + * Filter DeprecationWarning due to calling fork() with multiprocessing. +- Switch to pyproject macros. + ------------------------------------------------------------------- Sat Nov 25 20:14:35 UTC 2023 - Dirk Müller diff --git a/python-joblib.spec b/python-joblib.spec index 5c30f9d..5915967 100644 --- a/python-joblib.spec +++ b/python-joblib.spec @@ -24,13 +24,20 @@ Summary: Module for using Python functions as pipeline jobs License: BSD-3-Clause URL: https://github.com/joblib/joblib Source: https://files.pythonhosted.org/packages/source/j/joblib/joblib-%{version}.tar.gz +# PATCH-FIX-UPSTREAM gh#joblib/joblib#05caf0772d605799e5d2337018fd32ac829b37aa +Patch0: avoid-deprecated-ast.patch +# PATCH-FIX-OPENSUSE Also avoid a DeprecationWarning when using fork() under +# multiprocessing +Patch1: also-filter-new-fork-warning.patch BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module lz4} BuildRequires: %{python_module numpy} +BuildRequires: %{python_module pip} BuildRequires: %{python_module psutil} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module threadpoolctl} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Recommends: python-lz4 @@ -57,10 +64,10 @@ Joblib can handle large data and has specific optimizations for `numpy` arrays. %autosetup -p1 -n joblib-%{version} %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check @@ -110,7 +117,7 @@ fi %files %{python_files} %license LICENSE.txt %doc README.rst -%{python_sitelib}/joblib-%{version}*-info +%{python_sitelib}/joblib-%{version}.dist-info %{python_sitelib}/joblib/ %changelog