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

Derive current version from git tags. #212

Closed
jpavlav opened this issue Jul 16, 2024 Discussed in #211 · 1 comment · Fixed by #213
Closed

Derive current version from git tags. #212

jpavlav opened this issue Jul 16, 2024 Discussed in #211 · 1 comment · Fixed by #213

Comments

@jpavlav
Copy link

jpavlav commented Jul 16, 2024

Discussed in #211

Originally posted by jpavlav July 12, 2024
Hello!

First off, just want to say, thanks for forking the project and keeping it going. I've used the previous incarnations and 👍. Previously, I've used this tool only for python projects. Right now, I'm trying to use this tool to create a github action that is somewhat generic for bumping versions.

I thought this would be a cinch, since there is support for detecting the version from a git tag. It would prevent us from having our users include a configuration file in their repo with the version in it. However, I find that it, in the absence of the current_version in a config file, the tool bottoms out despite being able to detect the tagged version. Am I just missing some option here? Or is this intentional?

Examples:

bump-my-version bump --current-version 0.4.0 --dry-run minor
KeyError: "Key 'current_version' not found at 'tool.bumpversion'"

Does current_version really need to be present in the config file if the user is specifying the version? Further, does it really need to be present if there is a tagged version available? I see that it detects that:

bump-my-version bump --current-version 1.0.0 --dry-run
  Specified version (1.0.0) does not match last tagged version (0.4.0)

I just wanted to ask about this before I raised an issue. I'd be unopposed to making a contribution to make this possible, but I want to make sure that I'm not stepping outside of the bounds of what is intended. Thanks!

@coordt coordt closed this as completed Jul 17, 2024
coordt added a commit that referenced this issue Jul 17, 2024
The code has been updated to handle KeyErrors when updating TOML files. If a KeyError is raised, it's now caught and managed depending on the file_change attributes 'ignore_missing_file' or 'ignore_missing_version'. This aims to provide more robust handling of edge cases in TOML files. In addition, a new test case has been added to ensure current version is not required in the configuration.

Fixes #212
@coordt coordt linked a pull request Jul 17, 2024 that will close this issue
@jpavlav
Copy link
Author

jpavlav commented Jul 17, 2024

Thank you for the quick turnaround on this! This is really helpful.

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

Successfully merging a pull request may close this issue.

2 participants