From a8431f079745267e8f76c1ecfe11f0b88c5412a7 Mon Sep 17 00:00:00 2001 From: Richard Shadrach Date: Thu, 11 Dec 2025 16:43:57 -0500 Subject: [PATCH] DEP: Remove tzdata as a hard dependency outside of Windows --- README.md | 2 +- doc/source/getting_started/install.rst | 4 +++- doc/source/whatsnew/v3.0.0.rst | 2 -- pandas/_libs/tslibs/timezones.pyx | 3 --- pyproject.toml | 2 +- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c6e0a4b319930..407985b197e5e 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ details, see the commit logs at https://github.com/pandas-dev/pandas. ## Dependencies - [NumPy - Adds support for large, multi-dimensional arrays, matrices and high-level mathematical functions to operate on these arrays](https://www.numpy.org) - [python-dateutil - Provides powerful extensions to the standard datetime module](https://dateutil.readthedocs.io/en/stable/index.html) -- [tzdata - Provides an IANA time zone database](https://tzdata.readthedocs.io/en/latest/) +- [tzdata - Provides an IANA time zone database](https://tzdata.readthedocs.io/en/latest/) (Only required on Windows) See the [full installation instructions](https://pandas.pydata.org/pandas-docs/stable/install.html#dependencies) for minimum supported versions of required, recommended and optional dependencies. diff --git a/doc/source/getting_started/install.rst b/doc/source/getting_started/install.rst index bb3290e18e26b..ed92eecf67208 100644 --- a/doc/source/getting_started/install.rst +++ b/doc/source/getting_started/install.rst @@ -150,11 +150,13 @@ Package Minimum support ================================================================ ========================== `NumPy `__ 1.26.0 `python-dateutil `__ 2.8.2 -`tzdata `__ 2023.3 +*`tzdata `__ 2023.3 ================================================================ ========================== Generally, the minimum supported version is ~2 years old from the release date of a major or minor pandas version. +* ``tzdata`` is only required on Windows. + .. _install.optional_dependencies: Optional dependencies diff --git a/doc/source/whatsnew/v3.0.0.rst b/doc/source/whatsnew/v3.0.0.rst index bebd928924214..33ddd7243ab67 100644 --- a/doc/source/whatsnew/v3.0.0.rst +++ b/doc/source/whatsnew/v3.0.0.rst @@ -657,8 +657,6 @@ The following required dependencies were updated: +=================+======================+ | numpy | 1.26.0 | +-----------------+----------------------+ -| tzdata | 2023.3 | -+-----------------+----------------------+ For `optional libraries `_ the general recommendation is to use the latest version. The following table lists the lowest version per library that is currently being tested throughout the development of pandas. diff --git a/pandas/_libs/tslibs/timezones.pyx b/pandas/_libs/tslibs/timezones.pyx index b02ddbcaf18e9..8218c5196e0c0 100644 --- a/pandas/_libs/tslibs/timezones.pyx +++ b/pandas/_libs/tslibs/timezones.pyx @@ -59,9 +59,6 @@ cdef bint is_utc_zoneinfo(tzinfo tz): utc_zoneinfo = zoneinfo.ZoneInfo("UTC") except zoneinfo.ZoneInfoNotFoundError: return False - # Warn if tzdata is too old, even if there is a system tzdata to alert - # users about the mismatch between local/system tzdata - import_optional_dependency("tzdata", errors="warn", min_version="2022.7") return tz is utc_zoneinfo diff --git a/pyproject.toml b/pyproject.toml index cd151ad7bbe27..d085a6991fedf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ requires-python = '>=3.11' dependencies = [ "numpy>=1.26.0", "python-dateutil>=2.8.2", - "tzdata>=2023.3" + "tzdata>=2023.3; platform_system == 'Windows'", ] classifiers = [ 'Development Status :: 5 - Production/Stable',