forked from pool/python-joblib
Accepting request 1129277 from devel:languages:python
- 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/request/show/1129277 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-joblib?expand=0&rev=24
This commit is contained in:
16
also-filter-new-fork-warning.patch
Normal file
16
also-filter-new-fork-warning.patch
Normal file
@@ -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.
|
24
avoid-deprecated-ast.patch
Normal file
24
avoid-deprecated-ast.patch
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
From 05caf0772d605799e5d2337018fd32ac829b37aa Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Lo=C3=AFc=20Est=C3=A8ve?= <loic.esteve@ymail.com>
|
||||||
|
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): # <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
|
@@ -1,3 +1,12 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Nov 28 03:55:52 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
- 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 <dmueller@suse.com>
|
Sat Nov 25 20:14:35 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
@@ -24,13 +24,20 @@ Summary: Module for using Python functions as pipeline jobs
|
|||||||
License: BSD-3-Clause
|
License: BSD-3-Clause
|
||||||
URL: https://github.com/joblib/joblib
|
URL: https://github.com/joblib/joblib
|
||||||
Source: https://files.pythonhosted.org/packages/source/j/joblib/joblib-%{version}.tar.gz
|
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 base >= 3.7}
|
||||||
BuildRequires: %{python_module lz4}
|
BuildRequires: %{python_module lz4}
|
||||||
BuildRequires: %{python_module numpy}
|
BuildRequires: %{python_module numpy}
|
||||||
|
BuildRequires: %{python_module pip}
|
||||||
BuildRequires: %{python_module psutil}
|
BuildRequires: %{python_module psutil}
|
||||||
BuildRequires: %{python_module pytest}
|
BuildRequires: %{python_module pytest}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: %{python_module threadpoolctl}
|
BuildRequires: %{python_module threadpoolctl}
|
||||||
|
BuildRequires: %{python_module wheel}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
Recommends: python-lz4
|
Recommends: python-lz4
|
||||||
@@ -57,10 +64,10 @@ Joblib can handle large data and has specific optimizations for `numpy` arrays.
|
|||||||
%autosetup -p1 -n joblib-%{version}
|
%autosetup -p1 -n joblib-%{version}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_build
|
%pyproject_wheel
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%python_install
|
%pyproject_install
|
||||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
|
|
||||||
%check
|
%check
|
||||||
@@ -110,7 +117,7 @@ fi
|
|||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%license LICENSE.txt
|
%license LICENSE.txt
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
%{python_sitelib}/joblib-%{version}*-info
|
%{python_sitelib}/joblib-%{version}.dist-info
|
||||||
%{python_sitelib}/joblib/
|
%{python_sitelib}/joblib/
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Reference in New Issue
Block a user