Skip to content

Conversation

bryanfraschetti
Copy link

According to PEP 440 guidelines, the local version identifier may use the period character, however, doing so causes the compatibility check to fail as the version parsing splits on periods and unpacks to the results assuming the string follows the major, minor, patch convention. Ignoring the local version string increases the likelihood that the assumption holds.

Closes: #7035

According to PEP 440 guidelines, the local version identifier may use the period
character, however, doing so causes the compatibility check to fail as the
version parsing splits on periods and unpacks to the results assuming the string
follows the major, minor, patch convention. Ignoring the local version string
increases the likelihood that the assumption holds.

Closes: psf#7035

Signed-off-by: Bryan Fraschetti <[email protected]>
@bryanfraschetti
Copy link
Author

bryanfraschetti commented Sep 22, 2025

Quick note to explain the version parsing that I am proposing, according to PEP 440, valid versions are <public_version_identifier>[+<local_version_identifier>]. I am proposing that we first split on "+", keep only the public version, and finally unpack to major, minor, patch. For the unpacking, I mimicked the logic that was later used for chardet and charset_normalizer version parsing, which is to take the first three elements of the .split(".") to ensure that the destructuring assignment has the correct number of elements.

@bryanfraschetti bryanfraschetti marked this pull request as ready for review September 25, 2025 14:12
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.

Warnings Produced when Using a PEP 440 Local Version

1 participant