From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 20D4A158041 for ; Fri, 1 Mar 2024 19:06:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5078CE29FE; Fri, 1 Mar 2024 19:06:58 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 32F15E29FE for ; Fri, 1 Mar 2024 19:06:58 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4EDC43430DE for ; Fri, 1 Mar 2024 19:06:57 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id AC50F1065 for ; Fri, 1 Mar 2024 19:06:55 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1709320012.5a05276947c1f2ef37179bf415e72c9b0b04f70a.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/python-dateutil/, dev-python/python-dateutil/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/python-dateutil/Manifest dev-python/python-dateutil/files/python-dateutil-2.9.0-no-pytest-cov.patch dev-python/python-dateutil/files/python-dateutil-2.9.0-system-tzdata.patch dev-python/python-dateutil/python-dateutil-2.9.0.ebuild X-VCS-Directories: dev-python/python-dateutil/ dev-python/python-dateutil/files/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 5a05276947c1f2ef37179bf415e72c9b0b04f70a X-VCS-Branch: master Date: Fri, 1 Mar 2024 19:06:55 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: eedc9d87-0ddc-4fe9-b28d-3bd25b675f7f X-Archives-Hash: 9d9861dd1791e1167450d70d52ea008f commit: 5a05276947c1f2ef37179bf415e72c9b0b04f70a Author: Michał Górny gentoo org> AuthorDate: Fri Mar 1 18:57:55 2024 +0000 Commit: Michał Górny gentoo org> CommitDate: Fri Mar 1 19:06:52 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5a052769 dev-python/python-dateutil: Bump to 2.9.0 Signed-off-by: Michał Górny gentoo.org> dev-python/python-dateutil/Manifest | 1 + .../python-dateutil-2.9.0-no-pytest-cov.patch | 18 +++++ .../python-dateutil-2.9.0-system-tzdata.patch | 91 ++++++++++++++++++++++ .../python-dateutil/python-dateutil-2.9.0.ebuild | 47 +++++++++++ 4 files changed, 157 insertions(+) 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 +}