Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove direct dependency on tzdata #805

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ classifiers = [

dependencies = [
"python-dateutil>=2.6",
"tzdata>=2020.1",
'backports.zoneinfo>=0.2.1; python_version < "3.9"',
'time-machine>=2.6.0; implementation_name != "pypy"',
'importlib-resources>=5.9.0; python_version < "3.9"'
Expand Down Expand Up @@ -50,7 +49,6 @@ python = ">=3.8"
python-dateutil = ">=2.6"
"backports.zoneinfo" = { version = ">=0.2.1", python = "<3.9" }
time-machine = { version = ">=2.6.0", markers = "implementation_name != 'pypy'", optional = true }
tzdata = ">=2020.1"
importlib-resources = { version = ">=5.9.0", python = "<3.9" }

[tool.poetry.group.test.dependencies]
Expand Down
8 changes: 2 additions & 6 deletions src/pendulum/tz/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
from __future__ import annotations

from pathlib import Path
from typing import cast

from pendulum.tz.local_timezone import get_local_timezone
from pendulum.tz.local_timezone import set_local_timezone
from pendulum.tz.local_timezone import test_local_timezone
from pendulum.tz.timezone import UTC
from pendulum.tz.timezone import FixedTimezone
from pendulum.tz.timezone import Timezone
from pendulum.utils._compat import resources
from pendulum.utils._zoneinfo import available_timezones


PRE_TRANSITION = "pre"
Expand All @@ -25,8 +22,7 @@ def timezones() -> tuple[str, ...]:
global _timezones

if _timezones is None:
with cast(Path, resources.files("tzdata").joinpath("zones")).open() as f:
_timezones = tuple(tz.strip() for tz in f.readlines())
_timezones = tuple(available_timezones())

return _timezones

Expand Down
Loading