peritus / bumpversion

Version-bump your software with a single command
https://pypi.python.org/pypi/bumpversion
MIT License
1.5k stars 148 forks source link

Problems with `search` and `replace` #140

Closed scolby33 closed 8 years ago

scolby33 commented 8 years ago

I'm having some trouble with the search and replace options, but as far as I can see I'm following the pattern used in other places on the web.

.bumpversion.cfg

[bumpversion]
current_version = 0.0.1
commit = False
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)((?P<release>.*))?
serialize =
    {major}.{minor}.{patch}{release}
    {major}.{minor}.{patch}

[bumpversion:file:docs/source/conf.py]
search = release = {current_version}
replace = release = {new_version}

[bumpversion:part:release]
optional_value = production
values =
    rc
    production

docs/source/conf.py

# *snip*
release = '0.0.1'
# *snip*
# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
#html_title = 'pushover_complete v0.0.1'

After running bumpversion patch, docs/source/conf.py becomes

# *snip*
release = 'release = 0.0.2rc'
# *snip*
# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
#html_title = 'pushover_complete vrelease = 0.0.2rc'

The expected result is

# *snip*
release = '0.0.2rc'
# *snip*
# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
#html_title = 'pushover_complete v0.0.1'

What am I doing wrong with these options?

scolby33 commented 8 years ago

I really dropped the ball on this one...I forgot some quotes:

.bumpversion.cfg

*snip*
[bumpversion:file:docs/source/conf.py]
search = release = '{current_version}'
replace = release = '{new_version}'
*snip*