Language agnostic VERsion BuMp tool that simplifies routine version management. Its capabilities include:
set
version,up
ordown
specific version component- modify the version in the source code, make a commit, and create a tag
- analyze git history to automatically determine which component to increment
- support monorepos, you can manage a few versions in one repo
- support squash commits
- be easily customized to fit your needs!
It similar to bumpr, tbump or bump2version but it automates most of the work.
Make sure Python 3.9 or later, along with pip
or pipx
, is installed.
pipx install verbm
To begin, you need a configuration file. You can use verbm
to generate a well documented default configuration file by running the following command:
cd /path/to/project
verbm init
It will attempt to retrieve the current version from the latest git
tag, as well as the user's name and email. If these attempts are unsuccessful, it will use default placeholders instead. The current version.yml in the project is an ideal example of a default configuration file.
The basic commands are get
and set
:
verbm get
verbm set 0.1.3-rc
It's possible to ensure version consistency across all source files:
verbm validate --file /path/to/version.yml
Most commands support the
--file
option and can be executed from a different directory.
You can increment or decrement a specific component of the semantic versioning by:
verbm up patch
verbm down minor
However, the most intriguing option is to analyze the output of git log
and decide which component to increment. With the following options it updates source files, creates a commit and tag, and pushes these changes to the repository with a single command:
verbm up auto --commit --tag --push
Verbm follows the conventional commit style but is slightly relaxed by default.
It checks both the commit message and the description. This enables the analysis of GitHub and GitLab squash commits, which gather all commits in the description each beginning with an *
asterisk symbol.
Commit tags for specific version components can be easily customized in the configuration file using regular expressions.
If your project includes multiple subprojects and you want to use separate version.yml
files, it can become challenging due to the git log
containing commits that affect multiple subprojects simultaneously. To address this, use the --filter
argument.
verbm up auto --filter '/src/subproject/.*' '/src/common/.*'
And files that have been changed but do not match the specified regex will be excluded from the log.
If you are not familiar with Python, I recommend create a virtual environment first, then install dev dependencies:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt