comparison setup.py @ 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 9c2aa0e331e9
children 4b5f83e5a2fb
comparison
equal deleted inserted replaced
229:32fda28194d6 230:5c5f6d93d9d4
1 from setuptools import setup, find_packages 1 from setuptools import setup, find_packages
2 import os.path, subprocess
2 3
3 version = '0.6dev' 4 version = '0.6dev'
4 5
5 requires = [ 6 requires = [
6 'distribute', 7 'distribute',
21 except ImportError: 22 except ImportError:
22 # we have python < 2.7 23 # we have python < 2.7
23 requires.append('ordereddict') 24 requires.append('ordereddict')
24 25
25 26
27 if version.endswith('dev') and os.path.isdir('.hg'):
28 # add hg revision id to version string
29 p = subprocess.Popen(['hg', 'id', '--id'],
30 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
31 out, err = p.communicate()
32 if not p.returncode:
33 rev = out.strip().replace('+', '')
34 version += '-' + rev
35
36
26 setup(name='ltpdarepo', 37 setup(name='ltpdarepo',
27 version=version, 38 version=version,
28 keywords='', 39 keywords='',
29 author='Daniele Nicolodi', 40 author='Daniele Nicolodi',
30 author_email='nicolodi@science.unitn.it', 41 author_email='nicolodi@science.unitn.it',