[packages/python-pytz] Up to 2026.1.post1
arekm
arekm at pld-linux.org
Fri Apr 24 17:55:36 CEST 2026
commit 59ff09ed7604199cd1153f54c93cb771b5081f04
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Fri Apr 24 17:55:18 2026 +0200
Up to 2026.1.post1
python-pytz.spec | 6 +++---
zoneinfo.patch | 29 ++++++++++++++++++++---------
2 files changed, 23 insertions(+), 12 deletions(-)
---
diff --git a/python-pytz.spec b/python-pytz.spec
index 3d08671..91f7bc0 100644
--- a/python-pytz.spec
+++ b/python-pytz.spec
@@ -10,17 +10,17 @@
# - ...but other packages may require newer version anyway, through egg dependencies
%define module pytz
# pytz/__init__.py /OLSON_VERSION
-%define olsonver 2025b
+%define olsonver 2026a
Summary: pytz - Olson timezone database in Python
Summary(pl.UTF-8): pytz - baza stref czasowych Olsona w Pythonie
Name: python-%{module}
-Version: 2025.2
+Version: 2026.1.post1
Release: 1
License: MIT or ZPL v2.1
Group: Libraries/Python
#Source0Download: https://pypi.org/simple/pytz/
Source0: https://files.pythonhosted.org/packages/source/p/pytz/pytz-%{version}.tar.gz
-# Source0-md5: 6a7760c71e38b6c75577b34b18b89d5b
+# Source0-md5: d805ceb0fe3717e324299865398d70b0
Patch0: zoneinfo.patch
URL: http://pytz.sourceforge.net/
BuildRequires: rpmbuild(macros) >= 1.714
diff --git a/zoneinfo.patch b/zoneinfo.patch
index 0b2149b..c86e5a9 100644
--- a/zoneinfo.patch
+++ b/zoneinfo.patch
@@ -1,6 +1,6 @@
---- pytz-2025.2/pytz/__init__.py.orig 2025-07-15 20:46:48.188231957 +0200
-+++ pytz-2025.2/pytz/__init__.py 2025-07-15 20:49:31.787345665 +0200
-@@ -75,12 +75,13 @@ else: # Python 2.x
+--- pytz-2026.1.post1/pytz/__init__.py.orig 2026-03-03 08:47:27.000000000 +0100
++++ pytz-2026.1.post1/pytz/__init__.py 2026-04-24 15:50:33.000000000 +0200
+@@ -75,12 +75,13 @@
return s.encode('ASCII')
@@ -17,13 +17,23 @@
It is possible to specify different location for zoneinfo
subdir by using the PYTZ_TZDATADIR environment variable.
"""
-@@ -92,19 +93,7 @@ def open_resource(name):
+@@ -92,29 +93,7 @@
if zoneinfo_dir is not None:
filename = os.path.join(zoneinfo_dir, *name_parts)
else:
- filename = os.path.join(os.path.dirname(__file__),
- 'zoneinfo', *name_parts)
- if not os.path.exists(filename):
+- # pkg_resources is deprecated, try with importlib first
+- try:
+- from importlib.resources import files
+- except ImportError:
+- files = None
+-
+- if files is not None:
+- # retrieve the zoneinfo file Path object and return its file handle
+- return files(__name__).joinpath('zoneinfo', *name_parts).open('rb')
+-
- # http://bugs.launchpad.net/bugs/383171 - we avoid using this
- # unless absolutely necessary to help when a broken version of
- # pkg_resources is installed.
@@ -38,7 +48,7 @@
return open(filename, 'rb')
-@@ -202,7 +191,7 @@ def _case_insensitive_zone_lookup(zone):
+@@ -212,7 +191,7 @@
"""case-insensitively matching timezone, else return zone unchanged"""
global _all_timezones_lower_to_standard
if _all_timezones_lower_to_standard is None:
@@ -47,13 +57,13 @@
return _all_timezones_lower_to_standard.get(zone.lower()) or zone # noqa
-@@ -514,11 +503,38 @@ def _test():
+@@ -524,11 +503,37 @@
if __name__ == '__main__':
_test()
-all_timezones = LazyList(
- tz for tz in _all_timezones_unchecked if resource_exists(tz))
-+
+-
+all_timezones = []
+for root, dirs, files in os.walk(_tzinfo_dir):
+ for exclude in "posix", "right":
@@ -66,10 +76,11 @@
+ if file != "README" and file != "Theory" and "." not in file
+ )
+all_timezones.sort()
-
++
all_timezones_set = LazySet(all_timezones)
-common_timezones = LazyList(
- tz for tz in common_timezones if tz in all_timezones)
+-
+
+with open(os.path.join(_tzinfo_dir, "zone.tab")) as ztf:
+ common_timezones = [
@@ -88,5 +99,5 @@
+ "UTC",
+ ]
+common_timezones.sort()
-
++
common_timezones_set = LazySet(common_timezones)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-pytz.git/commitdiff/59ff09ed7604199cd1153f54c93cb771b5081f04
More information about the pld-cvs-commit
mailing list