Skip to main content

A simple tool for extracting version information from git tags and formatting it with optional post-release commit info.

The post-release commit info can tell you if there have been additional commits beyond the revision tagged with the release version. For example, an output of 1.0.0+git-1-123abcd would indicate that the version in use is one commit after the 1.0.0 release, with the current commit having a SHA of 123abcd.

Installation

Install from PyPI:

pip install vergit

Usage

Full usage:

vergit [-h] [--format {long,short,default,json}] [path]

The path can be omitted and defaults to the current directory.

There are several different formats which can be used:

  • long Always include the git revision info.

  • short Never include the git revision info.

  • default Hide the git revision info unless the current release is a pre-release or there are additional commits after the release.

  • json Output JSON data describing the version, in the form:

{
  "version": "1.0.0",
  "git": "+git-0-123abcd",
  "gitn": "0",
  "gitsha": "123abcd",
  "pre_release": true
}

Download files

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

Source Distribution

vergit-1.0.0.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file vergit-1.0.0.tar.gz.

File metadata

  • Download URL: vergit-1.0.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for vergit-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5510fe796ba5cbe5812399a79cb03526f9da55da8582f7e0ead374b24020cc5f
MD5 fa7ad24812f3127028be7110f482abfb
BLAKE2b-256 d2d18d603b59bea9e1e11b28d3921d98b192f5152ac6369fe6a7146cae960cca

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.2

1 file

1.0.1

1 file

This release

1.0.0 This release

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page