Registry / devops / bump-my-version

bump-my-version

JSON →
library1.3.0pypypiunverified

Bump My Version is a command-line tool designed to simplify software releases by automatically updating version strings across project files, optionally committing changes, and creating Git tags. It is a maintained refactor of the `bump2version` fork of `bumpversion`, offering enhanced features like `pyproject.toml` configuration support, a modern CLI built with `click` and `rich`, and robust configuration validation using `Pydantic`. It supports various versioning schemes including Semantic Versioning (SemVer) and Calendar Versioning (CalVer). The current version is 1.3.0, and it has an active development and release cadence.

pip install bump-my-version
INSTALL
IMPORT
SIG · BUMP-MY-VERSION
B
bump-my-version
devopspythonv1.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

This quickstart demonstrates how to set up `bump-my-version` for a new project and perform a basic version bump. It starts by creating a dummy project and then initializes a `.bumpversion.toml` configuration file. Finally, it uses the `bump` subcommand to increment the 'minor' version component, updating both the source file and the configuration itself. By default, it will look for version strings defined in `pyproject.toml` or `__init__.py` files based on the generated config.

# 1. Create a sample project structure and initialize a git repo mkdir my-project cd my-project git init echo '__version__ = "0.1.0"' > my_project/__init__.py mkdir my_project # 2. Generate a default configuration file (e.g., .bumpversion.toml) bump-my-version sample-config --no-prompt --destination .bumpversion.toml # 3. Inspect the generated config (optional) cat .bumpversion.toml # 4. Bump the 'minor' version (will update __init__.py and .bumpversion.toml) bump-my-version bump minor # 5. Verify the version has been bumped cat my_project/__init__.py cat .bumpversion.toml # You can also bump other parts like 'major' or 'patch' # bump-my-version bump major
bump-my-version --version
Debug
Known issues
breakingThe command-line invocation changed significantly in version 0.6.0, splitting functionality into sub-commands (e.g., `bump-my-version bump <part>`). While older syntax might still be backward-compatible for now, it is discouraged and may be removed in a future 1.0 release.
fix
Update your scripts to use the new sub-command syntax, e.g., `bump-my-version bump minor` instead of `bump-my-version minor`.
affects: >=0.6.0
gotchaUnlike its predecessor `bump2version`, `bump-my-version` may silently succeed even if it fails to find and modify all configured files, potentially leading to desynchronized version strings across your project. Ensure your configuration's `search` and `replace` patterns accurately match your files.
fix
Always verify file changes after a bump, especially in automated workflows. Review your `.bumpversion.toml` or `pyproject.toml` `files` and `search` configurations carefully to ensure they match expected version strings.
affects: All versions
deprecatedThe `--list` command-line option is deprecated.
fix
Use `bump-my-version show` instead to get machine-readable output.
affects: >=0.6.0
gotchaAs of March 22, 2026, the `allow_shell_hooks` configuration is now `false` by default, disallowing shell metacharacters in hooks unless explicitly enabled. This is a security-related change.
fix
If your workflow relies on shell metacharacters in hooks, you must explicitly set `allow_shell_hooks = true` in your configuration file.
affects: >=1.x.x (specifically around March 22, 2026 releases)
gotchaConfiguration files are resolved in a specific order: `--config-file`, `BUMPVERSION_CONFIG_FILE` environment variable, `.bumpversion.cfg` (legacy), `.bumpversion.toml`, `setup.cfg` (legacy), `pyproject.toml`. Conflicting settings might lead to unexpected behavior if files are not ordered correctly or legacy configs are present.
fix
Prefer using `pyproject.toml` or `.bumpversion.toml` for modern configurations and remove older `.bumpversion.cfg` or `setup.cfg` files to avoid ambiguity. Always explicitly specify your configuration file if there's any doubt.
affects: All versions
Errors
Common errors & fixes
bump-my-version: command not found
The `bump-my-version` executable is not found in the system's PATH, usually because the package was not installed or its installation directory is not in PATH.
fix
Ensure `bump-my-version` is installed and accessible. For global installation: `pip install bump-my-version`. If using a virtual environment, activate it before running the command. If still not found, check your PATH environment variable.
ModuleNotFoundError: No module named 'bumpversion'
This error occurs when a Python script attempts to import the `bumpversion` module, but Python cannot find it in the current environment's `sys.path`.
fix
Install the `bump-my-version` package in your active Python environment: `pip install bump-my-version`. Note that the package name is `bump-my-version`, but the importable module is typically `bumpversion`.
Unable to bump version: No file in <path> matched to [**/requirements.txt or **/pyproject.toml]
`bump-my-version` could not find any of the configured files (e.g., `pyproject.toml`, `.bumpversion.toml`, or other specified files) or the specific `search` pattern for the current version within those files.
fix
Ensure the configuration file (e.g., `pyproject.toml`) exists in the current directory or a parent directory, and that the `[[tool.bumpversion.files]]` section correctly specifies `filename` and `search` patterns that match your project's version strings. Alternatively, provide specific files on the command line, e.g., `bump-my-version patch your_version_file.py`.
ValueError: The part has already the maximum value among [...] and cannot be bumped.
This error indicates that you are trying to bump a version part (e.g., 'dev', 'alpha') that has a defined list of values in your configuration, and the current value is already the last one in that list, or it's implicitly considered a 'maximum' for the current state (e.g., trying to bump 'final' if no further parts are defined).
fix
Review your `parse` and `serialize` configurations, especially the `values` list for the specific version part. If you're trying to transition to a stable release from a pre-release, ensure your `serialize` rules handle the promotion correctly, or explicitly define the next valid value if it's not an increment.
Upgrade
Version history
1.3.0latest on PyPI · released Mar 22, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
14
OpenAI (training)
1
Resources
bump-my-version — pip install bump-my-version · libregistry