Skip to content

Allow not updating the config file, even when it exists.#169

Open
coderanger wants to merge 2 commits intoc4urself:masterfrom
coderanger:no-update-config
Open

Allow not updating the config file, even when it exists.#169
coderanger wants to merge 2 commits intoc4urself:masterfrom
coderanger:no-update-config

Conversation

@coderanger
Copy link
Copy Markdown

This allows working completely off the latest tag support for current_version so the config file doesn't change on bump.

@coderanger
Copy link
Copy Markdown
Author

Any chance of this getting looked at?

Copy link
Copy Markdown
Collaborator

@florisla florisla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also be updated in the README.

Comment thread bumpversion/cli.py
# store the new version
_update_config_file(
config, config_file, config_newlines, config_file_exists, args.new_version, args.dry_run,
config, config_file, config_newlines, config_file_exists, args.new_version, args.dry_run, args.no_update_config,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we bypass _update_config_file altogether in case of no_update_config ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could do that too, would you prefer that? Was trying to avoid flow changes as much as possible.

@florisla
Copy link
Copy Markdown
Collaborator

florisla commented Jan 6, 2021

Does this not bring the version in the config out of sync with the other version numbers?

@coderanger
Copy link
Copy Markdown
Author

The goal was to better help with a tag-only workflow. So a config like:

[bumpversion]
commit = True
tag = True
no_update_config = True
parse = (?P<major>\d+)\.(?P<minor>\d+)
serialize = {major}.{minor}

With no current_version at all, and the version discovered only from the latest tag on the fly.

@florisla
Copy link
Copy Markdown
Collaborator

OK. Do you think it's possible to have no no_update_configat all option, and just assume this in case we can't find a current_version in the config or in the command-line arguments?

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.

2 participants