aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo-Chuan Hsieh <sunpoet@FreeBSD.org>2023-04-09 13:16:56 +0000
committerPo-Chuan Hsieh <sunpoet@FreeBSD.org>2023-04-09 13:36:26 +0000
commit426ce4c9bcfd7f79da48faf3270c21562650ee0a (patch)
tree01ed74a290dcbe5aa9f69e6e4d9af8c01de1a046
parent5f2b4ae4585a19f72b120253d3898013ad252934 (diff)
downloadports-426ce4c9bcfd7f79da48faf3270c21562650ee0a.tar.gz
ports-426ce4c9bcfd7f79da48faf3270c21562650ee0a.zip
math/py-ml-dtypes: Add py-ml-dtypes 0.0.4
ml_dtypes is a stand-alone implementation of several NumPy dtype extensions used in machine learning libraries.
-rw-r--r--math/Makefile1
-rw-r--r--math/py-ml-dtypes/Makefile27
-rw-r--r--math/py-ml-dtypes/distinfo3
-rw-r--r--math/py-ml-dtypes/files/patch-pyproject.toml28
-rw-r--r--math/py-ml-dtypes/pkg-descr2
5 files changed, 61 insertions, 0 deletions
diff --git a/math/Makefile b/math/Makefile
index d588a2ab3500..988e051ba799 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -954,6 +954,7 @@
SUBDIR += py-minorminer
SUBDIR += py-mip
SUBDIR += py-mixsimulator
+ SUBDIR += py-ml-dtypes
SUBDIR += py-moarchiving
SUBDIR += py-mpmath
SUBDIR += py-munkres
diff --git a/math/py-ml-dtypes/Makefile b/math/py-ml-dtypes/Makefile
new file mode 100644
index 000000000000..131df85dc85d
--- /dev/null
+++ b/math/py-ml-dtypes/Makefile
@@ -0,0 +1,27 @@
+PORTNAME= ml-dtypes
+PORTVERSION= 0.0.4
+CATEGORIES= math python
+MASTER_SITES= PYPI
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+DISTNAME= ml_dtypes-${PORTVERSION}
+
+MAINTAINER= sunpoet@FreeBSD.org
+COMMENT= Stand-alone implementation of several NumPy dtype extensions
+WWW= https://github.com/jax-ml/ml_dtypes
+
+LICENSE= APACHE20
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}numpy>=1.23.3:math/py-numpy@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}pybind11>=2.10.0<2.11:devel/py-pybind11@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR}
+RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}numpy>=1.23.3:math/py-numpy@${PY_FLAVOR}
+
+USES= python:3.7+
+USE_PYTHON= autoplist concurrent pep517
+
+post-install:
+ ${FIND} ${STAGEDIR}${PYTHON_SITELIBDIR} -name '*.so' -exec ${STRIP_CMD} {} +
+
+.include <bsd.port.mk>
diff --git a/math/py-ml-dtypes/distinfo b/math/py-ml-dtypes/distinfo
new file mode 100644
index 000000000000..881a0b72d2cd
--- /dev/null
+++ b/math/py-ml-dtypes/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1680726014
+SHA256 (ml_dtypes-0.0.4.tar.gz) = 45623c738d477d7a0f3f8e4c94998dc49025202c520e62e27f0ef688db2f696f
+SIZE (ml_dtypes-0.0.4.tar.gz) = 684934
diff --git a/math/py-ml-dtypes/files/patch-pyproject.toml b/math/py-ml-dtypes/files/patch-pyproject.toml
new file mode 100644
index 000000000000..645226e9988e
--- /dev/null
+++ b/math/py-ml-dtypes/files/patch-pyproject.toml
@@ -0,0 +1,28 @@
+--- pyproject.toml.orig 2023-03-27 19:04:56 UTC
++++ pyproject.toml
+@@ -16,10 +16,7 @@ keywords = []
+
+ # pip dependencies of the project
+ dependencies = [
+- # Ensure numpy release supports Python version.
+- "numpy>1.20",
+- "numpy>=1.21.2; python_version>'3.9'",
+- "numpy>=1.23.3; python_version>'3.10'",
++ "numpy>=1.23.3",
+ ]
+
+ [project.urls]
+@@ -45,11 +42,9 @@ pyink-use-majority-quotes = true
+
+ [build-system]
+ requires = [
+- # Build with oldest supported numpy for each Python version.
+- "numpy~=1.21.2; python_version<'3.11'",
+- "numpy~=1.23.3; python_version>='3.11'",
++ "numpy>=1.23.3",
+ "pybind11~=2.10.0",
+- "setuptools~=67.6.0",
++ "setuptools",
+ ]
+ build-backend = "setuptools.build_meta"
+
diff --git a/math/py-ml-dtypes/pkg-descr b/math/py-ml-dtypes/pkg-descr
new file mode 100644
index 000000000000..7c825172d102
--- /dev/null
+++ b/math/py-ml-dtypes/pkg-descr
@@ -0,0 +1,2 @@
+ml_dtypes is a stand-alone implementation of several NumPy dtype extensions used
+in machine learning libraries.