rbarrois / python-semanticversion

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

semantic_version.validate incorrectly processes x.x.x.x #94

Closed ShamanTcler closed 4 years ago

ShamanTcler commented 4 years ago

print("is 15.0.7.287 a sematic version:", semantic_version.validate('15.0.7.287'))

returns: is 15.0.7.287 a sematic version: False

But yet the doc supports "build":

v = semantic_version.Version('0.1.1') v.major 0 v.minor 1 v.patch 1 v.prerelease [] v.build []

Thanks for the good work.

rbarrois commented 4 years ago

15.0.7.287 is not a valid semantic version identifier; the syntax is <major>.<minor>.<build>[-<prerel>][+<build>].

15.0.7+287 would be a valid semantic version identifier, equivalent to Version(major=15, minor=0, patch=7, build=['287']).