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-versionNo compatibility data collected yet for this library.
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.
Update your scripts to use the new sub-command syntax, e.g., `bump-my-version bump minor` instead of `bump-my-version minor`.
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.
Use `bump-my-version show` instead to get machine-readable output.
If your workflow relies on shell metacharacters in hooks, you must explicitly set `allow_shell_hooks = true` in your configuration file.
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.
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.
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`.
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`.
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.
No dependency data recorded yet.