bumpwright bump
bumpwright bump --commit --tag
Update version information in pyproject.toml and other files. By default, bumpwright also searches setup.py, setup.cfg and any __init__.py, version.py or _version.py files for a version assignment. Files inside common build artefacts and virtual environments are ignored by default (build/**, dist/**, *.egg-info/**, .eggs/**, .venv/**, venv/**, .env/** and **/__pycache__/**). These locations can be customised via the [version] section in bumpwright.toml or augmented with --version-path and --version-ignore to add or exclude patterns. See Version file targeting for targeting specific version files.
Primary options
--base BASE – base git reference when auto-deciding the level.
--head HEAD – head git reference.
--commit – create a git commit for the version change.
--tag – create a git tag for the new version.
--dry-run – preview changes without modifying any files.
--explain – show reasoning behind the selected bump level.
--no-impl-change-patch – ignore implementation-only changes to public symbols.
Arguments
--base BASEBase git reference when auto-deciding the level. Defaults to the last release commit if available, otherwise the previous commit (HEAD^).
--head HEADHead git reference. Defaults to HEAD.
--format {text,md,json}Output style. text prints plain console output, md emits Markdown, and json produces machine-readable data. Defaults to text.
--explainLog detected impacts, applied rules, and chosen bump level before any files are modified.
--no-impl-change-patchDo not treat implementation-only changes as patch-level impacts when computing the bump.
--repo-url URLBase repository URL used to build commit links in Markdown output. Overrides [changelog].repo_url when provided. Defaults to none, showing raw commit hashes when unset.
--enable-analyser NAMEEnable analyser NAME in addition to configuration. Repeatable. Defaults to none.
--disable-analyser NAMEDisable analyser NAME even if enabled in configuration. Repeatable. Defaults to none.
--changelog [FILE]Append release notes for the new version to FILE. When FILE is omitted or set to -, the changelog entry is printed to standard output. Defaults to none, producing no changelog unless [changelog].path in bumpwright.toml supplies a default. See Configuration Reference for more detail.
--changelog-template PATHJinja2 template file used when rendering changelog entries. Defaults to the built-in template or [changelog].template when configured. Useful for customising changelog layout.
--changelog-exclude REGEXRegex pattern for commit subjects to exclude from changelog entries. Repeatable. Patterns from configuration are combined with CLI values.
--pyproject PATHPath to the project’s pyproject.toml file. Defaults to pyproject.toml.
--version-path GLOBGlob pattern for files that contain the project version. May be repeated to update multiple locations. Defaults to none, using only the built-in search paths.
--version-ignore GLOBGlob pattern for paths to exclude from version updates. Defaults to none.
--commitCreate a git commit for the version change. Defaults to false.
--tagCreate a git tag for the new version. Defaults to false.
--dry-runDisplay the new version without modifying any files. Defaults to false.
Note
Omitting --base compares against the last release commit or HEAD^. When --commit or --tag is used, the working tree must be clean.
Examples
This prints the old and new versions and, when --commit and --tag are set, commits and tags the release. Omitting --base compares against the last release commit or the previous commit (HEAD^), and omitting --head assumes HEAD.
Changelog generation
bumpwright can generate Markdown release notes from commits between the base and head references. Use --changelog to choose an output file and specify a repository URL via [changelog].repo_url or --repo-url to link commit hashes. See Changelog & Templates for template variables, configuration options, and examples.
[changelog]
repo_url = "https://github.com/me/project"
Preview changes
To preview changes without touching the filesystem, combine --dry-run with a chosen output format:
The confidence and reasons fields mirror those shown when running bumpwright decide. files lists paths that would be updated by the bump, while skipped records any files ignored by configuration.
Omitting --base compares against the last release commit or the previous commit (HEAD^); leaving out --head uses the current HEAD.
Full workflow
A typical release sequence might look like this:
git checkout -b feature/amazing-change
# edit code
git commit -am "feat: add amazing change"
bumpwright bump --commit --tag
git push origin HEAD && git push --tags
All commands read configuration from bumpwright.toml by default. Use --config to specify an alternate file.
Common errors
pyproject.toml not foundEnsure you run the command at the project root or pass --pyproject with the correct path.
- Changes not applied after running
The --dry-run flag previews the bump without touching files. Remove it and, if desired, add --commit and --tag to persist the change.
- Versioned files created or removed
Call bumpwright.versioning.clear_version_file_cache() before the next run or change --version-path/--version-ignore patterns so bumpwright rescans the filesystem.