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-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bd5bd8e423c64ce14588383736ed158283d29c73ada0f953feedb04d1f10555 |
|
MD5 | 0efd07b93cbbb043186e42f56d1b073f |
|
BLAKE2b-256 | 9ed46e5f6abebe46a438e1ece6eb9cb8a20ae08d818a022531f0862e6f416842 |
Hashes for semver_setuptools_git_version-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b49fc6e51d609e66a3f4eb122ba23e2d154a1ce0e496969be3e9193f08eaf344 |
|
MD5 | 9f50c60a354effdfe582617c20695c2e |
|
BLAKE2b-256 | 4b41f9d7e53bf1793df2aead51e2dbc7ba2041a9f34dade9d9f15939dc59d405 |