Open itamarst opened 8 years ago
I agree. In setup.py I have
VERSION = '0.1.74'
After some trial-and-error I got the following .bumpversion.cfg
stanza to work. The documentation was misleading.
[bumpversion:file:setup.py]
search = VERSION \= '{current_version}'
replace = {new_version}
As a counterexample, this works as expected for me (global settings, not for a single file):
[bumpversion]
...
search = MYPROJECT_VERSION = '{current_version}'
replace = MYPROJECT_VERSION = '{new_version}'
Python 2.7.13, bumpversion 0.5.3
I just found this to be the case (0.5.3 under Python 3.6.4) in some situations. With my current config it happens when the current version is 0.2.0
but not when it is something 0.2.1.dev0
. This is the config:
[bumpversion]
current_version = 0.2.0
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(?:\.(?P<release>[a-z]+)(?P<release_number>\d+))?
serialize =
{major}.{minor}.{patch}.{release}{release_number}
{major}.{minor}.{patch}
[bumpversion:part:release]
optional_value = gamma
values =
dev
rc
gamma
[bumpversion:part:release_number]
[bumpversion:file:config/__init__.py]
search = __version__ = '{current_version}'
replace = {new_version}
The example given in docs is:
However that will result in a line
MyProject==MyProject==1.2.3
.