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,26 +1,27 @@ PORTNAME= joblib PORTVERSION= 1.3.2 +PORTREVISION= 1 CATEGORIES= devel python MASTER_SITES= PYPI PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= skreuzer@FreeBSD.org COMMENT= Lightweight pipelining using Python functions as jobs WWW= https://joblib.readthedocs.io/ LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE.txt TEST_DEPENDS= ${PYNUMPY} #TEST_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}threadpoolctl>0:devel/py-threadpoolctl@${PY_FLAVOR} USES= pytest python USE_PYTHON= distutils autoplist NO_ARCH= yes PYTEST_IGNORED_TESTS= test_disk_used \ test_parallel_call_cached_function_defined_in_jupyter PYTEST_BROKEN_TESTS= test_memmapping_on_large_enough_dev_shm .include 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, + )