Replies: 4 comments
-
Yea the docs may be a bit misleading here. Either manual or automation is required to call bump-my-version. If you want to automate pre-releases I would use branches and github actions. Take a look at the automation in this repo for ideas. I'll try to do a more complete write up soon, but feel free to ask follow-up questions. |
Beta Was this translation helpful? Give feedback.
-
Yeah I think clarifying this in the docs would be super helpful. I'll take a look at the actions in this repo for inspiration, thanks! |
Beta Was this translation helpful? Give feedback.
-
Okay I've taken a look, but still unsure how to actually bump the version automatically with a pre-commit hook for example. I thought it would be something like |
Beta Was this translation helpful? Give feedback.
-
I have a similar problem with using $ bump-my-version show-bump
Specified version (6.1.0.post.dev0) does not match last tagged version (6.1.0)
6.1.0.post.dev0 ── bump ─┬─ major ─ 7.0.0
├─ minor ─ 6.2.0
├─ patch ─ 6.1.1
╰─ dev ─── invalid: The part has already the maximum value among ['release', 'post'] and cannot be bumped. Another problem is that the $ bump-my-version bump minor -n -vv
Starting BumpVersion 0.28.1
Reading configuration
Reading config file: /home/user/Documents/myproject/pyproject.toml
Specified version (6.1.0.post.dev0) does not match last tagged version (6.1.0)
Parsing current version '6.1.0.post.dev0'
Parsing version '6.1.0.post.dev0' using regexp '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<dev>post)\.dev\d+)?'
Parsed the following values: dev=post, major=6, minor=1, patch=0
No setup hooks defined
Attempting to increment part 'minor'
Values are now: dev=release, major=6, minor=2, patch=0
Serializing version '<bumpversion.Version:dev=release, major=6, minor=2, patch=0>'
Using serialization format '{major}.{minor}.{patch}'
Serialized to '6.2.0'
New version will be '6.2.0'
Dry run active, won't touch any files.
File src/myproject/_version.py: replace `{current_version}` with `{new_version}`
Serializing the current version
Serializing version '<bumpversion.Version:dev=post, major=6, minor=1, patch=0>'
Using serialization format '{major}.{minor}.{patch}.{dev}.dev{distance_to_latest_tag}'
Serialized to '6.1.0.post.dev4'
Serializing the new version
Serializing version '<bumpversion.Version:dev=release, major=6, minor=2, patch=0>'
Using serialization format '{major}.{minor}.{patch}'
Serialized to '6.2.0'
Rendering search pattern with context
No RegEx flag detected. Searching for the default pattern: '6\.1\.0\.post\.dev4'
Found '6\.1\.0\.post\.dev0' at line 3: 6.1.0.post.dev0
Rendering search pattern with context
No RegEx flag detected. Searching for the default pattern: '6\.1\.0\.post\.dev0'
Would change file src/myproject/_version.py:
*** before src/myproject/_version.py
--- after src/myproject/_version.py
***************
*** 1,3 ****
# Use bump-my-version to update this file
! __version__: str = "6.1.0.post.dev0"
--- 1,3 ----
# Use bump-my-version to update this file
! __version__: str = "6.2.0"
Processing config file: /home/user/Documents/myproject/pyproject.toml
Serializing version '<bumpversion.Version:dev=post, major=6, minor=1, patch=0>'
Using serialization format '{major}.{minor}.{patch}.{dev}.dev{distance_to_latest_tag}'
Serialized to '6.1.0.post.dev4'
Serializing version '<bumpversion.Version:dev=release, major=6, minor=2, patch=0>'
Using serialization format '{major}.{minor}.{patch}'
Serialized to '6.2.0'
Rendering search pattern with context
No RegEx flag detected. Searching for the default pattern: '6\.1\.0\.post\.dev4'
Would not change file /home/user/Documents/myproject/pyproject.toml:tool.bumpversion.current_version
Serializing version '<bumpversion.Version:dev=release, major=6, minor=2, patch=0>'
Using serialization format '{major}.{minor}.{patch}'
Serialized to '6.2.0'
No pre-commit hooks defined
Would prepare Git commit
Would add changes in file '/home/user/Documents/myproject/pyproject.toml' to Git
Would add changes in file 'src/myproject/_version.py' to Git
Would commit to Git with message 'Version bumped from 6.1.0.post.dev0 to 6.2.0'
Would tag '6.2.0' with message 'Bump version: 6.1.0.post.dev0 → 6.2.0' in Git and not signing
Serializing version '<bumpversion.Version:dev=release, major=6, minor=2, patch=0>'
Using serialization format '{major}.{minor}.{patch}'
Serialized to '6.2.0'
No post-commit hooks defined
Done. I am using the following config: [tool.bumpversion]
current_version = "6.1.0.post.dev0"
commit = true
commit_args = "--no-verify"
tag = true
tag_name = "{new_version}"
allow_dirty = true
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(\\.(?P<dev>post)\\.dev\\d+)?"
serialize = [
"{major}.{minor}.{patch}.{dev}.dev{distance_to_latest_tag}",
"{major}.{minor}.{patch}"
]
message = "Version bumped from {current_version} to {new_version}"
[tool.bumpversion.parts.dev]
values = ["release", "post"]
optional_value = "release"
[[tool.bumpversion.files]]
filename = "src/myproject/_version.py"
|
Beta Was this translation helpful? Give feedback.
-
Description
I checked the README and existing issues, trying to automate the bump of pre-release numbers (alpha0, alpha1, ...) whenever I commit. However, the version doesn't change when I do
git commit
.What I Did
This is my .bumpmyversion.toml
Did I miss something obvious? I couldn't find any detailed instructions on how to use this feature, the README just says "Release candidate versions increase automatically with each commit." - but this isn't the case for me. Or is this entirely meant as a GitHub Actions / CICD feature?
Beta Was this translation helpful? Give feedback.
All reactions