setuptools-git-versioning¶
Use git repo data (latest tag, current commit hash, etc) for building a version number according to PEP 440.
Features:
Can be installed & configured through both
setup.pyand PEP 518’spyproject.tomlDoes not require to change source code of the project
Tag-, file-, and callback-based versioning schemas are supported
Templates for tag, dev and dirty versions are separated
Templates support a lot of substitutions including git and environment information
Well-documented
See comparison
between setuptools-git-versioning and other tools.
Limitations:
Currently the only supported VCS is Git
Only Git v2 is supported
Setuptools and scikit-build-core build backends are supported (no Poetry & others)
Currently does not support automatic exporting of package version to a file for runtime use (but you can use
setuptools-git-versioning > fileredirect instead)