Skip to content

Commit 2e95cec

Browse files
Danipulokzzzeek
authored andcommitted
fix(requirements): add tzdata to tz extras; fixes #1556
Add `tzdata` to `tz` extras, since `zoneinfo` on its own does not contain any timezones. Fixes: #1556 Closes: #1558 Pull-request: #1558 Pull-request-sha: 9c60d7c Change-Id: Ibf6d863a7cd277c6abffcf2853f452a5b16c5fd5
1 parent b6b44c1 commit 2e95cec

File tree

6 files changed

+14
-7
lines changed

6 files changed

+14
-7
lines changed

alembic/templates/async/alembic.ini.mako

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ prepend_sys_path = .
1515

1616
# timezone to use when rendering the date within the migration file
1717
# as well as the filename.
18-
# If specified, requires the python>=3.9 or backports.zoneinfo library.
18+
# If specified, requires the python>=3.9 or backports.zoneinfo library and tzdata library.
1919
# Any required deps can installed by adding `alembic[tz]` to the pip requirements
2020
# string value is passed to ZoneInfo()
2121
# leave blank for localtime

alembic/templates/generic/alembic.ini.mako

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ prepend_sys_path = .
1717

1818
# timezone to use when rendering the date within the migration file
1919
# as well as the filename.
20-
# If specified, requires the python>=3.9 or backports.zoneinfo library.
20+
# If specified, requires the python>=3.9 or backports.zoneinfo library and tzdata library.
2121
# Any required deps can installed by adding `alembic[tz]` to the pip requirements
2222
# string value is passed to ZoneInfo()
2323
# leave blank for localtime

alembic/templates/multidb/alembic.ini.mako

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ prepend_sys_path = .
1717

1818
# timezone to use when rendering the date within the migration file
1919
# as well as the filename.
20-
# If specified, requires the python>=3.9 or backports.zoneinfo library.
20+
# If specified, requires the python>=3.9 or backports.zoneinfo library and tzdata library.
2121
# Any required deps can installed by adding `alembic[tz]` to the pip requirements
2222
# string value is passed to ZoneInfo()
2323
# leave blank for localtime

docs/build/tutorial.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ The file generated with the "generic" configuration looks like::
141141

142142
# timezone to use when rendering the date within the migration file
143143
# as well as the filename.
144-
# If specified, requires the python>=3.9 or backports.zoneinfo library.
144+
# If specified, requires the python>=3.9 or backports.zoneinfo library and tzdata library.
145145
# Any required deps can installed by adding `alembic[tz]` to the pip requirements
146146
# string value is passed to ZoneInfo()
147147
# leave blank for localtime
@@ -299,9 +299,9 @@ This file contains the following features:
299299
* ``timezone`` - an optional timezone name (e.g. ``UTC``, ``EST5EDT``, etc.)
300300
that will be applied to the timestamp which renders inside the migration
301301
file's comment as well as within the filename. This option requires Python>=3.9
302-
or installing the ``backports.zoneinfo`` library. If ``timezone`` is specified,
303-
the create date object is no longer derived from ``datetime.datetime.now()``
304-
and is instead generated as::
302+
or installing the ``backports.zoneinfo`` library and the ``tzdata`` library.
303+
If ``timezone`` is specified, the create date object is no longer derived
304+
from ``datetime.datetime.now()`` and is instead generated as::
305305

306306
datetime.datetime.utcnow().replace(
307307
tzinfo=datetime.timezone.utc

docs/build/unreleased/1556.rst

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. change::
2+
:tags: bug, environment
3+
:tickets: 1556
4+
5+
Added `tzdata` to `tz` extras, which is required on some platforms such as
6+
Windows. Pull request courtesy Danipulok.

setup.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ install_requires =
4949
[options.extras_require]
5050
tz =
5151
backports.zoneinfo;python_version<"3.9"
52+
tzdata
5253

5354
[options.package_data]
5455
alembic = *.pyi, py.typed

0 commit comments

Comments
 (0)