uv-dynamic-versioning
uv-dynamic-versioning is a plugin for `uv` (and `hatch`) that provides dynamic versioning capabilities for Python projects, typically by deriving versions from Git VCS tags. It's built on top of `setuptools_scm` and offers various configuration options for version formatting and bumping. The current version is 0.14.0, with frequent minor releases addressing features, bug fixes, and documentation.
Warnings
- breaking Starting from v0.9.0, `uv-dynamic-versioning` no longer auto-coerces configuration values. Boolean and other types must be set explicitly with their correct type.
- gotcha The minimum Python version requirement was raised to 3.10.
- gotcha When using `uv build`, remember that `uv` has its own build cache. If you change Git tags or commit messages that should alter the version, `uv` might serve a cached wheel with an old version string.
- gotcha `uv-dynamic-versioning` primarily integrates with build systems (like `uv` or `hatch`) and modifies the project's version metadata during the build process. It's not a library intended for direct programmatic import and use within application code.
Install
-
pip install uv-dynamic-versioning
Imports
- uv-dynamic-versioning
This library is primarily configured via `pyproject.toml` and invoked indirectly through build tools like `uv` or `hatch`. Direct Python imports are not a typical use case for end-users.
Quickstart
# pyproject.toml [project] name = "my-dynamic-project" version = "0.0.0" # This placeholder will be overwritten by uv-dynamic-versioning [tool.uv-dynamic-versioning] # Optional: Specify version source and style source = "git_archive" style = "default" # Terminal pip install uv uv-dynamic-versioning git init git add . git commit -m "Initial commit" git tag 0.1.0 uv build