diff --git a/devel/Makefile b/devel/Makefile --- a/devel/Makefile +++ b/devel/Makefile @@ -5385,6 +5385,7 @@ SUBDIR += py-testscenarios SUBDIR += py-testtools SUBDIR += py-thefuzz + SUBDIR += py-threadpoolctl SUBDIR += py-threema-msgapi SUBDIR += py-thrift SUBDIR += py-thriftpy2 diff --git a/devel/py-threadpoolctl/Makefile b/devel/py-threadpoolctl/Makefile new file mode 100644 --- /dev/null +++ b/devel/py-threadpoolctl/Makefile @@ -0,0 +1,50 @@ +# Created by: thierry@pompo.net + +PORTNAME= threadpoolctl +PORTVERSION= 3.1.0 +CATEGORIES= devel python +MASTER_SITES= CHEESESHOP +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= thierry@FreeBSD.org +COMMENT= Thread-pool Controls for Python + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +#USE_GITHUB= yes +#GH_ACCOUNT= joblib + +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}build>0:devel/py-build@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}flit-core>0:devel/py-flit-core@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}installer>0:devel/py-installer@${PY_FLAVOR} + +OPTIONS_DEFINE= TEST + +USES= python:3.6-3.9 + +TEST_DEPENDS= ${PYNUMPY} \ + blis>0:math/blis \ + ${PYTHON_PKGNAMEPREFIX}scipy>0:science/py-scipy@${PY_FLAVOR} +TEST_USES= blaslapack:openblas pytest +TEST_USE= PYTHON=cython +TEST_VARS= PYTEST_ARGS="-vlrxXs --cov=threadpoolctl" \ + BLIS_ENABLE_THREADING=yes + +NO_ARCH= yes + +do-build: + (cd ${WRKSRC} && ${PYTHON_CMD} -m build --wheel --no-isolation) + +post-build-TEST-on: + (cd ${WRKSRC}/tests/_openmp_test_helper && \ + ${PYTHON_CMD} setup_inner.py build_ext -i && \ + ${PYTHON_CMD} setup_outer.py build_ext -i && \ + ${PYTHON_CMD} setup_nested_prange_blas.py build_ext -i) + +do-install: + ${MKDIR} ${STAGEDIE}${PYTHONPREFIX_SITELIBDIR} + (cd ${WRKSRC} && \ + ${PYTHON_CMD} -m installer --destdir="${STAGEDIR}" dist/*.whl) + +.include diff --git a/devel/py-threadpoolctl/distinfo b/devel/py-threadpoolctl/distinfo new file mode 100644 --- /dev/null +++ b/devel/py-threadpoolctl/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1655408452 +SHA256 (threadpoolctl-3.1.0.tar.gz) = a335baacfaa4400ae1f0d8e3a58d6674d2f8828e3716bb2802c44955ad391380 +SIZE (threadpoolctl-3.1.0.tar.gz) = 33651 diff --git a/devel/py-threadpoolctl/pkg-descr b/devel/py-threadpoolctl/pkg-descr new file mode 100644 --- /dev/null +++ b/devel/py-threadpoolctl/pkg-descr @@ -0,0 +1,8 @@ +Python helpers to limit the number of threads used in the threadpool-backed of +common native libraries used for scientific computing and data science (e.g. +BLAS and OpenMP). + +Fine control of the underlying thread-pool size can be useful in workloads that +involve nested parallelism so as to mitigate oversubscription issues. + +WWW: https://github.com/joblib/threadpoolctl diff --git a/devel/py-threadpoolctl/pkg-plist b/devel/py-threadpoolctl/pkg-plist new file mode 100644 --- /dev/null +++ b/devel/py-threadpoolctl/pkg-plist @@ -0,0 +1,7 @@ +%%PYTHON_SITELIBDIR%%/__pycache__/threadpoolctl%%PYTHON_EXT_SUFFIX%%.opt-1.pyc +%%PYTHON_SITELIBDIR%%/__pycache__/threadpoolctl%%PYTHON_EXT_SUFFIX%%.pyc +%%PYTHON_SITELIBDIR%%/threadpoolctl-3.1.0.dist-info/LICENSE +%%PYTHON_SITELIBDIR%%/threadpoolctl-3.1.0.dist-info/METADATA +%%PYTHON_SITELIBDIR%%/threadpoolctl-3.1.0.dist-info/RECORD +%%PYTHON_SITELIBDIR%%/threadpoolctl-3.1.0.dist-info/WHEEL +%%PYTHON_SITELIBDIR%%/threadpoolctl.py