API for Moving to Final Releases
See original GitHub issue(Disclaimer: this is certainly something that could be “self-rolled” from what is already exposed by python-semver
, but it seems like a useful API to provide)
To my knowledge, there is a gap in the bump_*
family of functions. Consider the version v = 1.2.3-rc.4+build.5
:
bump_major(v) -> 2.0.0
bump_minor(v) -> 1.3.0
bump_patch(v) -> 1.2.4
bump_prerelease(v) -> 1.2.3-rc.5
bump_build(v) -> 1.2.3-rc.4+build.6
What I think would be useful is something along the lines of a finalize_version
function, which would convert both 1.2.3
and 1.2.3-rc.4+build.5
into 1.2.3
(i.e. the corresponding final version). Alternatively, if we want to look at node-semver
as inspiration, the behavior of bump_patch
could be changed such that 1.2.3-rc.4
would bump to 1.2.3
, while 1.2.3
would bump to 1.2.4
. The intuition is that, since the spec says that these final versions are greater than the prerelease builds, it would make sense to be able to “bump” to them.
Would you agree that this is worth adding?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
‘finalize_version’ makes more sense to me
@belph thank you! Released under 2.7.9 https://pypi.python.org/pypi/semver