I am using the Bumpversion utility (https://github.com/peritus/bumpversion) to increase the version of my application.
And I want to make dev
build - add a suffix to a regular version optionally.
With the current approach, I can't do bumpversion dev
- it says:
ValueError: The part has already the maximum value among ['dev'] and cannot be bumped.
[bumpversion]
current_version = 1.5.3
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(-(?P<dev>.*)-(?P<build>\d+))?
serialize =
{major}.{minor}.{patch}-{dev}-{build}
{major}.{minor}.{patch}
[bumpversion:part:dev]
values =
dev
[bumpversion:part:build]
first_value = 1
How to create dev-{build}
version optionally?
I was able to fix this on my end using
""
as the initial state ofdev
, as in:What appears to be happening is that since your part definition only contains one value, bumpversion presumes the part is already in that state and has nowhere to go.
Further evidenced in that you can set the initial state to anything. For instance this also works:
Fortunately, version bumps don't appear to be cyclical, so I don't think there's a way to ever get back to the
""
or13423423
state.