14
0
forked from pool/python-joblib

Accepting request 1287806 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/1287806
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-joblib?expand=0&rev=29
This commit is contained in:
2025-06-24 18:45:53 +00:00
committed by Git OBS Bridge
7 changed files with 31 additions and 118 deletions

View File

@@ -1,10 +1,10 @@
Index: joblib-1.3.2/joblib/test/test_parallel.py
Index: joblib-1.5.1/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)]
--- joblib-1.5.1.orig/joblib/test/test_parallel.py
+++ joblib-1.5.1/joblib/test/test_parallel.py
@@ -249,6 +249,11 @@ def test_main_thread_renamed_no_warning(
message_part = "multi-threaded, use of fork() may lead to deadlocks"
warninfo = [w for w in warninfo if message_part not in str(w.message)]
+ # There's a new warning in Python 3.12 about multiprocessing and forking
+ # that we filter out

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2382c5816b2636fbd20a09e0f4e9dad4736765fdfb7dca582943b9c1366b3f0e
size 2116621

BIN
joblib-1.5.1.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -1,82 +0,0 @@
From 85c9aa634bbfb08d3ea692ff1cef5f5e25a0d71e Mon Sep 17 00:00:00 2001
From: tommoral <thomas.moreau.2010@gmail.com>
Date: Tue, 15 Apr 2025 02:31:05 +0200
Subject: [PATCH 1/6] FIX remove link to pid in child resource_tracker
---
joblib/externals/loky/backend/popen_loky_posix.py | 2 +-
joblib/externals/loky/backend/spawn.py | 22 ++++++++--------------
2 files changed, 9 insertions(+), 15 deletions(-)
Index: joblib-1.4.2/joblib/externals/loky/backend/popen_loky_posix.py
===================================================================
--- joblib-1.4.2.orig/joblib/externals/loky/backend/popen_loky_posix.py
+++ joblib-1.4.2/joblib/externals/loky/backend/popen_loky_posix.py
@@ -120,7 +120,7 @@ class Popen:
reduction._mk_inheritable(tracker_fd)
self._fds += [child_r, child_w, tracker_fd]
if sys.version_info >= (3, 8) and os.name == "posix":
- mp_tracker_fd = prep_data["mp_tracker_args"]["fd"]
+ mp_tracker_fd = prep_data["mp_tracker_fd"]
self.duplicate_for_child(mp_tracker_fd)
from .fork_exec import fork_exec
Index: joblib-1.4.2/joblib/externals/loky/backend/spawn.py
===================================================================
--- joblib-1.4.2.orig/joblib/externals/loky/backend/spawn.py
+++ joblib-1.4.2/joblib/externals/loky/backend/spawn.py
@@ -82,11 +82,10 @@ def get_preparation_data(name, init_main
from .resource_tracker import _resource_tracker
_resource_tracker.ensure_running()
- d["tracker_args"] = {"pid": _resource_tracker._pid}
if sys.platform == "win32":
- d["tracker_args"]["fh"] = msvcrt.get_osfhandle(_resource_tracker._fd)
+ d["tracker_fd"] = msvcrt.get_osfhandle(_resource_tracker._fd)
else:
- d["tracker_args"]["fd"] = _resource_tracker._fd
+ d["tracker_fd"] = _resource_tracker._fd
if sys.version_info >= (3, 8) and os.name == "posix":
# joblib/loky#242: allow loky processes to retrieve the resource
@@ -105,10 +104,7 @@ def get_preparation_data(name, init_main
# process is created (othewise the child won't be able to use it if it
# is created later on)
mp_resource_tracker.ensure_running()
- d["mp_tracker_args"] = {
- "fd": mp_resource_tracker._fd,
- "pid": mp_resource_tracker._pid,
- }
+ d["mp_tracker_fd"] = mp_resource_tracker._fd
# Figure out whether to initialise main in the subprocess as a module
# or through direct execution (or to leave it alone entirely)
@@ -172,23 +168,21 @@ def prepare(data, parent_sentinel=None):
if "orig_dir" in data:
process.ORIGINAL_DIR = data["orig_dir"]
- if "mp_tracker_args" in data:
+ if "mp_tracker_fd" in data:
from multiprocessing.resource_tracker import (
_resource_tracker as mp_resource_tracker,
)
- mp_resource_tracker._fd = data["mp_tracker_args"]["fd"]
- mp_resource_tracker._pid = data["mp_tracker_args"]["pid"]
- if "tracker_args" in data:
+ mp_resource_tracker._fd = data["mp_tracker_fd"]
+ if "tracker_fd" in data:
from .resource_tracker import _resource_tracker
- _resource_tracker._pid = data["tracker_args"]["pid"]
if sys.platform == "win32":
- handle = data["tracker_args"]["fh"]
+ handle = data["tracker_fd"]
handle = duplicate(handle, source_process=parent_sentinel)
_resource_tracker._fd = msvcrt.open_osfhandle(handle, os.O_RDONLY)
else:
- _resource_tracker._fd = data["tracker_args"]["fd"]
+ _resource_tracker._fd = data["tracker_fd"]
if "init_main_from_name" in data:
_fixup_main_from_name(data["init_main_from_name"])

View File

@@ -1,22 +0,0 @@
From 1d9b65db31bfe79c42801d795ea9ebfec1123c44 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lo=C3=AFc=20Est=C3=A8ve?= <loic.esteve@ymail.com>
Date: Mon, 9 Dec 2024 17:16:23 +0100
Subject: [PATCH] DOC Make doctest compatible with numpy 2.2 (#1632)
---
joblib/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/joblib/__init__.py b/joblib/__init__.py
index 54f6c8fb4..e9d4c6870 100644
--- a/joblib/__init__.py
+++ b/joblib/__init__.py
@@ -63,7 +63,7 @@
>>> square = mem.cache(np.square)
>>> b = square(a) # doctest: +ELLIPSIS
______________________________________________________________________...
- [Memory] Calling square...
+ [Memory] Calling ...square...
square(array([[0., 0., 1.],
[1., 1., 1.],
[4., 2., 1.]]))

View File

@@ -1,3 +1,23 @@
-------------------------------------------------------------------
Fri Jun 20 11:06:38 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Update to 1.5.1
* Vendor loky3.5.5 fixing the resource_tracker clean up with earlier
Python versions
* Enforce age_limit is a positive timedelta for Memory.reduce_size,
to avoid silently ignoring it
* Remove deprecated bytes_limit argument for Memory, which should be
passed directly to Memory.reduce_size
* Drop support for Python 3.8
* Support for Python 3.13 free-threaded has been added
* Fix a regression in 1.3 and 1.4 that caused large big endian arrays
to trigger a serialization error
* Fix support for python 3.14 in hashing, with the addition of an
extra argument in Pickler._batch_setitems
* Use pickle protocol 5 for pickling numpy arrays with object type
- Drop merged numpy22.patch and loky_resource_tracker.patch
- BuildRequire python-pytest-asyncio to fix tests with pytest 8.4
-------------------------------------------------------------------
Thu Apr 17 10:59:17 UTC 2025 - Markéta Machová <mmachova@suse.com>

View File

@@ -18,7 +18,7 @@
%{?sle15_python_module_pythons}
Name: python-joblib
Version: 1.4.2
Version: 1.5.1
Release: 0
Summary: Module for using Python functions as pipeline jobs
License: BSD-3-Clause
@@ -27,15 +27,12 @@ Source: https://files.pythonhosted.org/packages/source/j/joblib/joblib-%
# PATCH-FIX-OPENSUSE Also avoid a DeprecationWarning when using fork() under
# multiprocessing
Patch1: also-filter-new-fork-warning.patch
# PATCH-FIX-UPSTREAM https://github.com/joblib/joblib/pull/1632 DOC Make doctest compatible with numpy 2.2
Patch2: numpy22.patch
# PATCH-FIX-UPSTREAM https://github.com/joblib/loky/pull/450 FIX remove link to resource_tracker._pid in child processes
Patch3: loky_resource_tracker.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-asyncio}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module threadpoolctl}