git: 2852bacb2eb0 - main - devel/py-optree: Add py-optree 0.10.0
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 25 Dec 2023 09:08:13 UTC
The branch main has been updated by sunpoet:
URL: https://cgit.FreeBSD.org/ports/commit/?id=2852bacb2eb02d3c3fd2ca75258cce968634f814
commit 2852bacb2eb02d3c3fd2ca75258cce968634f814
Author: Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2023-12-25 08:56:51 +0000
Commit: Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2023-12-25 08:56:51 +0000
devel/py-optree: Add py-optree 0.10.0
OpTree provides optimized PyTree utilities.
A PyTree is a recursive structure that can be an arbitrarily nested Python
container (e.g., tuple, list, dict, OrderedDict, NamedTuple, etc.) or an opaque
Python object. The key concepts of tree operations are tree flattening and its
inverse (tree unflattening). Additional tree operations can be performed based
on these two basic functions.
---
devel/Makefile | 1 +
devel/py-optree/Makefile | 27 +++++++++++++++++++++++++++
devel/py-optree/distinfo | 3 +++
devel/py-optree/files/patch-setup.py | 18 ++++++++++++++++++
devel/py-optree/pkg-descr | 7 +++++++
5 files changed, 56 insertions(+)
diff --git a/devel/Makefile b/devel/Makefile
index 4f8f0c5af730..0733a154ac60 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -5093,6 +5093,7 @@
SUBDIR += py-opentracing
SUBDIR += py-opster
SUBDIR += py-optik
+ SUBDIR += py-optree
SUBDIR += py-orange-canvas-core
SUBDIR += py-orange-widget-base
SUBDIR += py-orca
diff --git a/devel/py-optree/Makefile b/devel/py-optree/Makefile
new file mode 100644
index 000000000000..37396cfe06af
--- /dev/null
+++ b/devel/py-optree/Makefile
@@ -0,0 +1,27 @@
+PORTNAME= optree
+PORTVERSION= 0.10.0
+CATEGORIES= devel python
+MASTER_SITES= PYPI
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= sunpoet@FreeBSD.org
+COMMENT= Optimized PyTree utilities
+WWW= https://optree.readthedocs.io/en/latest/ \
+ https://github.com/metaopt/optree
+
+LICENSE= APACHE20
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+BUILD_DEPENDS= cmake:devel/cmake-core \
+ ${PYTHON_PKGNAMEPREFIX}pybind11>=0: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}typing-extensions>=4.0.0:devel/py-typing-extensions@${PY_FLAVOR}
+
+USES= compiler:c++20-lang python
+USE_PYTHON= autoplist concurrent pep517
+
+post-install:
+ ${FIND} ${STAGEDIR}${PYTHON_SITELIBDIR} -name '*.so' -exec ${STRIP_CMD} {} +
+
+.include <bsd.port.mk>
diff --git a/devel/py-optree/distinfo b/devel/py-optree/distinfo
new file mode 100644
index 000000000000..6d2af0d2fc75
--- /dev/null
+++ b/devel/py-optree/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1703227790
+SHA256 (optree-0.10.0.tar.gz) = dc7e8880f997365083191784d141c790833877af71aec8825c7f2b7f7f43c98e
+SIZE (optree-0.10.0.tar.gz) = 112851
diff --git a/devel/py-optree/files/patch-setup.py b/devel/py-optree/files/patch-setup.py
new file mode 100644
index 000000000000..e1c613574573
--- /dev/null
+++ b/devel/py-optree/files/patch-setup.py
@@ -0,0 +1,18 @@
+--- setup.py.orig 2023-11-07 06:45:50 UTC
++++ setup.py
+@@ -67,15 +67,6 @@ class cmake_build_ext(build_ext): # noqa: N801
+ pass
+
+ build_args = ['--config', config]
+- if (
+- 'CMAKE_BUILD_PARALLEL_LEVEL' not in os.environ
+- and hasattr(self, 'parallel')
+- and self.parallel
+- ):
+- build_args.extend(['--parallel', str(self.parallel)])
+- else:
+- build_args.append('--parallel')
+-
+ build_args.extend(['--target', ext.target, '--'])
+
+ try:
diff --git a/devel/py-optree/pkg-descr b/devel/py-optree/pkg-descr
new file mode 100644
index 000000000000..a9b8ed2dbf3d
--- /dev/null
+++ b/devel/py-optree/pkg-descr
@@ -0,0 +1,7 @@
+OpTree provides optimized PyTree utilities.
+
+A PyTree is a recursive structure that can be an arbitrarily nested Python
+container (e.g., tuple, list, dict, OrderedDict, NamedTuple, etc.) or an opaque
+Python object. The key concepts of tree operations are tree flattening and its
+inverse (tree unflattening). Additional tree operations can be performed based
+on these two basic functions.