mirror of
https://git.freebsd.org/ports.git
synced 2025-06-03 20:06:29 -04:00
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
This commit is contained in:
parent
9815657e79
commit
6c7bd70255
5 changed files with 52 additions and 0 deletions
|
@ -5825,6 +5825,7 @@
|
||||||
SUBDIR += py-ubelt
|
SUBDIR += py-ubelt
|
||||||
SUBDIR += py-uhid-freebsd
|
SUBDIR += py-uhid-freebsd
|
||||||
SUBDIR += py-ujson
|
SUBDIR += py-ujson
|
||||||
|
SUBDIR += py-undefined
|
||||||
SUBDIR += py-unearth
|
SUBDIR += py-unearth
|
||||||
SUBDIR += py-unicodecsv
|
SUBDIR += py-unicodecsv
|
||||||
SUBDIR += py-unicodedata2
|
SUBDIR += py-unicodedata2
|
||||||
|
|
21
devel/py-undefined/Makefile
Normal file
21
devel/py-undefined/Makefile
Normal file
|
@ -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>
|
3
devel/py-undefined/distinfo
Normal file
3
devel/py-undefined/distinfo
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
TIMESTAMP = 1710609060
|
||||||
|
SHA256 (undefined-0.0.8.tar.gz) = c6f237c0e3d7e7519694b21bd471dc25ee3c3379d9c23b74ebf02aa349c5cff7
|
||||||
|
SIZE (undefined-0.0.8.tar.gz) = 3137
|
11
devel/py-undefined/files/patch-pyproject.toml
Normal file
11
devel/py-undefined/files/patch-pyproject.toml
Normal file
|
@ -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"
|
16
devel/py-undefined/pkg-descr
Normal file
16
devel/py-undefined/pkg-descr
Normal file
|
@ -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
|
Loading…
Add table
Reference in a new issue