Closed jbweston closed 4 years ago
It seems bump2version uses RawConfigParser
for the .bumpversion.cfg
file, and uses regular ConfigParser
for setup.cfg
. Regardless of the reason, it must remain that way for backwards compatibility.
E.g. in setup.cfg
values you have to escape %
to %%
, whereas in .bumpversion.cfg
that's not necessary.
Perhaps it's an option to move your configuration to setup.cfg
?
Ideally I would have preferred to keep the config for bumpversion in it's own file, but if this won't be changed then I'll make do.
Thanks!
@jbweston I had the same use case as you but couldn't get it working. I am getting:
TypeError: __init__() got an unexpected keyword argument 'h2'
@FlorianLudwig Are you doing this in setup.cfg
? Because it can't work in .bumpversion.cfg
.
@florisla yes
I am trying to use bump2version to replace a section in a markdown-formatted changelog file when the version is bumped. I want to make the following change:
goes to
I have added the following section to
.bumpversion.cfg
:This does not work because the final line is interpreted as a comment. The
configparser
docs note that this is a possibility in the following sentence:The only way to avoid this is to use a interpolation in
.bumpversion.cfg
like:However
bump2version
uses aRawConfigParser
, and variable substitution is disabled.Is there a particular reason to use a
RawConfigParser
overConfigParser
? As far as I understand theConfigParser
's interpolation would not clash with the value interpolation thatbump2version
uses later because the syntaxes are different (%(...)
and${...}
vs{...}
).