Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No rewrite config file when bumping #90

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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.

None yet

3 participants