Closed philipsd6 closed 8 years ago
Hmpf, that's unfortunate.
Bumpversion uses ConfigParser to read and write the config files (and appearently that process doesn't support keeping comments where they were before), at least to my knowledge.
I can't promise that bumpversion will ever support that (unless ConfigParser starts supporting this), but it's good that you found the workaround.
I have looked into this issue a bit. This issue and possibly #78 can be fixed with refactoring out the config part out of main function and swapping ConfigParser with configobj. Working on it.
refactoring out the config part out of main function and swapping ConfigParser with configobj
Would swapping the main dependency (at it's heart bumpversion is just config parsing, not much more) mean it stays backwards compatible ?
Also thanks for pointing me to configobj, I didn't know that library :)
Would swapping the main dependency (at it's heart bumpversion is just config parsing, not much more) mean it stays backwards compatible ?
Good point, configobj would be perfect but they do not support lists notation used by setup.cfg and bumpversion.cfg. Dependency swap was relatively easy solution as long as the tool supports same features as ConfigParser. So configobj is out.
However config related logic has to be moved and abstracted so in future it is easier to fix any config read/write issues, like this one, and any dependency changes would be much easier and safer.
I have to admit the tests are very useful. Didn't feel quite confident with them at first, right now I know exactly where I was wrong. Nice.
Sorry, I don't think bumpversion will support this anytime soon.
Perhaps you can file a bug with configparser and bumpversion will (eventually) inherit this feature from there ?
A workaround might be to use a .bumpversion.cfg
will without comments that bumpversion is allowed to mess with and keep your well-commented setup.cfg
just for all things that are not about bumpversion.
Thanks for posting the workaround. I was also trying to consolidate the many test/build/deploy-related files in my repository a bit.
I see that bumpversion
wants to stick to using ConfigParser, and that's cool. Though when I look at it, bumpversion
right now is using different mechanisms for updating the version string in the config file vs. in source code files (ConfigParser for one, the parsing mechanism for the other).
I for one wouldn't blame the maintainers as introducing any inconsistencies ;) (rather remove one!) if bumpversion
would use ConfigParser only for reading its own config, and would use the same parsing mechanism for updating the version string in all files. Opinions?
That comment is used by my CI tool -- on pull requests, it uncomments it to build a dev package. If bumpversion deletes it, it breaks the process.
For now, I'm switching back to using
bumpversion.cfg
, but I was hoping to consolidate this insetup.cfg