Configuration Reference¶
bumpwright
reads settings from bumpwright.toml
. Missing sections fall
back to built-in defaults. Use --config
to point to an alternative file.
Note
Environment variables prefixed with BUMPWRIGHT_
provide default values
for CLI flags. See Environment variables for the full list.
Configuration overview¶
A bumpwright.toml
file is divided into thematic sections that mirror the
tool’s major features. Each section groups related options controlling project
scope, analysis behaviour, or release outputs. The table below provides a quick
map before diving into the detailed references.
Section |
Purpose |
Category |
---|---|---|
Define the package roots and visibility rules. |
Project |
|
Exclude paths from analysis. |
Project |
|
Override default bump levels for API changes. |
Project |
|
Enable and configure API analysers. |
Analysis |
|
Locate Alembic migration directories. |
Analysis |
|
Configure OpenAPI specification paths. |
Analysis |
|
Control version file detection and scheme. |
Output |
|
Configure changelog generation. |
Output |
Quick setup¶
Create bumpwright.toml
in the project root and enable any analysers you
need:
[project]
package = "my_package"
[analysers]
cli = true
Run bumpwright bump --base v1.0.0 --head HEAD
to compare revisions. See
quickstart for a walkthrough.
bumpwright bump --base v1.0.0 --head HEAD
bumpwright suggests: minor
Reference¶
All configuration keys are grouped by section below. Each block shows default values and accepted types.
Project¶
[project]
package = ""
public_roots = ["."]
private_prefixes = ["_"]
extra_public_files = ["README.*", "docs/**/*.rst"]
Key |
Default |
CLI flag |
---|---|---|
|
|
(none) |
|
|
(none) |
|
|
(none) |
|
|
(none) |
- package
Importable package containing the project’s code. When empty the repository layout is used.
- public_roots
Paths whose contents constitute the public API. Any modified Python file within these roots triggers a patch bump, even if only private helpers change.
- private_prefixes
Symbol prefixes treated as private and ignored during API analysis.
- extra_public_files
Additional glob patterns for files that trigger a patch bump when modified.
Ignore¶
[ignore]
paths = ["tests/**", "examples/**", "scripts/**"]
Key |
Default |
CLI flag |
---|---|---|
|
|
(none) |
- paths
Glob patterns excluded from analysis.
Rules¶
bumpwright
detects common public API changes and assigns default semantic
version bumps:
- Added public symbol
minor
- Removed public symbol
major
- Added required parameter
major
- Added optional parameter
minor
- Removed required parameter
major
- Removed optional parameter
minor
- Parameter kind changed
major
- Parameter default added or changed
minor
- Parameter default removed
major
- Return type changed
minor
*- Parameter annotation changed
patch
*- Implementation changed
patch
*
Entries marked with *
can be overridden in bumpwright.toml
via the
[rules]
section:
[rules]
return_type_change = "major"
param_annotation_change = "minor"
implementation_change = "minor"
Key |
Default |
CLI flag |
---|---|---|
|
|
(none) |
|
|
(none) |
|
|
(none) |
- return_type_change
Bump level when a function’s return type changes.
- param_annotation_change
Bump level for parameter annotation changes.
- implementation_change
Bump level when a public symbol’s implementation changes without altering its signature.
Examples¶
Removing a public symbol triggers a major bump:
def add(a: int, b: int) -> int:
return a + b
# ``add`` removed
Changing a return type triggers a minor bump by default:
def greet() -> str:
return "hi"
def greet() -> int:
return 1
Analysers¶
[analysers]
cli = false
grpc = false
web_routes = false
migrations = false
openapi = false
graphql = false
Key |
Default |
CLI flag |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- cli
Detects changes to command-line interfaces implemented with
argparse
orclick
.- grpc
Detects gRPC service and method changes in
.proto
files.- web_routes
Tracks additions or removals of web routes in frameworks such as Flask or FastAPI.
- migrations
Scans Alembic migrations for schema impacts.
- openapi
Detects changes to OpenAPI specification files.
- graphql
Detects GraphQL schema changes.
Migrations¶
[migrations]
paths = ["migrations"]
- paths
Default:
["migrations"]
Directories containing Alembic migration scripts to inspect.
OpenAPI¶
[openapi]
paths = ["openapi.yaml", "openapi.yml", "openapi.json"]
- paths
Default:
["openapi.yaml", "openapi.yml", "openapi.json"]
Paths to OpenAPI specification documents.
Version¶
[version]
paths = [
"pyproject.toml",
"setup.py",
"setup.cfg",
"**/__init__.py",
"**/version.py",
"**/_version.py",
]
ignore = [
"build/**",
"dist/**",
"*.egg-info/**",
".eggs/**",
".venv/**",
"venv/**",
".env/**",
"**/__pycache__/**",
]
scheme = "semver"
Key |
Default |
CLI flag |
---|---|---|
|
|
|
|
|
|
|
|
(none) |
- paths
Glob patterns scanned for version declarations.
- ignore
Glob patterns appended to the default exclusion list for version replacement.
- scheme
Versioning scheme used when bumping. Supported values include
"semver"
and"calver"
.
Changelog¶
[changelog]
path = ""
template = ""
exclude = []
repo_url = ""
Key |
Default |
CLI flag |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
- path
Changelog file location. Empty string disables generation.
- template
Jinja2 template file. Empty string uses the built-in template.
- exclude
Regular expressions for commit subjects to omit.
- repo_url
Base repository URL for commit and compare links.
Examples¶
Custom version rules¶
[rules]
return_type_change = "major"
Ignore paths¶
[ignore]
paths = ["tests/**", "examples/**"]
Version file locations¶
[version]
paths = ["pyproject.toml", "setup.py", "src/pkg/__init__.py"]
ignore = ["examples/**"]
scheme = "semver"
Automatic bump with commit and tag¶
For a walkthrough that commits and tags the new version automatically, see guides/version-management/automatic-bump-commit-tag.
Environment variables¶
bumpwright
reads defaults for many CLI flags from environment variables.
Variable |
Default |
CLI flag |
Used by |
---|---|---|---|
|
|
|
all |
|
|
|
all |
|
|
|
all |
|
|
|
init |
|
last release or |
|
decide, bump |
|
|
|
decide, bump |
|
|
|
decide, bump, history |
|
|
|
decide, bump |
|
|
|
decide, bump |
|
|
|
decide, bump |
|
|
|
decide, bump |
|
|
|
bump |
|
|
|
bump |
|
|
|
bump |
|
|
|
bump |
|
|
|
bump |
|
|
|
bump |
|
|
|
decide, bump |
|
|
|
decide, bump |
|
|
|
history |
|
|
|
history |
|
|
|
history |
BUMPWRIGHT_CONFIG
Path to configuration file.
BUMPWRIGHT_QUIET
Only display warnings and errors.
BUMPWRIGHT_VERBOSE
Show debug messages.
BUMPWRIGHT_SUMMARY
Show project summary after initialisation.
BUMPWRIGHT_BASE
Base git reference when auto-deciding the level.
BUMPWRIGHT_HEAD
Head git reference.
BUMPWRIGHT_FORMAT
Output style for CLI commands.
BUMPWRIGHT_REPO_URL
Base repository URL for linking commit hashes in Markdown output.
BUMPWRIGHT_EXPLAIN
Show reasoning behind the selected bump level.
BUMPWRIGHT_ENABLE_ANALYSER
Enable analyser names in addition to configuration.
BUMPWRIGHT_DISABLE_ANALYSER
Disable analyser names even if configured.
BUMPWRIGHT_PYPROJECT
Path to the project’s
pyproject.toml
file.BUMPWRIGHT_VERSION_PATH
Additional glob pattern for files containing the project version.
BUMPWRIGHT_VERSION_IGNORE
Glob pattern for files to exclude from version updates.
BUMPWRIGHT_TAG
Create a git tag for the new version.
BUMPWRIGHT_DRY_RUN
Display the new version without modifying any files.
BUMPWRIGHT_CHANGELOG
Append release notes to a file or stdout when set to
-
.BUMPWRIGHT_CHANGELOG_TEMPLATE
Jinja2 template file for changelog entries.
BUMPWRIGHT_CHANGELOG_EXCLUDE
Regex pattern for commit subjects to exclude from the changelog.
BUMPWRIGHT_STATS
Include line change statistics between successive tags.
BUMPWRIGHT_ROLLBACK
Delete a tag and restore files to the previous commit.
BUMPWRIGHT_PURGE
Remove all bumpwright release tags and commits.
CLI equivalents¶
Many configuration keys have corresponding command-line flags. For a complete mapping, see the cli_reference.