Skip to main content

Simple Git version plugin for setuptools

Project description

Simple Git version plugin for setuptools.

Usage

Add setuptools-gitver to setup_requires in the setup.py of your project. Then, after each release, add .post+gitver suffix to the version string.

For example, in setup.py:

import setuptools

if __name__ == '__main__':
    setuptools.setup(
        setup_requires=['setuptools-gitver'],
        name='example-package',
        version='1.2.3.post+gitver',
    )

This will then generate version numbers like 1.2.3.post0.dev7+ga1b2c3d where 7 is the number of commits since the v1.2.3 tag and a1b2c3d is commit id of the HEAD.

When creating a release, update the version and remove the post+gitver suffix. When there is no +gitver suffix, the version won’t be touched by Setuptools Gitver. Also remember to tag the release in Git with git tag -a v1.2.3.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

setuptools-gitver-0.1.0.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

setuptools_gitver-0.1.0-py2.py3-none-any.whl (5.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file setuptools-gitver-0.1.0.tar.gz.

File metadata

File hashes

Hashes for setuptools-gitver-0.1.0.tar.gz
Algorithm Hash digest
SHA256 77622e140ba3575d37ff391094d0f82e6d04d8443dc410e39afb27fc579bea71
MD5 9ed933b7d6eb49a431748f54065e5762
BLAKE2b-256 8907b8edca875eb38a8f1f5932c1c6f7cdaaf78b69dee038daa88a702622daa2

See more details on using hashes here.

File details

Details for the file setuptools_gitver-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for setuptools_gitver-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 379e5b9e48f04526c27c0b4c3d12e49ab336c1c3a3e5917ea8c97f72b0f76dfd
MD5 8446c4d242f78c21c2075a471c889c96
BLAKE2b-256 81a94b35f72c3feccd0b582162e92bf2d6e0a715be7618f4cfc3a43200c07a0b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page