Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Mar 2024 03:39:00 GMT
From:      Po-Chuan Hsieh <sunpoet@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 6c7bd7025568 - main - devel/py-undefined: Add py-undefined 0.0.8
Message-ID:  <202403310339.42V3d07E075858@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by sunpoet:

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

commit 6c7bd7025568cd8d16db6dab06e16c143e09d2f1
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2024-03-31 03:05:07 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2024-03-31 03:05:07 +0000

    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
---
 devel/Makefile                                |  1 +
 devel/py-undefined/Makefile                   | 21 +++++++++++++++++++++
 devel/py-undefined/distinfo                   |  3 +++
 devel/py-undefined/files/patch-pyproject.toml | 11 +++++++++++
 devel/py-undefined/pkg-descr                  | 16 ++++++++++++++++
 5 files changed, 52 insertions(+)

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202403310339.42V3d07E075858>