digitalsleuth / time_decode

A timestamp and date decoder written for python 3
https://digitalsleuth.gitbook.io/time-decode-documentation/
MIT License
33 stars 8 forks source link

Version 8.0.0 adds pytz dependency which is deprecated #13

Open Enkelena opened 1 month ago

Enkelena commented 1 month ago

You recently added pytz as a dependency to release 8.0.0. Referring to https://github.com/pganssle/pytz-deprecation-shim "pytz has served the Python community well for many years, but it is no longer the best option for providing time zones. pytz has a non-standard interface that is very easy to misuse; this interface was necessary when pytz was created, because datetime had no way to represent ambiguous datetimes, but this was solved in Python 3.6, which added a fold attribute to datetimes in PEP 495. With the addition of the zoneinfo module in Python 3.9 (PEP 615), there has never been a better time to migrate away from pytz¨"

pytz is deprecated in Debian since Debian 10, therefore version 8.0.0 of time-decode can not be uploaded as is. I can patch the source code to use python3-pytz-deprecation-shim but would prefer to not have to patch it at all.

Could you consider to use the standard python3 functions instead of pytz?

digitalsleuth commented 1 month ago

Hi @Enkelena , thanks for reaching out! Yes, pytz is deprecated for Python 3.9 and above, however it is still being used and maintained for lower versions of python, such as 3.8 which is the default in Ubuntu 20.04 LTS. Given that this LTS is supported for another year, I opted to add pytz momentarily. I am adding an update shortly which will use ZoneInfo as well, as it was added to the base library in 3.9.

The installation process will then determine the running version of python and install / change the requirements accordingly. I've been a bit busy the last couple of days, but hope to have this released in the next 24 hours.

Cheers!

digitalsleuth commented 1 month ago

Hi @Enkelena , just wanted to give you a heads up that I've made some updates to the tool, but haven't completed unit tests on the changes. I'm incorporating a way to only require pytz if the OS doesn't support the native zoneinfo. It's in the branch pytz_replace, but it is not ready for release.

I know I said 24 hours, but unfortunately things have been a bit busy this week. I am going on vacation in the morning, but I will get to this as soon as I can.

Cheers

Enkelena commented 1 month ago

Hi @digitalsleuth thanks for letting me know. Enjoy your holiday! Thanks for starting to work on it, I will wait for your release.