git: 74265132881f - main - devel/py-joblib: Update to 1.3.2_1
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 05 Jan 2024 16:51:46 UTC
The branch main has been updated by jwb:
URL: https://cgit.FreeBSD.org/ports/commit/?id=74265132881f61bd8686ceb3c65f3e9fdec88974
commit 74265132881f61bd8686ceb3c65f3e9fdec88974
Author: Jason W. Bacon <jwb@FreeBSD.org>
AuthorDate: 2024-01-05 16:50:06 +0000
Commit: Jason W. Bacon <jwb@FreeBSD.org>
CommitDate: 2024-01-05 16:51:44 +0000
devel/py-joblib: Update to 1.3.2_1
Patch to allow autodeection of hardware cores on FreeBSD
Pull request submitted to upstream
PR: 275997
Approved by: skreuzer
---
devel/py-joblib/Makefile | 1 +
.../patch-joblib_externals_loky_backend_context.py | 39 ++++++++++++++++++++++
2 files changed, 40 insertions(+)
diff --git a/devel/py-joblib/Makefile b/devel/py-joblib/Makefile
index 834e4c30b4c4..ccdeac14f7b0 100644
--- a/devel/py-joblib/Makefile
+++ b/devel/py-joblib/Makefile
@@ -1,5 +1,6 @@
PORTNAME= joblib
PORTVERSION= 1.3.2
+PORTREVISION= 1
CATEGORIES= devel python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
diff --git a/devel/py-joblib/files/patch-joblib_externals_loky_backend_context.py b/devel/py-joblib/files/patch-joblib_externals_loky_backend_context.py
new file mode 100644
index 000000000000..217577a36292
--- /dev/null
+++ b/devel/py-joblib/files/patch-joblib_externals_loky_backend_context.py
@@ -0,0 +1,39 @@
+--- joblib/externals/loky/backend/context.py.orig 2023-06-29 15:14:21 UTC
++++ joblib/externals/loky/backend/context.py
+@@ -245,6 +245,9 @@ def _count_physical_cores():
+ return physical_cores_cache, exception
+
+ # Not cached yet, find it
++ # Using subprocesses is inefficient, but python has no portable
++ # sysctl interface at this time
++ # FIXME: Add OpenBSD, Dragonfly
+ try:
+ if sys.platform == "linux":
+ cpu_info = subprocess.run(
+@@ -269,6 +272,26 @@ def _count_physical_cores():
+ elif sys.platform == "darwin":
+ cpu_info = subprocess.run(
+ "sysctl -n hw.physicalcpu".split(),
++ capture_output=True,
++ text=True,
++ )
++ cpu_info = cpu_info.stdout
++ cpu_count_physical = int(cpu_info)
++ elif sys.platform.startswith('freebsd'):
++ cpu_info = subprocess.run(
++ "sysctl -n kern.smp.cores".split(),
++ capture_output=True,
++ text=True,
++ )
++ cpu_info = cpu_info.stdout
++ cpu_count_physical = int(cpu_info)
++ elif sys.platform.startswith('netbsd'):
++ # FIXME: hw.ncpu reports the number of hyperthreads.
++ # We prefer independent cores to prevent oversubscription.
++ # NetBSD does not currently expose physical core counts,
++ # but this is under discussion in PR kern/57816.
++ cpu_info = subprocess.run(
++ "sysctl -n hw.ncpu".split(),
+ capture_output=True,
+ text=True,
+ )