bumpversion
bumpversion copied to clipboard
Cannot replace with multiple lines
It seems that bumpversion doesn't work with multiline string.
Here is my CHANGELOG.md
:
## Unreleased ##
- xxxx
## 0.0.2 -- 2015-12-08 ##
- yyyy
And here is my .bumpversion.cfg
:
[bumpversion:file:CHANGELOG.md]
search = ## Unreleased ##
replace = ## Unreleased ##
## {new_version} - {utcnow:%Y-%m-%d} ##
After running bumpversion, the expected changelog is:
## Unreleased ##
## 0.0.3 -- 2015-12-09 ##
- xxxx
## 0.0.2 -- 2015-12-08 ##
- yyyy
But the actual content is:
## Unreleased ##
## 0.0.3 -- 2015-12-09 ##
- xxxx
## 0.0.2 -- 2015-12-08 ##
- yyyy
And .bumpversion.cfg
is changed:
[bumpversion:file:CHANGELOG.md]
search = ## Unreleased ##
replace = ## Unreleased ##
## {new_version} - {utcnow:%Y-%m-%d} ##
Bumpversion removes the empty line.
How to replace current version with multiline string?
This looks similar to #103, right ? I mean, the underlying issue seems to be the lack of proper multi-line support in parameters of bumpversion's own configuration blocks. There's probably a textwrap()
to add somewhere in bumpversion config parsing.
Yes, RawConfigParser
in py2 doesn't recognize empty lines in multiple lines.
Instead of wrapping RawConfigParser
, shall we switch to another parser, e.g., a toml parser?
It happens to me too.
The fact that you can use to drop directly the changelog the multiline with blank lines is mandatory for md and rst formats.
Heh, came here for exactly the same reason, trying to add my CHANGELOG release into versionbump...
Has anyone figured out a way to get that extra newline in there between the unreleased and the release?
Just in case this is helpful to someone that finds this:
- I figured out it works fine with no spacing if you use
rst
instead ofmd
. - You should put this in
.bumpversion.cfg
instead ofsetup.cfg
if you plan on building in python 3