regebro / tzlocal

A Python module that tries to figure out what your local timezone is
MIT License
184 stars 58 forks source link

Added tzdata as a Windows test dependency #100

Closed agronholm closed 3 years ago

agronholm commented 3 years ago

It seems to pass on Windows now – the failed runs were due to some internal oddity in Github Actions where the jobs never actually started.

agronholm commented 3 years ago

As the repo owner you can manually restart the test run if you like.

agronholm commented 3 years ago

The only remaining question here is whether to include tzdata as a hard dependency on Windows or not. It may be prudent to do so. @pganssle thoughts?

regebro commented 3 years ago

My windows machine is in a corner now, so I can't check at the moment. But if it's not normally included on Windows we should add it.

The discussion as I remember it, years ago, was to not include it in Linux, and by default rely on the OS own copy, but include it by default in Windows. I might misremember, or it might not have happened.

agronholm commented 3 years ago

Ok, it's an install dep on Windows now.

pganssle commented 3 years ago

You can either make it a Windows-specific dependency or an unconditional dependency, I don't think it matters much.

Ideally, we would make it an optional dependency (one that you can opt-out of), because including it is a reasonable default, but there are many common situations where you would need it.

The tzdata package is only used if it can't find the system data. I've suggested in PEP 615 that starting in 3.9, distributors should make system tzdata a dependency for Python, but I am not sure that you can say that even on Linux you are universally guaranteed to have system time zone data available (in which case you'd want to depend on tzdata).

So I'd say the best options are something like:

  1. Dependency only on Windows.
  2. Hard and unconditional dependency.
  3. Hard dependency on Windows, [tzdata] extra on all other platforms.
  4. [tzdata] extra, no hard dependency on Windows (though this is the least desirable option).
regebro commented 3 years ago

We don't want tzdata on other operating systems, because that means it gets installed, and then people don't update it, so it gets out of date.

So it can only be a dependency on Windows.