Skip to content

Commit

Permalink
devel/py-pyTooling: New port: Collection of arbitrary classes, decora…
Browse files Browse the repository at this point in the history
…tors, meta-classes, exceptions
  • Loading branch information
yurivict committed Feb 23, 2023
1 parent 58adde9 commit f39416d
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 0 deletions.
1 change: 1 addition & 0 deletions devel/Makefile
Expand Up @@ -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
Expand Down
35 changes: 35 additions & 0 deletions 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>
3 changes: 3 additions & 0 deletions 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
40 changes: 40 additions & 0 deletions 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
6 changes: 6 additions & 0 deletions 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.

0 comments on commit f39416d

Please sign in to comment.