From 904c528b48dbe333ad561b89f5f2c2f881bb0d44 Mon Sep 17 00:00:00 2001 From: Tomas Roun Date: Mon, 16 Nov 2026 22:42:26 +0100 Subject: [PATCH] Install tzdata on windows --- docs/installation.rst | 5 +++++ pyproject.toml | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/installation.rst b/docs/installation.rst index bdb6d2371..3f5dd8e6a 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -7,6 +7,11 @@ Babel is distributed as a standard Python package fully set up with all the dependencies it needs. Timezone support uses the standard library `zoneinfo`_ module which reads the system's timezone database. +On Windows, which has no system timezone database available, the `tzdata`_ +package is installed as a dependency to provide the data for `zoneinfo`_. + +.. _tzdata: https://pypi.org/project/tzdata/ + .. _zoneinfo: https://docs.python.org/3/library/zoneinfo.html .. _virtualenv: diff --git a/pyproject.toml b/pyproject.toml index a5453c6d1..c0b8abdb8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,6 +10,10 @@ readme = "README.rst" license = "BSD-3-Clause" license-files = ["LICENSE"] requires-python = ">=3.9" +dependencies = [ + # Windows has no system timezone database for `zoneinfo` to read + "tzdata; sys_platform == 'win32'", +] authors = [ { name = "Armin Ronacher", email = "armin.ronacher@active-4.com" }, ] @@ -46,7 +50,6 @@ dev = [ "pytest>=6.0", "pytz", "setuptools", - "tzdata;sys_platform == 'win32'", ] [project.urls]