Open JonZeolla opened 3 years ago
The inconsistency is caused by several non-intuitive factors here.
First, you can't really add setup.cfg
as a bumpversion:file
.
Setup.cfg contains your bump2version configuration, and bump2version will maintain the version
value there. So you can drop this line from your config: [bumpversion:file:setup.cfg]
and nothing will change.
Next, you don't have a custom parse
expression in your config to accept the -dirty
suffix. So it's not properly recognized -- actually bump2version should raise an error.
Your new version becomes 8.0.0
without any suffix, so that's what's being written to the setup.cfg
file.
And finally, bump2version's replacement does not check for word boundaries. So it finds the string 0,7.1
in 0.7.1-dirty
and replaces only the 0.7.1
section with 8.0.0
. It leaves the -dirty
suffix untouched.
Side note: you can drop the pylint: disable=unused-argument
in your tasks file by adding a leading underscore to the c
argument.
@florisla thank you for the explanation. If you'd like I can leave this open, but I'm also fine to close it.
I have a fairly basic
bumpversion
setup for a project using SemVer (seisollc/easy_infra#79). I noticed that thecommit_message
from the config does not seem to be honored, and the resulting commit was inconsistent, where one file's version kept a-dirty
append, but another file did not. Both issues were consistent between running it withpipenv run invoke release minor
andbumpversion minor
at the CLI (macOS w/zsh)Here is my
setup.cfg
:The inconsistent commit:
This is a simplified version of how I'm running it, detailed in the PR linked above: