jannikmi / timezonefinder

python package for finding the timezone of any point on earth (coordinates) offline

Home Page:https://timezonefinder.michelfe.it/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lock pytz or tzdata version in requirements?

ringsaturn opened this issue · comments

Upstream may introduce breaking changes of timezone names, and downstream packages like pytz or tzdata's version should be locked to a specific version to ensure user could parse all timezone names to offset?

Related issues:

FYI: I tried to maintain a backport support like backports.go and I gave it up. Because some ecosystem, like Debian, may keep using too old version of IANA's tzdata for years, see Debian's tracker.

Thanks for bringing this up. Do you have any idea how the "locking" could be implemented?
pytz for example is not truly a dependency of timezonefinder, so requiring a certain version would automatically also install pytz even if unused.
perhaps an optional "extra" for pytz could pin its version without hardly requiring it.

Seems this extra feature is defined in PEP-0621:

[project.optional-dependencies]
test = [
  "pytest < 5.0.0",
  "pytest-cov[all]"
]

It also should be supported by Poetry, which is used in current timezonefinder.

I would like to open a PR for this, since tzfpy also need this feature to ensure compatibility with pytz or tzdata.

Great. Thanks! Let's also add a few words to the documentation, mentioning this extra and when it should be used (I can do this part)

@ringsaturn:

  • timezonefinder already has one extra numba, you can copy this approach:
    numba = ["numba"]
  • With the extra to pin the pytz compatibility, I am still unsure how one can easily keep track of the incompatibilities (breaking changes).