-
Notifications
You must be signed in to change notification settings - Fork 74
Closed
Labels
Status:CodeWelcomeThis feature design has been approved; next step: write the code!This feature design has been approved; next step: write the code!Topic:APIImprovements to the library APIImprovements to the library APITopic:SemVerIssues related to SemVer implementationIssues related to SemVer implementationType:Enhancement
Description
We're observing unstable sort in cases where versions only differ in their build.
>>> from semantic_version import Version
>>> v1 = Version("2.0.12+123")
>>> v2 = Version("2.0.12+1")
>>> v3 = Version("2.0.12+321")
>>> v4 = Version("2.0.12+22")
>>> sorted([v1,v2,v3,v4])
[Version('2.0.12+123'), Version('2.0.12+1'), Version('2.0.12+321'), Version('2.0.12+22')]
>>> sorted([v4,v2,v1,v3])
[Version('2.0.12+22'), Version('2.0.12+1'), Version('2.0.12+123'), Version('2.0.12+321')]
>>> sorted([v1,v2,v3,v4])
[Version('2.0.12+123'), Version('2.0.12+1'), Version('2.0.12+321'), Version('2.0.12+22')]
>>>This is due to Semver mandating that the versions differing only in their build must have the same precedence.
Nevertheless, we have an implementation in node which does consider build to yield a stable sorting.
Can we have something similar here?
Metadata
Metadata
Assignees
Labels
Status:CodeWelcomeThis feature design has been approved; next step: write the code!This feature design has been approved; next step: write the code!Topic:APIImprovements to the library APIImprovements to the library APITopic:SemVerIssues related to SemVer implementationIssues related to SemVer implementationType:Enhancement