Mercurial > hg > ltpdarepo
annotate setup.py @ 235:e1800a0170ae
Version bump.
author | Daniele Nicolodi <daniele@grinta.net> |
---|---|
date | Thu, 01 Dec 2011 17:24:31 +0100 |
parents | 48adc0d70d22 |
children | ce09aed4a90b |
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 |
235 | 4 version = '0.7dev' |
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 |
232
4b5f83e5a2fb
Fix setup.py for the case where executing 'hg' fails.
Daniele Nicolodi <daniele@grinta.net>
parents:
230
diff
changeset
|
29 try: |
4b5f83e5a2fb
Fix setup.py for the case where executing 'hg' fails.
Daniele Nicolodi <daniele@grinta.net>
parents:
230
diff
changeset
|
30 p = subprocess.Popen(['hg', 'id', '--id'], |
4b5f83e5a2fb
Fix setup.py for the case where executing 'hg' fails.
Daniele Nicolodi <daniele@grinta.net>
parents:
230
diff
changeset
|
31 stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
4b5f83e5a2fb
Fix setup.py for the case where executing 'hg' fails.
Daniele Nicolodi <daniele@grinta.net>
parents:
230
diff
changeset
|
32 out, err = p.communicate() |
4b5f83e5a2fb
Fix setup.py for the case where executing 'hg' fails.
Daniele Nicolodi <daniele@grinta.net>
parents:
230
diff
changeset
|
33 if not p.returncode: |
4b5f83e5a2fb
Fix setup.py for the case where executing 'hg' fails.
Daniele Nicolodi <daniele@grinta.net>
parents:
230
diff
changeset
|
34 rev = out.strip().replace('+', '') |
4b5f83e5a2fb
Fix setup.py for the case where executing 'hg' fails.
Daniele Nicolodi <daniele@grinta.net>
parents:
230
diff
changeset
|
35 version += '-' + rev |
4b5f83e5a2fb
Fix setup.py for the case where executing 'hg' fails.
Daniele Nicolodi <daniele@grinta.net>
parents:
230
diff
changeset
|
36 except OSError: |
4b5f83e5a2fb
Fix setup.py for the case where executing 'hg' fails.
Daniele Nicolodi <daniele@grinta.net>
parents:
230
diff
changeset
|
37 pass |
230
5c5f6d93d9d4
Add hg revision id to version string for dev builds.
Daniele Nicolodi <daniele@grinta.net>
parents:
225
diff
changeset
|
38 |
5c5f6d93d9d4
Add hg revision id to version string for dev builds.
Daniele Nicolodi <daniele@grinta.net>
parents:
225
diff
changeset
|
39 |
212 | 40 setup(name='ltpdarepo', |
41 version=version, | |
42 keywords='', | |
43 author='Daniele Nicolodi', | |
44 author_email='nicolodi@science.unitn.it', | |
45 url='http://dev.grinta.net/hg/ltpdarepo/', | |
46 license='AGPLv3+', | |
47 | |
213
3d524d31d1c2
Move setup.py to better location.
Daniele Nicolodi <daniele@grinta.net>
parents:
212
diff
changeset
|
48 packages=find_packages(), |
3d524d31d1c2
Move setup.py to better location.
Daniele Nicolodi <daniele@grinta.net>
parents:
212
diff
changeset
|
49 package_dir={'': 'src'}, |
212 | 50 include_package_data=True, |
51 zip_safe=False, | |
52 install_requires=requires, | |
53 entry_points={ | |
54 'console_scripts': [ | |
55 'run = ltpdarepo:main', | |
56 'admin = ltpdarepo.admin:main', ] | |
57 } | |
58 ) |