From 1caba107dcf66785d5cb26df3fdbe749ed3380c5 Mon Sep 17 00:00:00 2001 From: ringsaturn Date: Sun, 15 Sep 2024 22:51:35 +0800 Subject: [PATCH] add tzdata option (#68) --- pyproject.toml | 1 + requirements_dev.txt | 1 + tests/test_compatibility.py | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index be1c741..8ec6e8c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,7 @@ requires-python = ">=3.8" [project.optional-dependencies] pytz = ["pytz>=2024.2"] +tzdata = ["tzdata>=2024.1"] [project.urls] Documentation = "https://github.com/ringsaturn/tzfpy" diff --git a/requirements_dev.txt b/requirements_dev.txt index e856424..390efe0 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -5,3 +5,4 @@ pytest-benchmark pytest-cov pytest-pretty pytz==2024.2 +tzdata==2024.1 diff --git a/tests/test_compatibility.py b/tests/test_compatibility.py index 42d63de..daf7531 100644 --- a/tests/test_compatibility.py +++ b/tests/test_compatibility.py @@ -12,6 +12,12 @@ def test_with_pytz(self): for tz in timezonenames(): timezone(tz) + def test_with_tzdata(self): + from zoneinfo import ZoneInfo + + for tz in timezonenames(): + ZoneInfo(tz) + def test_no_empty(self): for city in all_cities(): tznames = get_tzs(city.lng, city.lat)