From e292b671b113c2cc012beddad93a3df4f9410698 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 25 Mar 2023 18:50:52 +0000 Subject: gentoo auto-resync : 25:03:2023 - 18:50:52 --- dev-python/pytz/Manifest | 6 ++- .../pytz/files/pytz-2023.2-system-tzinfo.patch | 51 ++++++++++++++++++++++ dev-python/pytz/metadata.xml | 2 +- dev-python/pytz/pytz-2023.2-r1.ebuild | 51 ++++++++++++++++++++++ dev-python/pytz/pytz-2023.2.ebuild | 34 +++++++++++++++ 5 files changed, 142 insertions(+), 2 deletions(-) create mode 100644 dev-python/pytz/files/pytz-2023.2-system-tzinfo.patch create mode 100644 dev-python/pytz/pytz-2023.2-r1.ebuild create mode 100644 dev-python/pytz/pytz-2023.2.ebuild (limited to 'dev-python/pytz') diff --git a/dev-python/pytz/Manifest b/dev-python/pytz/Manifest index 854cb8dfee9c..62c56b0e8ea5 100644 --- a/dev-python/pytz/Manifest +++ b/dev-python/pytz/Manifest @@ -1,3 +1,7 @@ +AUX pytz-2023.2-system-tzinfo.patch 1743 BLAKE2B 4ee31a0bf91dd8ddb5fe8d27f5cd7a276fb0fae0aee9b5344ff3b1db475647f2665a510cdf065a67fd909041d2180ce0bd8f5f6abb2622cc518a4393aea442e5 SHA512 1ca832cb516aabfa6dec4c9ba4bbd25926af7ecdb5b5e5c78d9e2c3cd35361ac7fcde2190ec39ca8fbef1da49d4a7c7d83e20133b86dee60be0de52e26e03daf DIST pytz-2022.7.1.tar.gz 313522 BLAKE2B f0e787438f56bb33e0681f28392ddcb8dde41e51437caf34de8c9891af468a1b60f845d393d300c408af598aa93463f2a66848a8d20754bd7980d44cac0f4216 SHA512 c70b9ef9c6e6a7dd50fc80a58bf068af33dbcdc83c3f2f44b0726e696927e17d843f2f0438392b6f34738a63aa51c5025e6aa4bcbb9e43400b9d68334ff05c18 +DIST pytz-2023.2.tar.gz 316321 BLAKE2B 62f1896100f78d30953e40239b43cd9a53f365506bd56d0ed2ca21a31f1d5510e492e8751acfc44cb0a41e0db9125b454b9512f2b39be5fadfd366683738b893 SHA512 f0b7884bdad4ac367e1a812ff0402ad343592b062d6067d41133802972faf290a602e037686b28fc62574da49c4365b8a9213b3b02ad251835ceca692809355d EBUILD pytz-2022.7.1.ebuild 779 BLAKE2B 385bd8561698a862d2c897b0efb2b1217e9966ec7b07cc8c8757fed57e033326534b54cc5dd182c989cd4c18ee908c053e95179379643c56c73644c6a6411987 SHA512 f274dc7caabb2aaeca437931b3100bf1d2b8824ef9e94d1bf2bc27eddf3078b99c4cb2d97a45eeb4794107322bd2b15a0ebb58162fea2c16c1ddd3ddfe6d04f6 -MISC metadata.xml 816 BLAKE2B fbebba08fc9a0eac3a94dff015dea77b57f01559bd703b906d7f922aa88b8aff3a43ca2391210533742d2ac6c16e6bf3e31b1a6bd5dd2ebf47ce7a29edf5040f SHA512 2614764bcffed71e746257b6cce2bb68de1205292001acbcff5bd69e3564ecabce55970967394ee3900e21dcf29d25150fa579bf39bffb189fd3b4e509d7b412 +EBUILD pytz-2023.2-r1.ebuild 1181 BLAKE2B bf265f98c94ec1e736985ca43093ea7165d4c2244a80e9fa041b9f3cd3488319467af0f971054509aff00434bfb95ddb6229ed80a1e01a1d4cf3c7ffb35d95d1 SHA512 1b55ce4c86663dbd18e3f4f16dd4276d823309d54acc752f7642e7049e67a8f0bbd38d3aca217c71c7da6112c4da288c0ecfec0834e23d24fead2372c49dc2d1 +EBUILD pytz-2023.2.ebuild 787 BLAKE2B 5bb9d1edc4b62b13a44008a63456e84ff83c00b1eb40139e4cb59f8315f84e6f7fe15ec0ca17c66e86862d2c69724258f3f86feb85ced5648768702d0180c539 SHA512 8d551fe07bb7e33c2fb301c2d37ddc70904c58821cfe548ed64cf673db5648ce8bc1b06b16063b5a06b1cc8fbbd2d026367ca36f46be09948c8f3c22bb957738 +MISC metadata.xml 820 BLAKE2B 224acaf3f2b85e717829a59108a4053e9a60bc710c330b12dc3f181685d5c8ab1b090105796f092004b1a70781882438b0c0a27bc96ef0116b33fe7051cc6ad5 SHA512 c9a677d89a9f831f3a9833b02e6cec36adbb27688e117b66caad32d3be10fca19787dd85eb14e21eb95d6ed8ba6ff02122ad9f54aa175252834dc4c219b7c219 diff --git a/dev-python/pytz/files/pytz-2023.2-system-tzinfo.patch b/dev-python/pytz/files/pytz-2023.2-system-tzinfo.patch new file mode 100644 index 000000000000..1e64f1bd2fa4 --- /dev/null +++ b/dev-python/pytz/files/pytz-2023.2-system-tzinfo.patch @@ -0,0 +1,51 @@ +Inspired by the Fedora patch: +https://src.fedoraproject.org/rpms/pytz/blob/rawhide/f/pytz-zoneinfo.patch + +_allzones() is based on code in gen_tzinfo.py in upstream repo. + +diff --git a/pytz/__init__.py b/pytz/__init__.py +index f89d0eb..d00f3bb 100644 +--- a/pytz/__init__.py ++++ b/pytz/__init__.py +@@ -75,6 +75,20 @@ else: # Python 2.x + return s.encode('ASCII') + + ++def _allzones(): ++ for dirpath, dirnames, filenames in os.walk(_PYTZ_TZDATADIR): ++ for f in filenames: ++ p = os.path.join(dirpath, f) ++ if open(p, 'rb').read(4) == b'TZif': ++ yield os.path.relpath(p, _PYTZ_TZDATADIR) ++ ++ ++_PYTZ_TZDATADIR = os.environ.get('PYTZ_TZDATADIR', '/usr/share/zoneinfo') ++_all_timezones_unchecked = LazyList(x for x in _allzones()) ++all_timezones = _all_timezones_unchecked ++all_timezones_set = LazySet(all_timezones) ++ ++ + def open_resource(name): + """Open a resource from the zoneinfo subdir for reading. + +@@ -88,7 +102,7 @@ def open_resource(name): + for part in name_parts: + if part == os.path.pardir or os.sep in part: + raise ValueError('Bad path segment: %r' % part) +- zoneinfo_dir = os.environ.get('PYTZ_TZDATADIR', None) ++ zoneinfo_dir = _PYTZ_TZDATADIR + if zoneinfo_dir is not None: + filename = os.path.join(zoneinfo_dir, *name_parts) + else: +diff --git a/setup.py b/setup.py +index 24f7f37..b03592c 100644 +--- a/setup.py ++++ b/setup.py +@@ -21,7 +21,6 @@ for dirpath, dirnames, filenames in os.walk(os.path.join('pytz', 'zoneinfo')): + resources.extend([os.path.join(basepath, filename) for filename in filenames]) + package_data = {'pytz': resources} + +-assert len(resources) > 10, 'zoneinfo files not found!' + + setup( + name='pytz', diff --git a/dev-python/pytz/metadata.xml b/dev-python/pytz/metadata.xml index 5e6047818028..59ff8007ca82 100644 --- a/dev-python/pytz/metadata.xml +++ b/dev-python/pytz/metadata.xml @@ -15,7 +15,7 @@ + stub42/pytz pytz - pytz diff --git a/dev-python/pytz/pytz-2023.2-r1.ebuild b/dev-python/pytz/pytz-2023.2-r1.ebuild new file mode 100644 index 000000000000..eea96064ba6e --- /dev/null +++ b/dev-python/pytz/pytz-2023.2-r1.ebuild @@ -0,0 +1,51 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{9..11} pypy3 ) +PYTHON_REQ_USE="threads(+)" + +inherit distutils-r1 pypi + +DESCRIPTION="World timezone definitions for Python" +HOMEPAGE=" + https://pythonhosted.org/pytz/ + https://github.com/stub42/pytz/ + https://pypi.org/project/pytz/ +" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris" +IUSE="test" +RESTRICT="!test? ( test )" + +RDEPEND=" + || ( + >=sys-libs/timezone-data-2023b + sys-libs/glibc[vanilla] + ) +" +BDEPEND=" + test? ( + ${RDEPEND} + ) +" + +src_prepare() { + distutils-r1_src_prepare + + # unbundle timezone-data + rm -r pytz/zoneinfo || die + # remove hardcoded list of all timezones but leave subjective set + # of "common timezones" + sed -i -e '/^_all_timezones_unchecked/,/^all_timezones_set/d' pytz/__init__.py || die + eapply "${FILESDIR}"/pytz-2023.2-system-tzinfo.patch +} + +python_test() { + "${EPYTHON}" pytz/tests/test_tzinfo.py -v || + die "Tests fail with ${EPYTHON}" +} diff --git a/dev-python/pytz/pytz-2023.2.ebuild b/dev-python/pytz/pytz-2023.2.ebuild new file mode 100644 index 000000000000..f9351ada4225 --- /dev/null +++ b/dev-python/pytz/pytz-2023.2.ebuild @@ -0,0 +1,34 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{9..11} pypy3 ) +PYTHON_REQ_USE="threads(+)" + +inherit distutils-r1 pypi + +DESCRIPTION="World timezone definitions for Python" +HOMEPAGE=" + https://pythonhosted.org/pytz/ + https://launchpad.net/pytz/ + https://pypi.org/project/pytz/ +" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris" + +DEPEND=" + || ( + >=sys-libs/timezone-data-2017a + sys-libs/glibc[vanilla] + ) +" +RDEPEND="${DEPEND}" + +python_test() { + "${EPYTHON}" pytz/tests/test_tzinfo.py -v || + die "Tests fail with ${EPYTHON}" +} -- cgit v1.2.3