Skip to content

Instantly share code, notes, and snippets.

View ryanvolz's full-sized avatar

Ryan Volz ryanvolz

View GitHub Profile
@ludwigschwardt
ludwigschwardt / version.py
Last active November 18, 2017 03:35 — forked from mina86/version.py
Produce a setuptools-compatible package version number based on git tags
# -*- coding: utf-8 -*-
"""Calculate the current package version number based on git tags.
If possible, use the output of “git describe” modified to conform to the
versioning 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>)* ]