Skip to content

Conversation

@spillner
Copy link
Contributor

@spillner spillner commented Oct 8, 2024

Pytz no longer supports the latest Python releases, and not much of it was actually used by OWSLib anyway.

Recreated the previous PR #921 to permit branching my source repository, to better manage the rebase and elide false-positive merge conflicts reported by GitHub.

@coveralls
Copy link

coveralls commented Oct 8, 2024

Coverage Status

coverage: 60.113% (-0.02%) from 60.128%
when pulling 5e8f39a on spillner:remove-pytz
into d4e7080 on geopython:master.

@geographika
Copy link
Contributor

Thanks @spillner for updating the pull request.
Would it be possible to add a very simple test to test_util.py to parse a date using the new TimeZone_UTC class and check the output?

I'm +1 on merging once that is in place.

@geographika
Copy link
Contributor

Tested the branch locally - all working as expected:

>>> import pytz
>>> from datetime import datetime, timedelta
>>> dt = datetime.utcnow()
>>> dt.replace(tzinfo=pytz.utc)
datetime.datetime(2024, 10, 8, 10, 7, 59, 167706, tzinfo=<UTC>)
>>> from owslib.util import TimeZone_UTC
>>> datetime.utcnow().replace(tzinfo=TimeZone_UTC())
datetime.datetime(2024, 10, 8, 10, 9, 31, 262084, tzinfo=<owslib.util.TimeZone_UTC object at 0x0000015D9D187CD0>)

@spillner
Copy link
Contributor Author

Added two unit tests, one for datetime normalization as a standalone operation, and one for proper operation of extract_time() as a whole.

I also took advantage of the shift to 3.10 and newer to drop the TimeZone_UTC class in favor of the standard datetime.timezone.utc. If anyone needs to restore support for 3.8 and earlier, you could just roll back the very last commit in this series.

@geographika
Copy link
Contributor

@spillner - thanks very much for this. Removing a dependency and being able to use the standard library is excellent.

@geographika geographika merged commit 40b9fe0 into geopython:master Oct 14, 2024
3 checks passed
@spillner spillner deleted the remove-pytz branch November 5, 2024 13:31
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.

3 participants