python-semanticversion
python-semanticversion copied to clipboard
Select version excluding prerelease
I would like to filter and match 'best' stable version.
Current behavior:
versions = [1.0.0, 1.1.0, 1.2.0-pre]
s = Spec(">=1.0.0")
s.select(versions)
Out: Version('1.2.0-pre')
I would expect pre-releases to be exclude unless explicitly ask for.
Expected behavior:
s = Spec(">=1.0.0-") # with a '-'
s.select(versions)
Out: Version('1.2.0-pre')
s = Spec(">=1.0.0")
Out: Version('1.1.0')
For now, semantic-version only handles what it's given.
What kind of API would you expect here, ideally without breaking the current behavior?
whitout breaking api what about:
s = Spec(">=1.0.0", stableonly=True) # with stableonly set to False by default
I think this is a bug. Certainly, as a new user of this library, I expected >=0.0.0 to include only stable versions, as that is what most other implementations do in my experience. I expected to have to specify >=0.0.0-0 to get prerelease versions.