Closed daveisagit closed 1 month ago
@daveisagit It sounds like you want to do the change to pyproject.toml at the same time you bump the version.
To do this add this to your configuration:
[[tool.bumpversion.files]]
regex = true
filename = "pyproject.toml"
search = "^version = \"{current_version}\""
replace = "version = \"{new_version}\""
Here is a reference to the search and replace docs for more details.
Thanks, but I still get the same error. It seems to me the replace has trouble finding the file which is odd given the generation of config found it by default with no problem.
Why is it taking the patch option as the filename?
Ok, so this me not understanding how to use it.
For anyone else in a similar mindset, the replace
option is not the way.
Simply use bump
with the version_part
and that will update the pyproject.toml
file if you add the [[tool.bumpversion.files]]
entry as suggested.
In fact you only need to add
[[tool.bumpversion.files]]
filename = "pyproject.toml"
Description
I want to run
bump-my-version replace patch
and see mypyproject.toml
version updated.What I Did
Installed and ran
bump-my-version sample-config --no-prompt --destination .bumpversion.toml
which successfully created.bumpversion.toml
automatically setting current_version to 0.1.0 frompyproject.toml
Content
Successfully ran
bump-my-version bump patch
which bumped ok to 0.1.1Tried running
bump-my-version replace patch
and got no file found error