Mercurial > hg > ltpdarepo
annotate 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 |
rev | line source |
---|---|
213
3d524d31d1c2
Move setup.py to better location.
Daniele Nicolodi <daniele@grinta.net>
parents:
212
diff
changeset
|
1 from setuptools import setup, find_packages |
230
5c5f6d93d9d4
Add hg revision id to version string for dev builds.
Daniele Nicolodi <daniele@grinta.net>
parents:
225
diff
changeset
|
2 import os.path, subprocess |
0 | 3 |
225 | 4 version = '0.6dev' |
212 | 5 |
6 requires = [ | |
7 'distribute', | |
8 'Flask', | |
9 'WTForms', | |
10 'itsdangerous', | |
11 'python-dateutil < 2.0', | |
12 ] | |
13 | |
14 try: | |
15 import argparse | |
16 except ImportError: | |
17 # we have python < 2.7 | |
18 requires.append('argparse') | |
100
3024c77310d1
Minor cleanup of setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents:
50
diff
changeset
|
19 |
212 | 20 try: |
21 from collections import OrderedDict | |
22 except ImportError: | |
23 # we have python < 2.7 | |
24 requires.append('ordereddict') | |
25 | |
26 | |
230
5c5f6d93d9d4
Add hg revision id to version string for dev builds.
Daniele Nicolodi <daniele@grinta.net>
parents:
225
diff
changeset
|
27 if version.endswith('dev') and os.path.isdir('.hg'): |
5c5f6d93d9d4
Add hg revision id to version string for dev builds.
Daniele Nicolodi <daniele@grinta.net>
parents:
225
diff
changeset
|
28 # add hg revision id to version string |
5c5f6d93d9d4
Add hg revision id to version string for dev builds.
Daniele Nicolodi <daniele@grinta.net>
parents:
225
diff
changeset
|
29 p = subprocess.Popen(['hg', 'id', '--id'], |
5c5f6d93d9d4
Add hg revision id to version string for dev builds.
Daniele Nicolodi <daniele@grinta.net>
parents:
225
diff
changeset
|
30 stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
5c5f6d93d9d4
Add hg revision id to version string for dev builds.
Daniele Nicolodi <daniele@grinta.net>
parents:
225
diff
changeset
|
31 out, err = p.communicate() |
5c5f6d93d9d4
Add hg revision id to version string for dev builds.
Daniele Nicolodi <daniele@grinta.net>
parents:
225
diff
changeset
|
32 if not p.returncode: |
5c5f6d93d9d4
Add hg revision id to version string for dev builds.
Daniele Nicolodi <daniele@grinta.net>
parents:
225
diff
changeset
|
33 rev = out.strip().replace('+', '') |
5c5f6d93d9d4
Add hg revision id to version string for dev builds.
Daniele Nicolodi <daniele@grinta.net>
parents:
225
diff
changeset
|
34 version += '-' + rev |
5c5f6d93d9d4
Add hg revision id to version string for dev builds.
Daniele Nicolodi <daniele@grinta.net>
parents:
225
diff
changeset
|
35 |
5c5f6d93d9d4
Add hg revision id to version string for dev builds.
Daniele Nicolodi <daniele@grinta.net>
parents:
225
diff
changeset
|
36 |
212 | 37 setup(name='ltpdarepo', |
38 version=version, | |
39 keywords='', | |
40 author='Daniele Nicolodi', | |
41 author_email='nicolodi@science.unitn.it', | |
42 url='http://dev.grinta.net/hg/ltpdarepo/', | |
43 license='AGPLv3+', | |
44 | |
213
3d524d31d1c2
Move setup.py to better location.
Daniele Nicolodi <daniele@grinta.net>
parents:
212
diff
changeset
|
45 packages=find_packages(), |
3d524d31d1c2
Move setup.py to better location.
Daniele Nicolodi <daniele@grinta.net>
parents:
212
diff
changeset
|
46 package_dir={'': 'src'}, |
212 | 47 include_package_data=True, |
48 zip_safe=False, | |
49 install_requires=requires, | |
50 entry_points={ | |
51 'console_scripts': [ | |
52 'run = ltpdarepo:main', | |
53 'admin = ltpdarepo.admin:main', ] | |
54 } | |
55 ) |