Skip to main content

Use git repo data for building a version number according PEP-440

Project description

Project Status: Active – The project has reached a stable, usable state and is being actively developed. PyPI PyPI License PyPI Python Version ReadTheDocs Build Coverage

Use git repo data (latest tag, current commit hash, etc) for building a version number according PEP 440.


  • Can be installed & configured through both and PEP 518’s pyproject.toml
  • Does not require to change source code of the project
  • Tag-, file-, and callback-based versioning schemas are supported
  • Templates for tag, dev and dirty versions are separated
  • Templates support a lot of substitutions including git and environment information
  • Well-documented

See difference between setuptools-git-versioning and other tools.


  • Currently the only supported VCS is Git
  • Only git v2 is supported
  • Currently does not support exporting version to file for runtime use

Contribution Guide




Just add setuptools-git-versioning to build-sytem part of your pyproject.toml

requires = [ "setuptools>=41", "wheel", "setuptools-git-versioning", ]
build-backend = "setuptools.build_meta"

enabled = true

Just add setuptools-git-versioning to setup_requires part of your

import setuptools

        "enabled": True,

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-git-versioning-1.10.0.tar.gz (7.7 kB view hashes)

Uploaded source

Built Distribution

Supported by

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