rbarrois / python-semanticversion

Semantic version comparison for Python (see http://semver.org/)
BSD 2-Clause "Simplified" License
281 stars 74 forks source link

Comparison with suffixes is just alphabetical #135

Closed jquentin-lion closed 2 years ago

jquentin-lion commented 2 years ago
>>> max(Version("1.1.1-rc10"), Version("1.1.1-rc9"))
Version('1.1.1-rc9')

It would probably make sense to behave the same as for the major, minor and patch here, for anything that matches "d+" in the suffix.

rbarrois commented 2 years ago

Sorry, that is not consistent with the semver specification:

Identifiers with letters or hyphens are compared lexically in ASCII sort order.