diff options
author | 2024-03-01 19:57:55 +0100 | |
---|---|---|
committer | 2024-03-01 20:06:52 +0100 | |
commit | 5a05276947c1f2ef37179bf415e72c9b0b04f70a (patch) | |
tree | 6a58d1a5d211a8021f23d36ae444b7ed3274e8a9 /dev-python/python-dateutil | |
parent | sci-libs/caffe2: depends on ideep (diff) | |
download | gentoo-5a05276947c1f2ef37179bf415e72c9b0b04f70a.tar.gz gentoo-5a05276947c1f2ef37179bf415e72c9b0b04f70a.tar.bz2 gentoo-5a05276947c1f2ef37179bf415e72c9b0b04f70a.zip |
dev-python/python-dateutil: Bump to 2.9.0
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/python-dateutil')
4 files changed, 157 insertions, 0 deletions
diff --git a/dev-python/python-dateutil/Manifest b/dev-python/python-dateutil/Manifest index e719bccf5703..d65916729160 100644 --- a/dev-python/python-dateutil/Manifest +++ b/dev-python/python-dateutil/Manifest @@ -1 +1,2 @@ DIST python-dateutil-2.8.2.tar.gz 357324 BLAKE2B 060f97280b63ed70e6d83fa5696af6dc3c729cdf5bc48c7a90e3e59eb0cc0360e5205536685550330d64ecc9b6e40ca12888409d6819dd136b17a67add2ec4e8 SHA512 6538858e4a3e2d1de1bf25b6d8b25e3a8d20bf60fb85e32d07ac491c90ce193e268bb5641371b8a79fb0f033a184bac9896b3bc643c1aca9ee9c6478286ac20c +DIST python-dateutil-2.9.0.tar.gz 342990 BLAKE2B 32e4e4e251d27e5a870df24445fa0b2fa76761cb06ba4d8a779938a58fd5cf4bbf1739670f60ca4b41d46db6343a785d6bd71fbe3dd2a816d5cb0fa0d3296fbc SHA512 7dd550d646477c8c3953a42aabe4c0aa3f4d1f74f6fed018a1a429270f41aa2c6832df264e67510d380d149eaa436c1b613544c8026c180c2241f15205ca6d36 diff --git a/dev-python/python-dateutil/files/python-dateutil-2.9.0-no-pytest-cov.patch b/dev-python/python-dateutil/files/python-dateutil-2.9.0-no-pytest-cov.patch new file mode 100644 index 000000000000..d483451a0adf --- /dev/null +++ b/dev-python/python-dateutil/files/python-dateutil-2.9.0-no-pytest-cov.patch @@ -0,0 +1,18 @@ +diff --git a/tests/conftest.py b/tests/conftest.py +index 78ed70a..4bb4c0a 100644 +--- a/tests/conftest.py ++++ b/tests/conftest.py +@@ -14,10 +14,11 @@ def pytest_collection_modifyitems(items): + + marker = marker_getter('xfail') + ++ # requires pytest-cov + # Need to query the args because conditional xfail tests still have + # the xfail mark even if they are not expected to fail +- if marker and (not marker.args or marker.args[0]): +- item.add_marker(pytest.mark.no_cover) ++ #if marker and (not marker.args or marker.args[0]): ++ # item.add_marker(pytest.mark.no_cover) + + + def set_tzpath(): diff --git a/dev-python/python-dateutil/files/python-dateutil-2.9.0-system-tzdata.patch b/dev-python/python-dateutil/files/python-dateutil-2.9.0-system-tzdata.patch new file mode 100644 index 000000000000..08a983d9f6a2 --- /dev/null +++ b/dev-python/python-dateutil/files/python-dateutil-2.9.0-system-tzdata.patch @@ -0,0 +1,91 @@ +diff --git a/src/dateutil/zoneinfo/__init__.py b/src/dateutil/zoneinfo/__init__.py +index 34f11ad..e3f0f94 100644 +--- a/src/dateutil/zoneinfo/__init__.py ++++ b/src/dateutil/zoneinfo/__init__.py +@@ -1,6 +1,7 @@ + # -*- coding: utf-8 -*- + import warnings + import json ++import os + + from tarfile import TarFile + from pkgutil import get_data +@@ -10,7 +11,7 @@ from dateutil.tz import tzfile as _tzfile + + __all__ = ["get_zonefile_instance", "gettz", "gettz_db_metadata"] + +-ZONEFILENAME = "dateutil-zoneinfo.tar.gz" ++ZONEDIRECTORY = "/usr/share/zoneinfo" + METADATA_FN = 'METADATA' + + +@@ -19,12 +20,14 @@ class tzfile(_tzfile): + return (gettz, (self._filename,)) + + +-def getzoneinfofile_stream(): +- try: +- return BytesIO(get_data(__name__, ZONEFILENAME)) +- except IOError as e: # TODO switch to FileNotFoundError? +- warnings.warn("I/O error({0}): {1}".format(e.errno, e.strerror)) +- return None ++def iter_zones(topdir): ++ for dirpath, dirnames, filenames in os.walk(topdir): ++ for f in filenames: ++ if f.endswith(('.list', '.tab', '.zi', 'leapseconds')): ++ continue ++ fpath = os.path.join(dirpath, f) ++ relpath = os.path.relpath(fpath, topdir) ++ yield (relpath, tzfile(fpath, filename=relpath)) + + + class ZoneInfoFile(object): +@@ -48,7 +51,7 @@ class ZoneInfoFile(object): + # no metadata in tar file + self.metadata = None + else: +- self.zones = {} ++ self.zones = dict(iter_zones(ZONEDIRECTORY)) + self.metadata = None + + def get(self, name, default=None): +@@ -99,7 +102,7 @@ def get_zonefile_instance(new_instance=False): + zif = getattr(get_zonefile_instance, '_cached_instance', None) + + if zif is None: +- zif = ZoneInfoFile(getzoneinfofile_stream()) ++ zif = ZoneInfoFile() + + get_zonefile_instance._cached_instance = zif + +@@ -140,7 +143,7 @@ def gettz(name): + DeprecationWarning) + + if len(_CLASS_ZONE_INSTANCE) == 0: +- _CLASS_ZONE_INSTANCE.append(ZoneInfoFile(getzoneinfofile_stream())) ++ _CLASS_ZONE_INSTANCE.append(ZoneInfoFile()) + return _CLASS_ZONE_INSTANCE[0].zones.get(name) + + +@@ -163,5 +166,5 @@ def gettz_db_metadata(): + DeprecationWarning) + + if len(_CLASS_ZONE_INSTANCE) == 0: +- _CLASS_ZONE_INSTANCE.append(ZoneInfoFile(getzoneinfofile_stream())) ++ _CLASS_ZONE_INSTANCE.append(ZoneInfoFile()) + return _CLASS_ZONE_INSTANCE[0].metadata +diff --git a/tests/test_imports.py b/tests/test_imports.py +index 7d0749e..4256f45 100644 +--- a/tests/test_imports.py ++++ b/tests/test_imports.py +@@ -232,9 +232,8 @@ def test_import_zone_info_from(): + def test_import_zone_info_star(): + from dateutil.zoneinfo import gettz + from dateutil.zoneinfo import gettz_db_metadata +- from dateutil.zoneinfo import rebuild + +- zi_all = (gettz, gettz_db_metadata, rebuild) ++ zi_all = (gettz, gettz_db_metadata) + + for var in zi_all: + assert var is not None diff --git a/dev-python/python-dateutil/python-dateutil-2.9.0.ebuild b/dev-python/python-dateutil/python-dateutil-2.9.0.ebuild new file mode 100644 index 000000000000..6d49a8fbb658 --- /dev/null +++ b/dev-python/python-dateutil/python-dateutil-2.9.0.ebuild @@ -0,0 +1,47 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYPI_NO_NORMALIZE=1 +PYTHON_COMPAT=( python3_{10..12} pypy3 ) + +inherit distutils-r1 pypi + +DESCRIPTION="Extensions to the standard Python datetime module" +HOMEPAGE=" + https://dateutil.readthedocs.io/ + https://pypi.org/project/python-dateutil/ + https://github.com/dateutil/dateutil/ +" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos" + +RDEPEND=" + >=dev-python/six-1.5[${PYTHON_USEDEP}] + sys-libs/timezone-data +" +BDEPEND=" + dev-python/setuptools-scm[${PYTHON_USEDEP}] + test? ( + dev-python/freezegun[${PYTHON_USEDEP}] + dev-python/hypothesis[${PYTHON_USEDEP}] + ) +" + +PATCHES=( + "${FILESDIR}/python-dateutil-2.9.0-system-tzdata.patch" + "${FILESDIR}/python-dateutil-2.9.0-no-pytest-cov.patch" +) + +distutils_enable_tests pytest + +python_prepare_all() { + # don't install zoneinfo tarball + sed -i '/package_data=/d' setup.py || die + + distutils-r1_python_prepare_all +} |