Open RonZhang724 opened 4 years ago
Hi, same problem here. I tried to setup a release-candidate workflow:
[bumpversion]
current_version = 2.0.0-rc1
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(-(?P<release>rc)(?P<rc>\d+))?
serialize =
{major}.{minor}.{patch}-{release}{rc}
{major}.{minor}.{patch}-rc{rc}
{major}.{minor}.{patch}
[bumpversion:part:release]
optional_value = release
first_value = rc
values =
rc
release
Your build
part is my rc
part. Seems it works since:
bump2version rc --list --dry-run --current-version 2.0.0 --allow-dirty
new_version = 2.0.0-rc1
bump2version rc --list --dry-run --current-version 2.0.0-rc1 --allow-dirty
new_version = 2.0.0-rc2
bump2version release --list --dry-run --current-version 2.0.0-rc1 --allow-dirty
new_version = 2.0.0
bump2version release --list --dry-run --current-version 2.0.0 --allow-dirty
ValueError: The part has already the maximum value among ['rc', 'release'] and cannot be bumped.
Hope this will help.
Hi, @RonZhang724 , I guess 0.0.0
translates to 0.0.0-prod0
which is greater than 0.0.0-dev1
, hence "going up" here wouldn't make sense.
I believe bump2version build
over 0.0.0-prod0
would produce 0.0.0-prod1
, not sure why you got this leading zero in 0.0.0-01
, maybe it has to do with prod
being optional.
Hi, @mtusseau, in your case 2.0.0
would translate to 2.0.0-release0
so when you try to bump2version release
over 2.0.0-release0
the word release is already the max value for the release part, so that you are not able to bump it. You can only bump2version release
over a "cr release".
@RonZhang724 It's true that you can't go from 0.0.0
(with release
being prod
) to 0.0.0-dev1
.
It's definitely a bug that 0.0.0-prod1
shows up as 0.0.0-01
.
I have the following .bumpversion.cfg: whenever I run
bump2version build
, the new_version becomes0.0.0-01
Is there a way for the first build to become0.0.0-dev1
?