You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Should the version be converted to 4.21.0-rc-2 instead of 4.21.0_rc_2?
The text was updated successfully, but these errors were encountered:
samuelmakarovskiy
changed the title
Should PyPI Purl Versions have _ replaced with - (like name)
Should PyPI Purl Versions have _ replaced with - (like Name)
Nov 1, 2023
The version should not be normalized the same a name is normalized IMHO. And things are likely more complex than this. Here is what the "packaging" library returns. This is the standard library to parse and normalize versions. This is not semver BTW.
>>> from packaging import version
>>> version.Version("4.21.0_rc_2")
<Version('4.21.0rc2')>
>>> version.Version("4.21.0-rc-2")
<Version('4.21.0rc2')>
>>> version.Version("4.21.0-rc2")
<Version('4.21.0rc2')>
In this code blob, seems PyPI purls have
_
replaced with-
in the name field. This is likely to align with the purlspec:https://github.com/package-url/purl-spec/blob/master/PURL-TYPES.rst#pypi
However, the wording here gives "name" as an example field where this replacement needs to happen.
For pre-release pypi purls like
pkg:pypi/[email protected]_rc_2
Should the version be converted to
4.21.0-rc-2
instead of4.21.0_rc_2
?The text was updated successfully, but these errors were encountered: