An open API service indexing awesome lists of open source software.

https://github.com/chocolacula/verbm

language agnostic version bump tool
https://github.com/chocolacula/verbm

bump versioning

Last synced: 7 months ago
JSON representation

language agnostic version bump tool

Awesome Lists containing this project

README

          


logo


verbm



mypy
test
codecov
python3.9
pypi
downloads

Language agnostic **VER**sion **B**u**M**p tool that simplifies routine version management. Its capabilities include:

- `set` version, `up` or `down` 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](https://github.com/noirbizarre/bumpr), [tbump](https://github.com/your-tools/tbump) or [bump2version](https://github.com/c4urself/bump2version?tab=readme-ov-file) but it automates most of the work.

## Installation

Make sure Python 3.9 or later, along with `pip` or `pipx`, is installed.

```sh
pipx install verbm
```

## Usage

To begin, you need a configuration file. You can use `verbm` to generate a well documented default configuration file by running the following command:

```sh
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](./version.yml) in the project is an ideal example of a default configuration file.

The basic commands are `get` and `set`:

```sh
verbm get

verbm set 0.1.3-rc
```

It's possible to ensure version consistency across all source files:

```sh
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:

```sh
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:

```sh
verbm up auto --commit --tag --push
```

Verbm follows the [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/) 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.

```sh
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.

## Contributing

If you are not familiar with Python, I recommend create a virtual environment first, then install dev dependencies:

```sh
python3 -m venv .venv

source .venv/bin/activate

pip install -r requirements.txt
```