Skip to content

Conversation

@albireox
Copy link

@albireox albireox commented Oct 5, 2019

I find a bit annoying that when you bumpversion the format of the configuration file changes because it's completely rewritten. This was mostly ok with a .bumpversion file, but now that I have moved the bumpversion configuration to setup.cfg it's worse. For example, I like to keep sections for different services separated by two empty lines, which are reduced to one when I bumpversion. This also affects #87.

I wonder if it's at all necessary to rewrite the whole config file every time you bump. It seems the only thing it changes in the file is that you bump the version of current_version, so the same thing could be achieved by treating the config file as any other file to bump.

I've implemented this here and seems to work, but I don't understand the internals of bump2version very well and I may be missing some important subtlety.

@florisla
Copy link
Collaborator

florisla commented Jan 6, 2020

I agree that bumpversion should not rewrite its configuration file. I've lost commented-out lines on multiple occasions and that should not happen.

This is a promising approach!

However currently many unit tests are failing using this change; could you perhaps look into that?

@c4urself
Copy link
Owner

Agree, rewriting is a bit annoying; and that's not really being a good citizen towards other things in setup.cfg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants