version: fix "next_" methods and increase test coverage #434
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes and tests for
next_major()
,next_minor()
, etc.Fixed bugs:
1.post1.dev0
should be2
instead of1
, analogous: minor, patch, etc.next_patch
for versions with more than 3 parts did not worknext_prerelease
for non pre releases due to its ambiguity and because the current implementation is just wrong for most cases (next pre release of1.2
is not1.2a0
)next_devrelease
for non dev releases due to its ambiguity and because the current implementation is just wrong for most cases (next dev release of1.2
is not1.2.dev0
)first_devrelease
analogous tofirst_prerelease
One could argue that the next pre release can be determined by incrementing the last part of the version, so e.g. (
1
->2a0
,1.2
->1.3a0
). But it might be better to be explicit. (The next pre release of1.2
could also be2.0a0
for example depending on the release plan.)