summaryrefslogtreecommitdiff
path: root/dev-python/pendulum
diff options
context:
space:
mode:
authorLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2024-02-02 22:02:54 +0000
committerLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2024-02-02 22:02:54 +0000
commitcb15c30ceba407f2c568abfa1dad66929ab694a0 (patch)
tree50962df53fe4696d8550828a97b5857d1ddc5ea8 /dev-python/pendulum
parent6e12b39918cf358b39b3454025fee1e5dc650d35 (diff)
downloadbaldeagleos-repo-cb15c30ceba407f2c568abfa1dad66929ab694a0.tar.gz
baldeagleos-repo-cb15c30ceba407f2c568abfa1dad66929ab694a0.tar.xz
baldeagleos-repo-cb15c30ceba407f2c568abfa1dad66929ab694a0.zip
Adding metadata
Diffstat (limited to 'dev-python/pendulum')
-rw-r--r--dev-python/pendulum/files/pendulum-3.0.0-system-tzdata.patch50
-rw-r--r--dev-python/pendulum/pendulum-3.0.0-r1.ebuild (renamed from dev-python/pendulum/pendulum-3.0.0.ebuild)11
2 files changed, 59 insertions, 2 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?= <mgorny@gentoo.org>
+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
index 06cb4e481f84..ff6c4777d776 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=( python3_{8,9,10,11,12} pypy3 )
+PYTHON_COMPAT=( python3_{8,9,10,11,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"