details: https://code.tryton.org/tryton/commit/4e0b720d156d
branch: default
user: Cédric Krier <[email protected]>
date: Tue Apr 28 19:32:51 2026 +0200
description:
Remove dependency to pytz and backports.entry-points-selectable
diffstat:
trytond/pyproject.toml | 2 --
trytond/trytond/tools/timezone.py | 19 ++++---------------
2 files changed, 4 insertions(+), 17 deletions(-)
diffs (55 lines):
diff -r 16e7591b9ec5 -r 4e0b720d156d trytond/pyproject.toml
--- a/trytond/pyproject.toml Fri Apr 24 18:26:48 2026 +0200
+++ b/trytond/pyproject.toml Tue Apr 28 19:32:51 2026 +0200
@@ -7,14 +7,12 @@
dynamic = ['version', 'authors', 'readme']
dependencies = [
'Genshi',
- 'backports.entry-points-selectable; python_version < "3.10"',
'defusedxml',
'lxml >= 2.0',
'polib',
'pwdlib[argon2] >= 0.2',
'python-dateutil',
'python-sql >= 1.8',
- 'pytz; python_version < "3.9"',
'relatorio[fodt] >= 0.7.0',
'simpleeval',
'werkzeug >= 0.12',
diff -r 16e7591b9ec5 -r 4e0b720d156d trytond/trytond/tools/timezone.py
--- a/trytond/trytond/tools/timezone.py Fri Apr 24 18:26:48 2026 +0200
+++ b/trytond/trytond/tools/timezone.py Tue Apr 28 19:32:51 2026 +0200
@@ -2,18 +2,10 @@
# this repository contains the full copyright notices and license terms.
import logging
import os
+import zoneinfo
-try:
- import zoneinfo
- ZoneInfo = zoneinfo.ZoneInfo
- ZoneInfoNotFoundError = zoneinfo.ZoneInfoNotFoundError
-except ImportError:
- zoneinfo = None
- import pytz
- from dateutil.tz import gettz as ZoneInfo
-
- class ZoneInfoNotFoundError(KeyError):
- pass
+ZoneInfo = zoneinfo.ZoneInfo
+ZoneInfoNotFoundError = zoneinfo.ZoneInfoNotFoundError
__all__ = ['SERVER', 'UTC', 'get_tzinfo', 'available_timezones']
logger = logging.getLogger(__name__)
@@ -24,10 +16,7 @@
global _ALL_ZONES
if not _ALL_ZONES:
- if zoneinfo:
- _ALL_ZONES = zoneinfo.available_timezones()
- else:
- _ALL_ZONES = set(pytz.all_timezones)
+ _ALL_ZONES = zoneinfo.available_timezones()
return set(_ALL_ZONES)