Versioning¶
FastPKI uses Semantic Versioning and bumpver for automated version management.
Current Version¶
To display the current version:
The version is defined in pyproject.toml and kept in sync automatically by bumpver.
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 inpyproject.toml(PEP 440 format, without thevprefix) - Update
current_versionin the[tool.bumpver]section (withvprefix) - Create a git commit with the message
release: Bump version vX.Y.Z -> vX.Y.Z - Create a git tag (e.g.,
v0.2.0)
Note
Bumps do not push to the remote automatically. Run git push && git push --tags when ready.
Configuration¶
The bumpver configuration lives in pyproject.toml:
[tool.bumpver]
current_version = "v0.1.0"
version_pattern = "vMAJOR.MINOR.PATCH"
commit_message = "release: Bump version {old_version} -> {new_version}"
commit = true
tag = true
push = false
[tool.bumpver.file_patterns]
"pyproject.toml" = [
'version = "{pep440_version}"',
]
The {pep440_version} placeholder ensures that pyproject.toml contains the PEP 440 version (e.g., 0.1.0) while git tags use the v prefix (e.g., v0.1.0).
Adding Version to More Files¶
To stamp the version into additional files, add entries under [tool.bumpver.file_patterns]:
[tool.bumpver.file_patterns]
"pyproject.toml" = [
'version = "{pep440_version}"',
]
"app/__init__.py" = [
'__version__ = "{pep440_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: