Versioning¶
FastPKI uses Semantic Versioning and bump-my-version for automated version management.
Current Version¶
To display the current version:
The single source of truth is the version field under [project] in
pyproject.toml (PEP 621). bump-my-version reads and updates it directly, so
there is no second copy to keep in sync.
Bumping the Version¶
Use the Makefile targets to bump the version:
# Patch release (v0.1.0 -> v0.1.1)
make bump-patch
# Minor release (v0.1.0 -> v0.2.0)
make bump-minor
# Major release (v0.1.0 -> v1.0.0)
make bump-major
Each bump will:
- Update the
versionfield under[project]inpyproject.toml(novprefix, e.g.0.2.0) - Create a git commit with the message
release: Bump version 0.1.0 -> 0.2.0 - Create a git tag with the
vprefix (e.g.,v0.2.0)
A bump requires a clean working tree (allow_dirty = false). Preview any bump
without changing anything:
Note
Bumps do not push to the remote automatically. Run git push && git push --tags when ready.
Configuration¶
The bump-my-version configuration lives in pyproject.toml:
[tool.bumpversion]
# current_version is omitted on purpose: bump-my-version reads and updates the
# PEP 621 [project].version, so there is a single source of truth.
allow_dirty = false
commit = true
tag = true
tag_name = "v{new_version}"
tag_message = "release: v{new_version}"
message = "release: Bump version {current_version} -> {new_version}"
Because current_version is omitted, the [project].version value is the only
place the version lives — there is no separate config field that can drift out
of sync.
Adding Version to More Files¶
To stamp the version into additional files, add a [[tool.bumpversion.files]]
table per file:
[[tool.bumpversion.files]]
filename = "app/__init__.py"
search = '__version__ = "{current_version}"'
replace = '__version__ = "{new_version}"'
Docker Image Versioning¶
The Dockerfile accepts a VERSION build argument that is stored as an OCI label:
This sets the org.opencontainers.image.version label on the image, which can be inspected with: