From nobody Sun Mar 31 03:39:00 2024 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V6fyD3nthz5GhD2; Sun, 31 Mar 2024 03:39:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V6fyD36gKz4DN1; Sun, 31 Mar 2024 03:39:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711856340; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nEss6BdlkjTLP4kIKfqxWzXzqvIxeBq68pEFQx3IaXQ=; b=Dmqgxp1FxwX0Cc243exHLM0oMc768nk3shFcWx+Q+S74tuRgt3o02CuVPGKIljt0UjjCyE VX2fIcECRSsUFbKYBgCJ/gVn1DQI4CTOo1wzB5Z3Fx7kSvU/G8jPMevFMav5qp+vH6oDwf as0b4xu0cChGVQnuvvaYmpZMZBlHwxe8mhjjS6Z0HnP1FsgXx8UhOt3G1lmHnHqsaRNCmU SqIbuLOIIwLOvK8UFMYJiHdIl8eXJyrRyQ7/YBZckYVuKG8xTDW6m6sBwq5NcD5VZigg+d BOe9pOQjBRMhtKUOJtOujAni8Ra9YF+qXr32cG7jT3MfKUqysFPRAFoK5/UQUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711856340; a=rsa-sha256; cv=none; b=gytbRaeCLscgBDk4GDXg3zL4ldrYfIHXZLZPIuv9Hj11Bel50gm2zIA9tO1QolVmYhbOKQ JPLWTw9cFxljTp3yYnTioCf5r+kgpihVU8rH8AKVr9fxDntT19HPuxntcvL6jfe1m6SKlH znODHXvujaJTPIPVhdbmw5qD2cZDH9yHufg3f8LpDkb6AGQ4OFALK9D/nW29HWqqPlGCgC pSxTE0X9XMtNMf//OspShq56P7cKT3rR+/p3xP1p4hGgIXGCLWKFZSabLkX/KYz5n/c1QE HyY72aK6CTebKTA6e1DJayr21Ttw6dWB3c2R3Jd+GXbVmjZh9fyHmk14ZlROOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711856340; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nEss6BdlkjTLP4kIKfqxWzXzqvIxeBq68pEFQx3IaXQ=; b=lJNZEd47EiLCENlU201CkHA9ij794dweyeAZ/Ow5U2J4yqkqCyhrmPnNXONVYV5tn2wv44 c6C34A0o/prWsMuPBZcV671pVyj0ffi6OwquY+ueTBP+d64yHN9yUNTB7KZuMb0mV78u8a 2oBfbKn+GklYMmua+xQSZ+F7THPQjgf+42YtwGmpnMFa3j7qLOIdt9fOf/Qzf4SVtYp1Kx RzaCX08ozt7AuIUsHDNkJh9qXvxclRRpuX5u0RGB3nmHYlLQqsKBSGwcUdhnnzXbRY5oxa KNxhLmMSm9wobeJhPd0LfCXXjup5xIL61bVieQHxo2MmJbEYmLaNjtttYb+0Lw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V6fyD13n4zL83; Sun, 31 Mar 2024 03:39:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 42V3d0UA075861; Sun, 31 Mar 2024 03:39:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42V3d07E075858; Sun, 31 Mar 2024 03:39:00 GMT (envelope-from git) Date: Sun, 31 Mar 2024 03:39:00 GMT Message-Id: <202403310339.42V3d07E075858@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: 6c7bd7025568 - main - devel/py-undefined: Add py-undefined 0.0.8 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6c7bd7025568cd8d16db6dab06e16c143e09d2f1 Auto-Submitted: auto-generated The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=6c7bd7025568cd8d16db6dab06e16c143e09d2f1 commit 6c7bd7025568cd8d16db6dab06e16c143e09d2f1 Author: Po-Chuan Hsieh AuthorDate: 2024-03-31 03:05:07 +0000 Commit: Po-Chuan Hsieh 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 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