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 pre-commit.ci

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

Features:

  • Can be installed & configured through both setup.py 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.

Limitations:

  • Currently the only supported VCS supported is Git

  • Only git v2 is supported

  • Currently does not support exporting version to file for runtime use

Documentation

See https://setuptools-git-versioning.readthedocs.io/en/stable/

Contribution Guide

See ./CONTRIBUTING.rst

Install

pyproject.toml

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

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

[tool.setuptools-git-versioning]
enabled = true

setup.py

Just add setuptools-git-versioning to setup_requires part of your setup.py

import setuptools

setuptools.setup(
    ...,
    setuptools_git_versioning={
        "enabled": True,
    },
    setup_requires=["setuptools-git-versioning"],
)

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.8.1.tar.gz (8.3 kB view details)

Uploaded Source

Built Distributions

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

setuptools_git_versioning-1.8.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

setuptools_git_versioning-1.8.1-py2-none-any.whl (7.9 kB view details)

Uploaded Python 2

File details

Details for the file setuptools-git-versioning-1.8.1.tar.gz.

File metadata

  • Download URL: setuptools-git-versioning-1.8.1.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for setuptools-git-versioning-1.8.1.tar.gz
Algorithm Hash digest
SHA256 056224c3a4868a96eafd14a454e965cd150d72b1431b5aac319ae8aff5cd99aa
MD5 1d0d1e1408f8622812c595a32dbfcfc8
BLAKE2b-256 101c56490ed5fffee4dd6596c6375f2ae1599fd1537bb83681f1bac58b6357f1

See more details on using hashes here.

File details

Details for the file setuptools_git_versioning-1.8.1-py3-none-any.whl.

File metadata

  • Download URL: setuptools_git_versioning-1.8.1-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for setuptools_git_versioning-1.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 831ce09ac9e1cb9a0daeb39849fd32a9c33b11a35df8bb2e02a23a25dd343e92
MD5 3ca2b7bf4317dd8255b7a20f58d95cff
BLAKE2b-256 2c911e3eab4cdedbebf5ebbf0f5e4d144469acaba603381625ec4b088b0450ee

See more details on using hashes here.

File details

Details for the file setuptools_git_versioning-1.8.1-py2-none-any.whl.

File metadata

  • Download URL: setuptools_git_versioning-1.8.1-py2-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.2 requests/2.27.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/2.7.18

File hashes

Hashes for setuptools_git_versioning-1.8.1-py2-none-any.whl
Algorithm Hash digest
SHA256 63df93a29aea743a14209ff339bf2b4db27684ff9133b8faa0f89e331151aaee
MD5 a734520167e07e3d7b1b686b820b355e
BLAKE2b-256 c8448b90b1d628fc86717ebd70d8932d56fde1cd7bcc1b671bda6ca87e7ee99e

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