marshmallow-code / marshmallow

A lightweight library for converting complex objects to and from simple Python datatypes.
https://marshmallow.readthedocs.io/
MIT License
6.99k stars 624 forks source link

RFE: use `zoneinfo` instead of `pytz` #2273

Open kloczek opened 3 months ago

kloczek commented 3 months ago

Switch to standard zoneinfo module. Below may help https://github.com/pydantic/pydantic-core/commit/fd262933

[tkloczko@pers-jacek marshmallow-3.21.2]$ grep -r pytz
.pre-commit-config.yaml:    additional_dependencies: [types-simplejson, types-pytz, packaging]
tests/base.py:import pytz
tests/base.py:central = pytz.timezone("America/Chicago")
pyproject.toml:tests = ["pytest", "pytz", "simplejson"]
sloria commented 3 months ago

fwiw pytz is only used for tests. i don't feel strongly about migrating to zoneinfo instead (esp since we're still supporting python 3.8) but i'd gladly review and merge a PR.

kloczek commented 3 months ago

In that patch is implemented fallback to 3.8 support. BTW 3.8 will be EOLed Oct this year.

sloria commented 3 months ago

i saw that. it meant: i'm slightly less keen on migrating until we drop 3.8 support. but the workaround to support 3.8 isn't too bad, so i'd still merge a PR before then