Use git repo data for building a version number according PEP-440
Project description
Use git repo data (latest tag, current commit hash, etc) for building a version number according PEP 440.
Features:
Can be installed & configured through both setup.py and PEP 518’s pyproject.toml
Does 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 difference between setuptools-git-versioning and other tools.
Limitations:
Currently the only supported VCS is Git
Only git v2 is supported
Currently does not support exporting version to file for runtime use
Documentation
See https://setuptools-git-versioning.readthedocs.io/en/stable/
Contribution Guide
See ./CONTRIBUTING.rst
Install
pyproject.toml
Just add setuptools-git-versioning to build-sytem part of your pyproject.toml
[build-system]
requires = [ "setuptools>=41", "wheel", "setuptools-git-versioning", ]
build-backend = "setuptools.build_meta"
[tool.setuptools-git-versioning]
enabled = true
setup.py
Just add setuptools-git-versioning to setup_requires part of your setup.py
import setuptools
setuptools.setup(
...,
setuptools_git_versioning={
"enabled": True,
},
setup_requires=["setuptools-git-versioning"],
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for setuptools-git-versioning-1.9.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cee8ff9e73d2092f9e281a324a0a62c21e0cc66c233597c3d679f0b9cab0e40 |
|
MD5 | 39ab47218e0b21d5a091bb2df3ae6d02 |
|
BLAKE2b-256 | 6632334cb4c36a919faa629276d35b24a033335fc3f0a8257139369505d03985 |
Hashes for setuptools_git_versioning-1.9.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66acb4f5896956e5d2aec2250b1e41342a0bf3228e577d54171d9a06d5f8637b |
|
MD5 | 0a27f7e688ceb1579c74fca54c7b9fd4 |
|
BLAKE2b-256 | 9c28b16d2cda71bbb2fb4acfa61ccbe25a6c920964a37aab0e5ae51148182f87 |