Skip to content

Instantly share code, notes, and snippets.

@mina86
mina86 / version.py
Last active December 10, 2022 04:07 — forked from dcreager/version.py
Extract a setuptools version from the git repository's tags.
# -*- coding: utf-8 -*-
"""Calculates the current version number.
If possible, uses output ofgit describemodified 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>)* ]