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) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 21F5415815E for ; Fri, 2 Feb 2024 17:08:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 631CFE2A20; Fri, 2 Feb 2024 17:08:07 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.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 431E3E2A20 for ; Fri, 2 Feb 2024 17:08:07 +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 87CCE3431CB for ; Fri, 2 Feb 2024 17:08:06 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C64E1358 for ; Fri, 2 Feb 2024 17:08:04 +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: <1706893544.201dd83ec2775bf467c9c05eb0ecbc9c14fe45cf.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pendulum/, dev-python/pendulum/files/, profiles/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/pendulum/files/pendulum-3.0.0-system-tzdata.patch dev-python/pendulum/pendulum-3.0.0-r1.ebuild dev-python/pendulum/pendulum-3.0.0.ebuild profiles/package.mask X-VCS-Directories: profiles/ dev-python/pendulum/files/ dev-python/pendulum/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 201dd83ec2775bf467c9c05eb0ecbc9c14fe45cf X-VCS-Branch: master Date: Fri, 2 Feb 2024 17:08:04 +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: 59ef25af-025d-4a5c-bb23-4c9bc97f0dc4 X-Archives-Hash: 5d62a311255ff62fe8be5a193f6999fa commit: 201dd83ec2775bf467c9c05eb0ecbc9c14fe45cf Author: Michał Górny gentoo org> AuthorDate: Fri Feb 2 16:57:52 2024 +0000 Commit: Michał Górny gentoo org> CommitDate: Fri Feb 2 17:05:44 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=201dd83e dev-python/pendulum: Bump to 15.0.0 Signed-off-by: Michał Górny gentoo.org> .../files/pendulum-3.0.0-system-tzdata.patch | 50 ++++++++++++++++++++++ ...dulum-3.0.0.ebuild => pendulum-3.0.0-r1.ebuild} | 11 ++++- profiles/package.mask | 5 --- 3 files changed, 59 insertions(+), 7 deletions(-) diff --git a/dev-python/pendulum/files/pendulum-3.0.0-system-tzdata.patch b/dev-python/pendulum/files/pendulum-3.0.0-system-tzdata.patch new file mode 100644 index 000000000000..c99bbb3ca9ea --- /dev/null +++ b/dev-python/pendulum/files/pendulum-3.0.0-system-tzdata.patch @@ -0,0 +1,50 @@ +From 0143f10dfcc94f5cba1a83912e055026a0282c19 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Fri, 2 Feb 2024 17:48:55 +0100 +Subject: [PATCH] Fix `pendulum.tz.timezones()` to use system tzdata + +Fix the `pendulum.tz.available_timezones()` to use +`available_timezones()` function instead of iterating over the files +in `tzdata` package. This is more in line with PEP 615, as the system +timezone functions will operate on system-provided tzdata when +available, and use the `tzdata` package only if it's not available. +Therefore, the previous code would yield a potentially different list +of timezones than the system actually provides. + +Furthermore, Gentoo provides a dummy `tzdata` package that does not +provide any data, since Python always uses system tzdata. This change +is necessary to make pendulum work again on Gentoo. + +Fixes #769 +--- + src/pendulum/tz/__init__.py | 10 ++-------- + 1 file changed, 2 insertions(+), 8 deletions(-) + +diff --git a/src/pendulum/tz/__init__.py b/src/pendulum/tz/__init__.py +index 36c2c692..8dc64705 100644 +--- a/src/pendulum/tz/__init__.py ++++ b/src/pendulum/tz/__init__.py +@@ -9,7 +9,7 @@ + from pendulum.tz.timezone import UTC + from pendulum.tz.timezone import FixedTimezone + from pendulum.tz.timezone import Timezone +-from pendulum.utils._compat import resources ++from pendulum.utils._zoneinfo import available_timezones + + + PRE_TRANSITION = "pre" +@@ -22,13 +22,7 @@ + + + def timezones() -> tuple[str, ...]: +- global _timezones +- +- if _timezones is None: +- with cast(Path, resources.files("tzdata").joinpath("zones")).open() as f: +- _timezones = tuple(tz.strip() for tz in f.readlines()) +- +- return _timezones ++ return available_timezones() + + + def fixed_timezone(offset: int) -> FixedTimezone: diff --git a/dev-python/pendulum/pendulum-3.0.0.ebuild b/dev-python/pendulum/pendulum-3.0.0-r1.ebuild similarity index 87% rename from dev-python/pendulum/pendulum-3.0.0.ebuild rename to dev-python/pendulum/pendulum-3.0.0-r1.ebuild index dc6bceec790c..2baadad9d93e 100644 --- a/dev-python/pendulum/pendulum-3.0.0.ebuild +++ b/dev-python/pendulum/pendulum-3.0.0-r1.ebuild @@ -1,11 +1,11 @@ -# Copyright 2022-2023 Gentoo Authors +# Copyright 2022-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 DISTUTILS_EXT=1 DISTUTILS_USE_PEP517=maturin -PYTHON_COMPAT=( pypy3 python3_{10..12} ) +PYTHON_COMPAT=( python3_{10..12} ) CRATES=" autocfg@1.1.0 @@ -84,3 +84,10 @@ BDEPEND=" " distutils_enable_tests pytest + +PATCHES=( + # https://github.com/sdispater/pendulum/pull/801 + "${FILESDIR}/${P}-system-tzdata.patch" +) + +QA_FLAGS_IGNORED="usr/lib.*/py.*/site-packages/pendulum/_pendulum.*.so" diff --git a/profiles/package.mask b/profiles/package.mask index cdc1577290bb..76d5710f5c3b 100644 --- a/profiles/package.mask +++ b/profiles/package.mask @@ -348,11 +348,6 @@ x11-libs/snorenotify =net-libs/signond-8.61-r100 ~sys-auth/polkit-qt-0.175.0 -# Michał Górny (2023-12-17) -# Broken due to invalid use of tzdata. -# https://github.com/sdispater/pendulum/issues/769 -=dev-python/pendulum-3.0.0 - # Sam James (2023-12-14) # Gentoo's kernel maintainers have decided to discontinue gentoo-sources and # gentoo-kernel for old kernel LTS branches because of the resources to require