git: 4a78f889506a - main - devel/py-pytz-deprecation-shim: Add py-pytz-deprecation-shim 0.1.0.post0
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 16 Apr 2022 04:20:49 UTC
The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=4a78f889506a9b7b4d57db0aac50f180dc3d5be7 commit 4a78f889506a9b7b4d57db0aac50f180dc3d5be7 Author: Po-Chuan Hsieh <sunpoet@FreeBSD.org> AuthorDate: 2022-04-16 03:39:02 +0000 Commit: Po-Chuan Hsieh <sunpoet@FreeBSD.org> CommitDate: 2022-04-16 04:19:03 +0000 devel/py-pytz-deprecation-shim: Add py-pytz-deprecation-shim 0.1.0.post0 pytz has served the Python community well for many years, but it is no longer the best option for providing time zones. pytz has a non-standard interface that is very easy to misuse; this interface was necessary when pytz was created, because datetime had no way to represent ambiguous datetimes, but this was solved in Python 3.6, which added a fold attribute to datetimes in PEP 495. With the addition of the zoneinfo module in Python 3.9 (PEP 615), there has never been a better time to migrate away from pytz. However, since pytz time zones are used very differently from a standard tzinfo, and many libraries have built pytz zones into their standard time zone interface (and thus may have users relying on the existence of the localize and normalize methods); this library provides shim classes that are compatible with both PEP 495 and pytz's interface, to make it easier for libraries to deprecate pytz. WWW: https://github.com/pganssle/pytz-deprecation-shim --- devel/Makefile | 1 + devel/py-pytz-deprecation-shim/Makefile | 29 +++++++++++++++++++++++++++ devel/py-pytz-deprecation-shim/distinfo | 3 +++ devel/py-pytz-deprecation-shim/files/setup.py | 3 +++ devel/py-pytz-deprecation-shim/pkg-descr | 15 ++++++++++++++ 5 files changed, 51 insertions(+) diff --git a/devel/Makefile b/devel/Makefile index f9d172eafab1..3c4128bf05f0 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -5148,6 +5148,7 @@ SUBDIR += py-pytrie SUBDIR += py-pytvmaze SUBDIR += py-pytz + SUBDIR += py-pytz-deprecation-shim SUBDIR += py-pytzdata SUBDIR += py-pyudev SUBDIR += py-pyupgrade diff --git a/devel/py-pytz-deprecation-shim/Makefile b/devel/py-pytz-deprecation-shim/Makefile new file mode 100644 index 000000000000..d0188f522570 --- /dev/null +++ b/devel/py-pytz-deprecation-shim/Makefile @@ -0,0 +1,29 @@ +# Created by: Po-Chuan Hsieh <sunpoet@FreeBSD.org> + +PORTNAME= pytz-deprecation-shim +PORTVERSION= 0.1.0.post0 +CATEGORIES= devel python +MASTER_SITES= CHEESESHOP +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} +DISTNAME= pytz_deprecation_shim-${PORTVERSION} + +MAINTAINER= sunpoet@FreeBSD.org +COMMENT= Shims to make deprecation of pytz easier + +LICENSE= APACHE20 + +USES= python:3.7+ +USE_PYTHON= autoplist concurrent distutils + +NO_ARCH= yes + +.include <bsd.port.pre.mk> + +.if ${PYTHON_REL} < 30900 +RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}backports.zoneinfo>=0:devel/py-backports.zoneinfo@${PY_FLAVOR} +.endif + +post-patch: + @${CP} ${FILESDIR}/setup.py ${WRKSRC}/ + +.include <bsd.port.post.mk> diff --git a/devel/py-pytz-deprecation-shim/distinfo b/devel/py-pytz-deprecation-shim/distinfo new file mode 100644 index 000000000000..14572b597682 --- /dev/null +++ b/devel/py-pytz-deprecation-shim/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1649423644 +SHA256 (pytz_deprecation_shim-0.1.0.post0.tar.gz) = af097bae1b616dde5c5744441e2ddc69e74dfdcb0c263129610d85b87445a59d +SIZE (pytz_deprecation_shim-0.1.0.post0.tar.gz) = 60190 diff --git a/devel/py-pytz-deprecation-shim/files/setup.py b/devel/py-pytz-deprecation-shim/files/setup.py new file mode 100644 index 000000000000..606849326a40 --- /dev/null +++ b/devel/py-pytz-deprecation-shim/files/setup.py @@ -0,0 +1,3 @@ +from setuptools import setup + +setup() diff --git a/devel/py-pytz-deprecation-shim/pkg-descr b/devel/py-pytz-deprecation-shim/pkg-descr new file mode 100644 index 000000000000..b6b16f4a6083 --- /dev/null +++ b/devel/py-pytz-deprecation-shim/pkg-descr @@ -0,0 +1,15 @@ +pytz has served the Python community well for many years, but it is no longer +the best option for providing time zones. pytz has a non-standard interface that +is very easy to misuse; this interface was necessary when pytz was created, +because datetime had no way to represent ambiguous datetimes, but this was +solved in Python 3.6, which added a fold attribute to datetimes in PEP 495. With +the addition of the zoneinfo module in Python 3.9 (PEP 615), there has never +been a better time to migrate away from pytz. + +However, since pytz time zones are used very differently from a standard tzinfo, +and many libraries have built pytz zones into their standard time zone interface +(and thus may have users relying on the existence of the localize and normalize +methods); this library provides shim classes that are compatible with both PEP +495 and pytz's interface, to make it easier for libraries to deprecate pytz. + +WWW: https://github.com/pganssle/pytz-deprecation-shim