Automatically set package version using git tags with semver ordering.
Project description
semver-setuptools-git-version
Automatically set package version from Git. This is a re-release of better-setuptools-git-version with fixes and improvements for semver ordering, which is itself a re-release of setuptools-git-version
Introduction
Instead of hard-coding the package version in setup.py
like:
setup(
name='foobar',
version='1.0',
...
)
this package allows to extract it from tags in the underlying Git repository:
setup(
name='foobar',
version_config={
"version_format": "{tag}.dev{sha}",
"starting_version": "0.1.0"
},
setup_requires=['semver-setuptools-git-version'],
...
)
The tool uses the semantically-latest tag as the base version. If there are no annotated tags, the version specified by starting_version
will be used. If HEAD
is at the tag, the version will be the tag itself. If there are commits ahead of the tag, the first 8 characters of the sha of the HEAD
commit will be included.
In all the above cases, if the working tree is also dirty or contains untracked files, a +dirty
suffix will be appended to the version.
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 semver-setuptools-git-version-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bbe8e8a8a3b061371e50422f266589d4d0386406eb92e10e60c6de3a199f272 |
|
MD5 | 3a058ad53c935677bc3efcb68bcd68a8 |
|
BLAKE2b-256 | 10d95d8eea99f58290eaa757b6fb60e053b799adc91537fdbbec089e8731022d |
Hashes for semver_setuptools_git_version-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02786e205fd4e81b0f97d1dbb7bcb1db5ba054cdea72df26217fe573dec72de9 |
|
MD5 | 3419ff1a46df19b861a83d4a2ea09058 |
|
BLAKE2b-256 | 3ee1e9ad4d1ca7cdfe63b4d06562b09fab6795985889cefe52dee2b21547ae32 |