diff options
author | Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2024-03-31 03:05:07 +0000 |
---|---|---|
committer | Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2024-03-31 03:05:07 +0000 |
commit | 6c7bd7025568cd8d16db6dab06e16c143e09d2f1 (patch) | |
tree | 5384bb76ecf967a745a813209175b5e6eddb6b90 | |
parent | 9815657e797620996d1276790e3762e4833e9851 (diff) | |
download | ports-6c7bd7025568cd8d16db6dab06e16c143e09d2f1.tar.gz ports-6c7bd7025568cd8d16db6dab06e16c143e09d2f1.zip |
devel/py-undefined: Add py-undefined 0.0.8
Ever needed a global object that act as None but not quite? Like for example
keyword argument for function, where None make sense, so you need a default
value.
One solution is to create as singleton object:
mysingleton = object()
Though it becomes difficult to track the singleton across libraries, and teach
users where to import this from. It's also relatively annoying use this
singleton across library.
Introducing undefined:
>>> import undefined
>>> from undefined import Undefined
>>> undefined is Undefined
True
-rw-r--r-- | devel/Makefile | 1 | ||||
-rw-r--r-- | devel/py-undefined/Makefile | 21 | ||||
-rw-r--r-- | devel/py-undefined/distinfo | 3 | ||||
-rw-r--r-- | devel/py-undefined/files/patch-pyproject.toml | 11 | ||||
-rw-r--r-- | devel/py-undefined/pkg-descr | 16 |
5 files changed, 52 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile index e67c8ff1f605..2ab0c2ae621e 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -5825,6 +5825,7 @@ SUBDIR += py-ubelt SUBDIR += py-uhid-freebsd SUBDIR += py-ujson + SUBDIR += py-undefined SUBDIR += py-unearth SUBDIR += py-unicodecsv SUBDIR += py-unicodedata2 diff --git a/devel/py-undefined/Makefile b/devel/py-undefined/Makefile new file mode 100644 index 000000000000..202ec974eeef --- /dev/null +++ b/devel/py-undefined/Makefile @@ -0,0 +1,21 @@ +PORTNAME= undefined +PORTVERSION= 0.0.8 +CATEGORIES= devel python +MASTER_SITES= PYPI +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= sunpoet@FreeBSD.org +COMMENT= Simple package +WWW= https://github.com/Carreau/undefined + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}flit-core>=0:devel/py-flit-core@${PY_FLAVOR} + +USES= python +USE_PYTHON= autoplist concurrent pep517 + +NO_ARCH= yes + +.include <bsd.port.mk> diff --git a/devel/py-undefined/distinfo b/devel/py-undefined/distinfo new file mode 100644 index 000000000000..22204655750a --- /dev/null +++ b/devel/py-undefined/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1710609060 +SHA256 (undefined-0.0.8.tar.gz) = c6f237c0e3d7e7519694b21bd471dc25ee3c3379d9c23b74ebf02aa349c5cff7 +SIZE (undefined-0.0.8.tar.gz) = 3137 diff --git a/devel/py-undefined/files/patch-pyproject.toml b/devel/py-undefined/files/patch-pyproject.toml new file mode 100644 index 000000000000..b61ee7368316 --- /dev/null +++ b/devel/py-undefined/files/patch-pyproject.toml @@ -0,0 +1,11 @@ +--- pyproject.toml.orig 2019-07-26 01:33:34 UTC ++++ pyproject.toml +@@ -1,6 +1,6 @@ + [build-system] +-requires = ["flit"] +-build-backend = "flit.buildapi" ++requires = ["flit_core"] ++build-backend = "flit_core.buildapi" + + [tool.flit.metadata] + module = "undefined" diff --git a/devel/py-undefined/pkg-descr b/devel/py-undefined/pkg-descr new file mode 100644 index 000000000000..f5949af84444 --- /dev/null +++ b/devel/py-undefined/pkg-descr @@ -0,0 +1,16 @@ +Ever needed a global object that act as None but not quite? Like for example +keyword argument for function, where None make sense, so you need a default +value. + +One solution is to create as singleton object: +mysingleton = object() + +Though it becomes difficult to track the singleton across libraries, and teach +users where to import this from. It's also relatively annoying use this +singleton across library. + +Introducing undefined: +>>> import undefined +>>> from undefined import Undefined +>>> undefined is Undefined +True |