Automatically set package version using git tag/hash
Project description
setuptools-git-versioning
Automatically set package version using git tag/hash
Compairing with other packages
Package/Function | Lastest release | Python2 support | Python3 support | PEP 440 compatible | Separated template for not tagged HEAD | Separated template for dirty run | Using functions outside setup.py | Returning starting_version if no tags |
---|---|---|---|---|---|---|---|---|
setuptools-git-versioning | 2020 | + | + | + | + | + | + | + |
setuptools-git-ver (Base package) | 2020 | - | + | + | + | + | - | - |
even-better-setuptools-git-version | 2019 | - | + | + | - | - | + | + |
better-setuptools-git-version | 2018 | - | + | + | - | - | + | + |
very-good-setuptools-git-version | 2018 | - | + | - | - | - | + | - |
setuptools-git-version | 2018 | + | + | - | - | - | - | - |
Installation
No need.
Adding setup_requires=['setuptools-git-versioning']
somewhere in setup.py
will automatically download the latest version from PyPi and save it in the .eggs
folder when setup.py
is run.
Usage
To just use the default templates for versioning:
setuptools.setup(
...
version_config=True,
...
setup_requires=['setuptools-git-versioning'],
...
)
Changing templates (also shows the defaults):
setuptools.setup(
...
version_config={
"template": "{tag}",
"dev_template": "{tag}.dev{ccount}+git.{sha}"
"dirty_template": "{tag}.dev{ccount}+git.{sha}.dirty",
"starting_version": "0.0.1"
},
...
setup_requires=['setuptools-git-versioning'],
...
)
Templates
-
template
: used if no untracked files and latest commit is tagged -
dev_template
: used if no untracked files and latest commit isn't tagged -
dirty_template
: used if untracked files exist or uncommitted changes have been made -
starting_version
: static value, used if not tags exist in repo
Format Options
-
{tag}
: Latest tag in the repository -
{ccount}
: Number of commits since last tag -
{sha}
: First 8 characters of the sha hash of the latest commit -
{branch}
: Current branch name
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.1.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ce7a09310cac5129c70ee2199d1a19740085cf5698edcaf225091e953a473c2 |
|
MD5 | 4918fa7b5948debb573a89d817edb035 |
|
BLAKE2b-256 | 118a0a1c6b6aa14156ff049c46374184ac303ad522b6b4453612b36e3e347714 |
Hashes for setuptools_git_versioning-1.1.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6af2c7c683c56b70361d825cd0223658c444af57f058ccb6b1ae499f35cb4ea0 |
|
MD5 | c95ea965eeed0ce4528c48d5838c7843 |
|
BLAKE2b-256 | 183d3c611a9ec654572c2e52d0ad549667ec4192c2749321b6bf0cce9f954632 |
Hashes for setuptools_git_versioning-1.1.10-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 819eabbee001af2d7eb931b4eb0738f58bc19824011434b6cda89e078a4d9428 |
|
MD5 | d79ccc20dadf540d1fc23757c513a25b |
|
BLAKE2b-256 | f2e24a6c169bbf5995bb4cf7797b1e49d15fced6a5bbe8556345a860924fb7c5 |