Skip to content

Conversation

abravalheri
Copy link
Contributor

Motivation

I noticed recently that setuptools-scm code seem to use UTC in some places: https://github.com/pypa/setuptools_scm/blob/088c652ec755f0982b3705272a1e6aa3e07c71ef/src/setuptools_scm/version.py#L116

but the local date in others: https://github.com/pypa/setuptools_scm/blob/088c652ec755f0982b3705272a1e6aa3e07c71ef/src/setuptools_scm/version.py#L336

Changes proposed in this PR:

  • Change datetime.date.today() to its UTC version.
  • Replace utcnow and utcfromtimestamp with explicit timezone.utc. This change is advised by Python's official documentation: Ref1, Ref2

@abravalheri abravalheri marked this pull request as ready for review January 17, 2022 18:37
@RonnyPfannschmidt RonnyPfannschmidt merged commit 8b94ead into pypa:main Jan 17, 2022
@abravalheri abravalheri deleted the improve-datetime-utc branch January 17, 2022 19: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.

2 participants