Bumpver is a Python library and command-line tool designed for automatic versioning of project files. It supports various versioning schemes, including Semantic Versioning (SemVer) and Calendar Versioning (CalVer), and works with plain text files, making it suitable for any project. It integrates optionally with Git or Mercurial to manage version tags and commits. The current version is 2025.1131. The project has an active release cadence, with updates often several times a year, addressing bug fixes and adding new features.
pip install bumpverNo compatibility data collected yet for this library.
The primary way to use `bumpver` is via its Command Line Interface (CLI). This quickstart demonstrates how to initialize `bumpver` configuration in `pyproject.toml` and then update the project's version across specified files using the `bumpver update` command. The `--dry` flag is useful for previewing changes before applying them.
Update `pip` installations from `pycalver` to `bumpver` and review `version_pattern` configurations, preferably updating to the new syntax described in current documentation.
Understand the rollover behavior of date-based parts. If you need to avoid rollover for specific auto-incrementing parts within a calendar unit, consider using the `--pin-increments` flag or structuring your `version_pattern` and `file_patterns` carefully.
Always include `--major`, `--minor`, or `--patch` flags when performing an `update` operation on a SemVer pattern, unless using other auto-incrementing parts like `BUILD`, `INC0`, or `INC1`.
Utilize `bumpver grep "<PATTERN>" <FILE>` to test and debug your `version_pattern` and `file_patterns` regular expressions before attempting an `update`. Ensure patterns accurately match the version strings in your files.
Ensure all files with version strings managed by `bumpver` are committed before running `bumpver update`, even if `allow-dirty` is specified for other parts of the repository. Use `git status` to verify.
Use `bumpver grep '{your_pattern}' {your_file} --verbose` to debug the regular expression 'bumpver' is using. Adjust your 'version_pattern' or 'file_patterns' in the configuration to ensure they correctly capture the version string in your project files.Verify that your 'current_version' in 'bumpver.toml' or 'pyproject.toml' exactly matches the structure defined by your 'version_pattern'. For Semantic Versioning, ensure you always include `--major`, `--minor`, or `--patch` when running `bumpver update`. For Calendar Versioning, make sure the date has advanced, or use flags like `--build` or `--inc0` to increment non-date parts for same-day releases.
Ensure you are running the `bumpver` command from the root directory of your Git or Mercurial repository. If your project isn't under version control, initialize one (e.g., `git init`). If you do not wish to commit, remove the `--commit` flag or set `commit = false` in your configuration.
Create a separate executable script file (e.g., named `pre-bump.sh`) containing the commands you wish to execute. Then, in your 'bumpver.toml', set `pre_commit_hook = 'path/to/your/pre-bump.sh'`, ensuring the path is correct and the script has execute permissions.
No dependency data recorded yet.