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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file setuptools-git-versioning-1.1.13.tar.gz.
File metadata
- Download URL: setuptools-git-versioning-1.1.13.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99bee8aa3767d236057fa195959280facbf321d819998b6bd6667bc0d16ae0db
|
|
| MD5 |
7d317092d6e6c3a4d06122425a29989a
|
|
| BLAKE2b-256 |
dbefe8fa99c0ebf864550450817791b9725a7e6feefb4b34a4bbf45c5a13b22f
|
File details
Details for the file setuptools_git_versioning-1.1.13-py3-none-any.whl.
File metadata
- Download URL: setuptools_git_versioning-1.1.13-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
396c343e1cb0101aadead622eb042f3c05624685dd05f0a4338bad4a2437752d
|
|
| MD5 |
d619abb6d125541214fada05a7b01a66
|
|
| BLAKE2b-256 |
9bbff84d76a19e8afb40bd29437a330570f36bda4de47145d3ee13d7d3604c67
|
File details
Details for the file setuptools_git_versioning-1.1.13-py2-none-any.whl.
File metadata
- Download URL: setuptools_git_versioning-1.1.13-py2-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/2.7.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00052496e520793545a49cfdfcd5232fbfb0b7ecef2045bf72fcd15568cddcf2
|
|
| MD5 |
9e52719a1f43f5c323252a6a61aa638d
|
|
| BLAKE2b-256 |
4526e6af9b68f2af7d399d41b1c4e2db1500e6d257562553bbe2886e3ef2d358
|