Skip to main content

Automatically set package version using git tag/hash

Project description

setuptools-git-ver

PyPI version Build Status

Automatically set package version using git tag/hash

Install

Install using pip

Usage

To just use the default templates for versioning:

setuptools.setup(
    ...
    version_config=True,
    ...
    setup_requires=['setuptools-git-ver'],
    ...
)

Changing templates (also shows the defaults):

setuptools.setup(
    ...
    version_config={
        "template": "{tag}",
        "dev_template": "{tag}.dev{ccount}+git.{sha}"
        "dirty_template": "{tag}.dev{ccount}+git.{sha}.dirty"
    },
    ...
    setup_requires=['setuptools-git-ver'],
    ...
)

Templates

  • template: used if no untracked files and latest commit is tagged

  • dev_template: used if no untracked files and latest commit isn't tagged

  • dirty_template: used if untracked files exist or uncommitted changes have been made

Format Options

  • {tag}: Latest tag in the repository

  • {ccount}: Number of commits since last tag

  • {sha}: First 8 characters of the sha hash of the latest commit

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 setuptools-git-ver, version 1.0.4
Filename, size File type Python version Upload date Hashes
Filename, size setuptools_git_ver-1.0.4-py3-none-any.whl (4.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size setuptools-git-ver-1.0.4.tar.gz (3.5 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 Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page