Mercurial > hg > ltpdarepo
changeset 230:5c5f6d93d9d4
Add hg revision id to version string for dev builds.
author | Daniele Nicolodi <daniele@grinta.net> |
---|---|
date | Wed, 30 Nov 2011 09:41:29 +0100 |
parents | 32fda28194d6 |
children | a198738e3187 |
files | setup.py |
diffstat | 1 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/setup.py Thu Nov 24 18:24:53 2011 +0100 +++ b/setup.py Wed Nov 30 09:41:29 2011 +0100 @@ -1,4 +1,5 @@ from setuptools import setup, find_packages +import os.path, subprocess version = '0.6dev' @@ -23,6 +24,16 @@ requires.append('ordereddict') +if version.endswith('dev') and os.path.isdir('.hg'): + # add hg revision id to version string + p = subprocess.Popen(['hg', 'id', '--id'], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out, err = p.communicate() + if not p.returncode: + rev = out.strip().replace('+', '') + version += '-' + rev + + setup(name='ltpdarepo', version=version, keywords='',