Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use datetime functions from python standard lib #371

Merged
merged 8 commits into from
Feb 10, 2024

Conversation

ekuler
Copy link
Contributor

@ekuler ekuler commented Jan 4, 2024

The date handling functionality in Python std lib has been improved in Python 3 so we can take advantage of it and remove dependency on dateutil package.

This PR simplifies time zone handling for the various entry and group time values and creates time zone aware values everywhere.

Note that the parse function from dateutils is replaced by .fromisoformat() function from datetime class. However, this would raise the required Python version to 3.7. I believe this should be fine since 3.7 is quite old version and all major currently supported LTS Linux distributions are already on Python >=3.7.

If there is need to stay at Python 3.6, this can be rewritten in slightly more verbose way while still depending only on python standard library.

Using the strptime function now to stay compatible with Python 3.6 and to handle the time zone string .

@ekuler
Copy link
Contributor Author

ekuler commented Jan 5, 2024

Replaced the fromisoformat function with strptime. Turns out, prior to Python 3.11, fromisoformat won't parse string produced with isoformat when timezone is specified. With this change, it should be compatible all the way to 3.6 again.

@ekuler
Copy link
Contributor Author

ekuler commented Jan 8, 2024

The CI now just fails on lxml build for 3.11. This will be resolved when #351 gets merged.

@Evidlo Evidlo merged commit a2da685 into libkeepass:master Feb 10, 2024
5 of 6 checks passed
@Evidlo
Copy link
Member

Evidlo commented Feb 10, 2024

Thanks! It's always good to get rid of dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants