Skip to main content

A set of plugins for setuptools_scm to enable better version tracking

Project description

A set of plugins for setuptools_scm to enable better version tracking


pip install pygitversion


The usage is almost exactly the same as using setuptools_scm, so follow those guidelines. This package merely adds a couple of plugin functions to make the versioning a bit better (eg. having the branch name in the version if applicable).

To summarise: create a pyproject.toml and include (at least) the following lines:

# pyproject.toml
requires = ["setuptools>=30.3.0", "wheel", "setuptools_scm", "pygitversion"]

Then in your, add the following to the call to setup():

from setuptools import setup
from pygitversion import branch_scheme

        "local_scheme": branch_scheme

You can now print the version of the package simply by doing:

$ python --version

To set the version of your code, make your have the following:

from pkg_resources import get_distribution, DistributionNotFound
    __version__ = get_distribution(__name__).version
except DistributionNotFound:
    # package is not installed

And that’s it!


To run the all tests run:




  • Move to setuptools_scm

0.1.0 (2019-09-04)

  • First release on PyPI.

Project details

Download files

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

Files for pygitversion, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size pygitversion-1.0.1-py2.py3-none-any.whl (4.4 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size pygitversion-1.0.1.tar.gz (7.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page