git: f39416df08c8 - main - devel/py-pyTooling: New port: Collection of arbitrary classes, decorators, meta-classes, exceptions

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Thu, 23 Feb 2023 20:45:56 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f39416df08c8c400f8f92a5d7f2f753662cdab20

commit f39416df08c8c400f8f92a5d7f2f753662cdab20
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2023-02-23 16:23:12 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2023-02-23 20:45:50 +0000

    devel/py-pyTooling: New port: Collection of arbitrary classes, decorators, meta-classes, exceptions
---
 devel/Makefile                                     |  1 +
 devel/py-pyTooling/Makefile                        | 35 +++++++++++++++++++
 devel/py-pyTooling/distinfo                        |  3 ++
 .../files/patch-pyTooling_Common_Platform.py       | 40 ++++++++++++++++++++++
 devel/py-pyTooling/pkg-descr                       |  6 ++++
 5 files changed, 85 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index 35cb112d5125..b918365c5e78 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -5109,6 +5109,7 @@
     SUBDIR += py-purl
     SUBDIR += py-py
     SUBDIR += py-py-ubjson
+    SUBDIR += py-pyTooling
     SUBDIR += py-py_interface
     SUBDIR += py-pyasn1
     SUBDIR += py-pyasn1-modules
diff --git a/devel/py-pyTooling/Makefile b/devel/py-pyTooling/Makefile
new file mode 100644
index 000000000000..b8b0c990e04a
--- /dev/null
+++ b/devel/py-pyTooling/Makefile
@@ -0,0 +1,35 @@
+PORTNAME=	pyTooling
+DISTVERSIONPREFIX=	v
+DISTVERSION=	2.12.3
+CATEGORIES=	devel
+#MASTER_SITES=	PYPI # requirements.txt is missing
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	Collection of arbitrary classes, decorators, meta-classes, exceptions
+WWW=		https://pytooling.github.io/pyTooling/
+
+LICENSE=	APACHE20
+LICENSE_FILE=	${WRKSRC}/LICENSE.md
+
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}wheel>=0.38.1:devel/py-wheel@${PY_FLAVOR}
+TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}anytree>=2.8.0:devel/py-anytree@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}coverage>0:devel/py-coverage@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}itertree>0:devel/py-itertree@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}lxml>=4.9:devel/py-lxml@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}mypy>=0.990:devel/py-mypy@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}networkx>=2.6:math/py-networkx@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pytest-benchmark>0:devel/py-pytest-benchmark@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}python-igraph>0:math/py-python-igraph@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pytest-cov>0:devel/py-pytest-cov@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}ruamel.yaml>=0.17:devel/py-ruamel.yaml@${PY_FLAVOR}
+
+USES=		python
+USE_PYTHON=	pep517 autoplist pytest
+USE_GITHUB=	yes
+
+NO_ARCH=	yes
+
+TEST_WRKSRC=	${WRKSRC}/tests
+
+.include <bsd.port.mk>
diff --git a/devel/py-pyTooling/distinfo b/devel/py-pyTooling/distinfo
new file mode 100644
index 000000000000..a954baae184f
--- /dev/null
+++ b/devel/py-pyTooling/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1677176526
+SHA256 (pyTooling-pyTooling-v2.12.3_GH0.tar.gz) = 03c7d042500490f21ddebcc65a158e749208e9af2f9a551274d39e04957c8bbc
+SIZE (pyTooling-pyTooling-v2.12.3_GH0.tar.gz) = 580323
diff --git a/devel/py-pyTooling/files/patch-pyTooling_Common_Platform.py b/devel/py-pyTooling/files/patch-pyTooling_Common_Platform.py
new file mode 100644
index 000000000000..a857192e86b6
--- /dev/null
+++ b/devel/py-pyTooling/files/patch-pyTooling_Common_Platform.py
@@ -0,0 +1,40 @@
+--- pyTooling/Common/Platform.py.orig	2023-02-23 18:45:13 UTC
++++ pyTooling/Common/Platform.py
+@@ -52,10 +52,11 @@ class Platform(metaclass=ExtendedType, singleton=True)
+ 		Unknown = 0
+ 
+ 		OS_Linux =   auto()        #: Operating System: Linux.
++		OS_FreeBSD = auto()        #: Operating System: FreeBSD.
+ 		OS_MacOS =   auto()        #: Operating System: macOS.
+ 		OS_Windows = auto()        #: Operating System: Windows.
+ 
+-		OperatingSystem = OS_Linux | OS_MacOS | OS_Windows  #: Mask: Any operating system.
++		OperatingSystem = OS_Linux | OS_FreeBSD | OS_MacOS | OS_Windows  #: Mask: Any operating system.
+ 
+ 		SEP_WindowsPath =  auto()  #: Seperator: Path element seperator (e.g. for directories).
+ 		SEP_WindowsValue = auto()  #: Seperator: Value seperator in variables (e.g. for paths in PATH).
+@@ -76,6 +77,7 @@ class Platform(metaclass=ExtendedType, singleton=True)
+ 		Architecture = Arch_x86 | Arch_Arm        #: Mask: Any architecture.
+ 
+ 		Linux =   OS_Linux   | ENV_Native | ARCH_x86_64                                       #: Group: native Linux on x86-64.
++		FreeBSD = OS_FreeBSD | ENV_Native | ARCH_x86_64                                       #: Group: native FreeBSD on x86-64.
+ 		MacOS =   OS_MacOS   | ENV_Native | ARCH_x86_64                                       #: Group: native macOS on x86-64.
+ 		Windows = OS_Windows | ENV_Native | ARCH_x86_64 | SEP_WindowsPath | SEP_WindowsValue  #: Group: native Windows on x86-64.
+ 
+@@ -155,6 +157,16 @@ class Platform(metaclass=ExtendedType, singleton=True)
+ 					self._platform |= self.Platforms.ARCH_x86_32
+ 				else:
+ 					raise Exception(f"Unknown architecture '{sysconfig_platform}' for a native Linux.")
++
++			elif sys_platform.startswith("freebsd"):
++				self._platform |= self.Platforms.OS_FreeBSD | self.Platforms.ENV_Native
++
++				if sysconfig_platform.endswith("-amd64"):            # native FreeBSD amd64; Windows 64 + WSL
++					self._platform |= self.Platforms.ARCH_x86_64
++				elif sysconfig_platform.endswith("-aarch64"):        # native FreeBSD Aarch64
++					self._platform |= self.Platforms.ARCH_x86_32
++				else:
++					raise Exception(f"Unknown architecture '{sysconfig_platform}' for a native FreeBSD.")
+ 
+ 			elif sys_platform == "darwin":
+ 				self._platform |= self.Platforms.OS_MacOS | self.Platforms.ENV_Native | self.Platforms.ARCH_x86_64
diff --git a/devel/py-pyTooling/pkg-descr b/devel/py-pyTooling/pkg-descr
new file mode 100644
index 000000000000..6848b67eacf0
--- /dev/null
+++ b/devel/py-pyTooling/pkg-descr
@@ -0,0 +1,6 @@
+pyTooling is a powerful collection of arbitrary useful abstract data models,
+classes, decorators, meta-classes and exceptions. It also provides lots of
+helper functions e.g. to ease the handling of package descriptions.
+
+It's useful for any Python-base project independent if it's a library,
+framework or CLI tool.