-
Notifications
You must be signed in to change notification settings - Fork 131
Open
Labels
Milestone
Description
For reproduction the repo luckydonald/pytgbot can be can be checked out at commit 2b35b5901df9d0aa6335d65bfca3dccf3477e8c9.
The config is quite easy,
[bumpversion]
current_version = 5.0.0
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)(\.(?P<patch>\d+)(\.(?P<internal>\d+))?)?
serialize =
{major}.{minor}.{patch}.{internal}
{major}.{minor}.{patch}
{major}.{minor}
[bumpversion:file:pytgbot/__init__.py]
[bumpversion:file:setup.py]
[bumpversion:file:README.md]If I now run
$ bump2version internalI'll end up with diffs like
- name='pytgbot', version="5.0.0",
+ name='pytgbot', version="5.0.0.1.0",For some reason it adds an unneeded .0 at the end, which it shouldn't.
Funnily enough, the version in the commit message, the .bumpversion file and the tag is correctly 5.0.0.1.
Why would a few of those do completely different things?
I see no reason how it can get that wrong:
>>> old_version = '5.0.0' # via config file
>>> new_version = '5.0.0.1' # git message shows it is able to calculate that properly
>>> input = "version=\"5.0.0\""
>>> output = input.replace(old_version, new_version) # replace 5.0.0 with 5.0.0.1
>>> output
'version="5.0.0.1"'
# now how would that say "5.0.0.1.0"?!?