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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d33f34933ef8fce3a519dad42672134704d8372de926ab482d28142bb4521bb |
|
MD5 | 7a3d88b13e5974ea2b90a0b32ce68845 |
|
BLAKE2b-256 | 9f964789fab9de1ce95fb769e938e360bd4d3180d91804ba1881a743aab9f4f5 |
Hashes for semver_setuptools_git_version-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9661d5b2828f0a6c7196979949373fbb487135cb20af2a09894061d4c73fbbe4 |
|
MD5 | 6bf43df0fe98296f09fa1e40febb9553 |
|
BLAKE2b-256 | 5730574a587cd8fe59fd2325ac002d80942884a386ab23a4d8168520a8095d70 |