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

Infra: Replace deprecated utcnow and utcfromtimestamp #3148

Merged
merged 3 commits into from
May 18, 2023

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented May 16, 2023

datetime.datetime.utcnow and datetime.datetime.utcfromtimestamp raise deprecation warnings in Python 3.12: python/cpython#103857.

datetime.UTC is a (new in 3.11) alias of the older datetime.timezone.utc, but I think we want to keep support for older versions here, to make things easier for PEP authors.

https://docs.python.org/3/library/datetime.html#datetime.UTC


📚 Documentation preview 📚: https://pep-previews--3148.org.readthedocs.build/

@hugovk hugovk requested a review from AA-Turner as a code owner May 16, 2023 18:53
@Rosuav
Copy link
Contributor

Rosuav commented May 16, 2023

Nice. Do we know what minimum Python version we're targeting for building PEPs? IMO it wouldn't be a problem to demand a semi-current version, since the small number of people for whom Python X.Y isn't easily available can still post PRs (they'll just have to wait for CI before knowing that the PEP built correctly).

@Mariatta
Copy link
Member

Seems like we need 3.11+

@hugovk
Copy link
Member Author

hugovk commented May 17, 2023

Python 3.9 is the minimum tested on the CI, because we use some type annotations not available on 3.8 and earlier.

@hugovk hugovk changed the title Replace deprecated utcnow and utcfromtimestamp Infra: Replace deprecated utcnow and utcfromtimestamp May 17, 2023
@hugovk hugovk added the infra Core infrastructure for building and rendering PEPs label May 17, 2023
@AA-Turner AA-Turner merged commit 9d6e5b6 into python:main May 18, 2023
@hugovk hugovk deleted the replace-deprecated-utcnow branch May 18, 2023 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infra Core infrastructure for building and rendering PEPs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants