Skip to content

Instantly share code, notes, and snippets.

View thoron's full-sized avatar

Thomas Rondahl thoron

  • Umeå
  • 00:40 (UTC +02:00)
View GitHub Profile
@thoron
thoron / version.py
Last active November 18, 2017 03:18 — forked from snaewe/version.py
Added 'with' statment handling to 'closeable' operations and readlines() -> readline()
# -*- coding: utf-8 -*-
# Author: Douglas Creager <dcreager@dcreager.net>
# This file is placed into the public domain.
# Calculates the current version number. If possible, this is the
# output of “git describe”, modified to conform to the versioning
# scheme that setuptools uses. If “git describe” returns an error
# (most likely because we're in an unpacked copy of a release tarball,
# rather than in a git working copy), then we fall back on reading the
# contents of the RELEASE-VERSION file.