requests icon indicating copy to clipboard operation
requests copied to clipboard

Ignore Local Version in Compatibility Check

Open bryanfraschetti opened this issue 3 months ago • 1 comments

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

bryanfraschetti avatar Sep 22 '25 18:09 bryanfraschetti

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 avatar Sep 22 '25 19:09 bryanfraschetti