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 supported 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 Distributions
Hashes for setuptools-git-versioning-1.8.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 056224c3a4868a96eafd14a454e965cd150d72b1431b5aac319ae8aff5cd99aa |
|
MD5 | 1d0d1e1408f8622812c595a32dbfcfc8 |
|
BLAKE2b-256 | 101c56490ed5fffee4dd6596c6375f2ae1599fd1537bb83681f1bac58b6357f1 |
Hashes for setuptools_git_versioning-1.8.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 831ce09ac9e1cb9a0daeb39849fd32a9c33b11a35df8bb2e02a23a25dd343e92 |
|
MD5 | 3ca2b7bf4317dd8255b7a20f58d95cff |
|
BLAKE2b-256 | 2c911e3eab4cdedbebf5ebbf0f5e4d144469acaba603381625ec4b088b0450ee |
Hashes for setuptools_git_versioning-1.8.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63df93a29aea743a14209ff339bf2b4db27684ff9133b8faa0f89e331151aaee |
|
MD5 | a734520167e07e3d7b1b686b820b355e |
|
BLAKE2b-256 | c8448b90b1d628fc86717ebd70d8932d56fde1cd7bcc1b671bda6ca87e7ee99e |