Skip to content

Instantly share code, notes, and snippets.

@knabar
knabar / version.py
Created January 14, 2016 09:00 — forked from mina86/version.py
Extract a setuptools version from the git repository's tags.
# -*- coding: utf-8 -*-
"""Calculates the current version number.
If possible, uses output of “git describe” modified to conform to the
visioning scheme that setuptools uses (see PEP 386). Releases must be
labelled with annotated tags (signed tags are annotated) of the following
format:
v<num>(.<num>)+ [ {a|b|c|rc} <num> (.<num>)* ]