diff options
| author | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2023-03-26 09:02:29 +0000 |
|---|---|---|
| committer | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2023-03-26 09:02:29 +0000 |
| commit | 2fc33273150b3b4dd196028483446c6ee98cee2d (patch) | |
| tree | ea3b0df33042ef40fe1efc79369f61352d6d0bf1 /dev-python/pytz | |
| parent | 6d02d2a34f1f9fab7c0997458e000437629755dd (diff) | |
| download | baldeagleos-repo-2fc33273150b3b4dd196028483446c6ee98cee2d.tar.gz baldeagleos-repo-2fc33273150b3b4dd196028483446c6ee98cee2d.tar.xz baldeagleos-repo-2fc33273150b3b4dd196028483446c6ee98cee2d.zip | |
Adding metadata
Diffstat (limited to 'dev-python/pytz')
| -rw-r--r-- | dev-python/pytz/Manifest | 1 | ||||
| -rw-r--r-- | dev-python/pytz/files/pytz-2023.2-system-tzinfo.patch | 51 | ||||
| -rw-r--r-- | dev-python/pytz/metadata.xml | 4 | ||||
| -rw-r--r-- | dev-python/pytz/pytz-2023.2-r1.ebuild | 51 | ||||
| -rw-r--r-- | dev-python/pytz/pytz-2023.2.ebuild | 34 |
5 files changed, 138 insertions, 3 deletions
diff --git a/dev-python/pytz/Manifest b/dev-python/pytz/Manifest index 65018aca8db1..c431eda03409 100644 --- a/dev-python/pytz/Manifest +++ b/dev-python/pytz/Manifest @@ -1 +1,2 @@ DIST pytz-2022.7.1.tar.gz 313522 BLAKE2B f0e787438f56bb33e0681f28392ddcb8dde41e51437caf34de8c9891af468a1b60f845d393d300c408af598aa93463f2a66848a8d20754bd7980d44cac0f4216 SHA512 c70b9ef9c6e6a7dd50fc80a58bf068af33dbcdc83c3f2f44b0726e696927e17d843f2f0438392b6f34738a63aa51c5025e6aa4bcbb9e43400b9d68334ff05c18 +DIST pytz-2023.2.tar.gz 316321 BLAKE2B 62f1896100f78d30953e40239b43cd9a53f365506bd56d0ed2ca21a31f1d5510e492e8751acfc44cb0a41e0db9125b454b9512f2b39be5fadfd366683738b893 SHA512 f0b7884bdad4ac367e1a812ff0402ad343592b062d6067d41133802972faf290a602e037686b28fc62574da49c4365b8a9213b3b02ad251835ceca692809355d 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 498517334ecc..9e3056bb74ae 100644 --- a/dev-python/pytz/metadata.xml +++ b/dev-python/pytz/metadata.xml @@ -13,9 +13,7 @@ Library Reference (datetime.tzinfo). Amost all (over 540) of the Olson timezones are supported. </longdescription> - <upstream> - <remote-id type="launchpad">pytz</remote-id> - </upstream> + <origin>gentoo-staging</origin> <stabilize-allarches/> </pkgmetadata>
\ No newline at end of file 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..2f4a0773264a --- /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_{7,8,9,10,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..e6f20f00a847 --- /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_{7,8,9,10,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}" +} |
