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

Not rewriting config file when bumping #162

Closed
wants to merge 4 commits into from

Conversation

balrok
Copy link
Contributor

@balrok balrok commented Oct 2, 2020

Since pr #90 stalled, I fixed the missing tests. By doing that, it also uncovered some regressions.

  1. when current_version did not exist in .bumpversion.cfg, it will not be created:
  • when retrieving the version from the git tag
  • when retrieving the version via --current_version flag
  1. when .bumpversion.cfg contains a "new_version" field, previously this
    field was removed, but with this change it is not possible anymore

Solutions:
Not staying backwards compatible, because:

  1. is a relatively uncommon, once this case happens the file has the "current_version" written afterwards, so it might not affect many
  2. even if there is a use-case for this, it can be easily migrated to print an error when new_version is found in the config and recommend "--new_version="

Staying backwards compatible, but being less intuitive:
Additionally, write the file whenever case 1 or 2 is true. This can be implemented by letting _load_configuration return a boolean.

This would solve:

albireox and others added 4 commits October 2, 2020 22:00
there are backwards incompatible changes right now:
* when current_version did not exist in .bumpversion.cfg, it will not be created:
  * when retrieving the version from the git tag
  * when retrieving the version via --current_version flag
* when .bumpversion.cfg contains a "new_version" field, previously this
  field was removed, but with this change it is not possible anymore
@balrok
Copy link
Contributor Author

balrok commented Oct 4, 2020

I found a third option, which avoids breaking backwards comaptibility. Closing it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants