Automatically increment the project's version number.
Project description
bumper
Automatically increment the project's version number.
Heavily inspired by bump2version and bumpversion. While bump-my-version is an excellent modern fork this functionality, I'd like a pared down version of the offered feature set for my personal projects.
Supported Versioning Schemes
- Semantic Versioning (SemVer)
- Assumes
<MAJOR>.<MINOR>.<PATCH>
- Assumes
- Calendar Versioning (CalVer)
- Assumes
<YYYY>.<MM>.<MICRO>
- Assumes
Installation
Install from PyPi with your favorite pip invocation, e.g.:
$ pip install sco1-bumper
You can confirm proper installation via the bumper CLI:
$ bumper --help
Usage: bumper [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
bump Bump the requested version component.
init Generate a default bumper configuration file.
Configuration
bumper searches for its configuration options first in a .bumper.toml file, then in pyproject.toml; preference is given to whichever configuration is located first.
Required Fields
tool.bumper
current_version- The current software version. This is automatically incremented when bumping.versioning_type- Versioning type to be used, accepted values are"semver"and"calver"
tool.bumper.files
file- Path to target file relative to the repository rootsearch- Replacement string to search for in the target file. Must contain a{current_version}tag if you want something to happen.
Example Configuration
The basic configuration looks something like the following:
SemVer
[tool.bumper]
current_version = "0.1.0"
versioning_type = "semver"
[[tool.bumper.files]]
file = "./pyproject.toml"
search = 'version = "{current_version}"'
CalVer
[tool.bumper]
current_version = "2025.1.0"
versioning_type = "calver"
[[tool.bumper.files]]
file = "./pyproject.toml"
search = 'version = "{current_version}"'
Multiple replacements within the same file can also be specified:
[tool.bumper]
current_version = "0.1.0"
versioning_type = "semver"
[[tool.bumper.files]]
file = "./pyproject.toml"
search = 'version = "{current_version}"'
[[tool.bumper.files]]
file = "./README.md"
search = "sco1-bumper/{current_version}"
[[tool.bumper.files]]
file = "./README.md"
search = "rev: v{current_version}"
CLI
bumper bump
Bump your project's version number using your defined configuration.
$ bumper bump --help
Usage: bumper bump [OPTIONS] BUMP_BY:{major|minor|patch|date}
Bump the requested version component.
Allowable `BUMP_BY` values differ based on the project's specified
versioning type: SemVer - (major, minor, patch), CalVer - (date)
When using CalVer, if the user's current UTC month is the same as the
current project version, then the Micro component is incremented. Otherwise,
the date components are bumped to the user's current UTC month and Micro
reset to `0`.
If `dry_run` is `True`, the requested diff will be displayed in the terminal
& no file modifications will take place.
Arguments:
BUMP_BY:{major|minor|patch|date}
[required]
Options:
--dry-run / --no-dry-run Preview the requested diff. [default: no-dry-run]
--help Show this message and exit.
bumper init
A small helper to initialize a starter .bumper.toml file that bumps the version field of your project's pyproject.toml file.
NOTE: Be sure to update the sample version with your current version number before bumping with bumper.
$ bumper init --help
Usage: bumper init [OPTIONS]
Generate a default bumper configuration file.
If the `--ignore_existing` flag is set, any existing `.bumper.toml` file
will be overwritten; this action is not reversible. Otherwise, the existing
configuration will be preserved.
Options:
--versioning-type [semver|calver]
[default: semver]
--ignore-existing / --no-ignore-existing
[default: no-ignore-existing]
--help Show this message and exit.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sco1_bumper-2.0.3.tar.gz.
File metadata
- Download URL: sco1_bumper-2.0.3.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e8cd15fe4765a39f3848c291941bd56e772222ff7c7b9ec56488d9d019bc95f
|
|
| MD5 |
e35cb90c873840882b444fbb47d0aa1c
|
|
| BLAKE2b-256 |
5d21fa4fa7b9c88ca015c38b5344a2d35ace1f52f852e4bed10f715dbb13f62e
|
Provenance
The following attestation bundles were made for sco1_bumper-2.0.3.tar.gz:
Publisher:
pypi_release.yml on sco1/bumper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sco1_bumper-2.0.3.tar.gz -
Subject digest:
2e8cd15fe4765a39f3848c291941bd56e772222ff7c7b9ec56488d9d019bc95f - Sigstore transparency entry: 1206634995
- Sigstore integration time:
-
Permalink:
sco1/bumper@957ced6eb7974525b59089d3e168f6100b02f335 -
Branch / Tag:
refs/tags/v2.0.3 - Owner: https://github.com/sco1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi_release.yml@957ced6eb7974525b59089d3e168f6100b02f335 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sco1_bumper-2.0.3-py3-none-any.whl.
File metadata
- Download URL: sco1_bumper-2.0.3-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
615d57a2d83fa2005361b3a59b10af01077c97637b242c37756ef90934a43996
|
|
| MD5 |
787a9918233f8cbd59e4c8b9b0f87ca8
|
|
| BLAKE2b-256 |
ee39e5dc7d0551ad6673bf50cd018dec1fdba97bbcc5d7231d7fc1097eb6c104
|
Provenance
The following attestation bundles were made for sco1_bumper-2.0.3-py3-none-any.whl:
Publisher:
pypi_release.yml on sco1/bumper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sco1_bumper-2.0.3-py3-none-any.whl -
Subject digest:
615d57a2d83fa2005361b3a59b10af01077c97637b242c37756ef90934a43996 - Sigstore transparency entry: 1206635051
- Sigstore integration time:
-
Permalink:
sco1/bumper@957ced6eb7974525b59089d3e168f6100b02f335 -
Branch / Tag:
refs/tags/v2.0.3 - Owner: https://github.com/sco1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi_release.yml@957ced6eb7974525b59089d3e168f6100b02f335 -
Trigger Event:
release
-
Statement type: