diff options
| author | Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2025-05-18 03:14:42 +0000 |
|---|---|---|
| committer | Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2025-05-18 03:14:42 +0000 |
| commit | 72e50977a616490b7fe634ef32a7a19bd35cd62d (patch) | |
| tree | 686a52a6e30897a396786d2174eae90b450db45d | |
| parent | 8c0998547eb9041f2a1a5e085b8740cddacdf66a (diff) | |
| -rw-r--r-- | devel/Makefile | 1 | ||||
| -rw-r--r-- | devel/py-eval-type-backport/Makefile | 24 | ||||
| -rw-r--r-- | devel/py-eval-type-backport/distinfo | 3 | ||||
| -rw-r--r-- | devel/py-eval-type-backport/pkg-descr | 10 |
4 files changed, 38 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile index e90c55428668..e39e0606d2b5 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -4853,6 +4853,7 @@ SUBDIR += py-etcd3gw SUBDIR += py-etils SUBDIR += py-etuples + SUBDIR += py-eval-type-backport SUBDIR += py-evdev SUBDIR += py-eventlib SUBDIR += py-ewah-bool-utils diff --git a/devel/py-eval-type-backport/Makefile b/devel/py-eval-type-backport/Makefile new file mode 100644 index 000000000000..faf88027867a --- /dev/null +++ b/devel/py-eval-type-backport/Makefile @@ -0,0 +1,24 @@ +PORTNAME= eval-type-backport +PORTVERSION= 0.2.2 +CATEGORIES= devel python +MASTER_SITES= PYPI +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} +DISTNAME= eval_type_backport-${PORTVERSION} + +MAINTAINER= sunpoet@FreeBSD.org +COMMENT= Like typing._eval_type, but lets older Python versions use newer typing features +WWW= https://github.com/alexmojaki/eval_type_backport + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE.txt + +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}setuptools-scm>=0:devel/py-setuptools-scm@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR} + +USES= python +USE_PYTHON= autoplist concurrent pep517 + +NO_ARCH= yes + +.include <bsd.port.mk> diff --git a/devel/py-eval-type-backport/distinfo b/devel/py-eval-type-backport/distinfo new file mode 100644 index 000000000000..2808b0f23d85 --- /dev/null +++ b/devel/py-eval-type-backport/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1745936006 +SHA256 (eval_type_backport-0.2.2.tar.gz) = f0576b4cf01ebb5bd358d02314d31846af5e07678387486e2c798af0e7d849c1 +SIZE (eval_type_backport-0.2.2.tar.gz) = 9079 diff --git a/devel/py-eval-type-backport/pkg-descr b/devel/py-eval-type-backport/pkg-descr new file mode 100644 index 000000000000..7d002c6f37d8 --- /dev/null +++ b/devel/py-eval-type-backport/pkg-descr @@ -0,0 +1,10 @@ +eval_type_backport is a tiny package providing a replacement for +typing._eval_type to support newer typing features in older Python versions. + +Yes, that's very specific, and yes, typing._eval_type is a protected function +that you shouldn't normally be using. Really this package is specifically made +for pydantic/pydantic#7873. + +Specifically, this transforms X | Y into typing.Union[X, Y] and list[X] into +typing.List[X] etc. (for all the types made generic in PEP 585) if the original +syntax is not supported in the current Python version. |
