Not require to rewrite full cfg-file when bumping the version#163
Not require to rewrite full cfg-file when bumping the version#163balrok wants to merge 3 commits intoc4urself:masterfrom
Conversation
|
What do you think? It is not breaking existing tools while having finally a way to write comments into the cfg-file. |
|
@balrok If I understand correctly your patch will avoid bump2version to update the config file, and one has to rely on the explicit configuration which will only update the version string via |
Place configuration in .bumpversion.cfg to avoid re-write of setup.cfg. See also: c4urself/bump2version#163
… rewriting the setup.cfg during version bumps which cause pre-commit to fail. See: * c4urself/bump2version#90 * c4urself/bump2version#163
changing the default behavior of bump2version to always use the
search/replace functionality to update the version in the cfg-files,
brings several backwards incompatible changes:
1. when current_version did not exist in .bumpversion.cfg, it will not be updated
- when retrieving the version from the git tag
- when retrieving the version via --current_version flag
2. when .bumpversion.cfg contains a "new_version" field, previously this
field was removed, but with this change it is not possible anymore
To get the desired functionality, we keep the current behavior.
But now, if the config-file is explicitely specified to be handled by bump2version search/replace, it is not rewritten.
The reason, why someone wants this is, that the old behavior of
rewriting the .cfg file discards all comments and custom formatting.
|
I know it's not great to revive dead threads, but is this PR going to get merged in the future? My team is having issues with pre-commit and bump2version as in #124 |
Since pr #90 introduced a lot of breaking changes (can bee seen in the updated unit tests in #162 ). Here is another approach. Basically it makes it opt-in to use bump2version on the
.bumpversion.cfgrather than the opt-out approach of #90.When this PR is merged it solves #87, #62, and provides a solution for #161