Use git repo data for building a version number according PEP-440
Reason this release was yanked:
Fails build in case of using setup.py
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
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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f583ece37a4c12f70a450e03347b815db816c3f978177d43f84d1a39726cec7c |
|
MD5 | 2ac136eef679430174580311274b2ba3 |
|
BLAKE2b-256 | c8eda673db10bd4719c15dd33d87c7b6f185d2ea5cdc0de927ec0edecba65d81 |
Hashes for setuptools_git_versioning-1.8.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bab294cb80da70c523f9edc6c28ff24b762e2ebccb0a3b87be894618f67d2fb4 |
|
MD5 | 51d1bcb0934d8df19adb479e1be414a3 |
|
BLAKE2b-256 | 1aff9ea6c39017295ee48f64bb86e0c489f2cbed143b33de604e1c891fcdc092 |
Hashes for setuptools_git_versioning-1.8.0-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02c5f0cbd4bcf82b85de0d0f0126ea93b771edc34bc39d1e4deba14024ae7d01 |
|
MD5 | f8735be3a6c61e260e98e9b403eff8f2 |
|
BLAKE2b-256 | 0e23cc93e7312caba37687e2217f85ccbe004dc01a9805d96b7a73dff7ab6eda |