annotate setup.py @ 234:48adc0d70d22 0.6

Release 0.6
author Daniele Nicolodi <daniele@grinta.net>
date Thu, 01 Dec 2011 17:24:11 +0100
parents 4b5f83e5a2fb
children e1800a0170ae
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
c812c3020b63 Initial import.
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff changeset
3
234
48adc0d70d22 Release 0.6
Daniele Nicolodi <daniele@grinta.net>
parents: 232
diff changeset
4 version = '0.6'
212
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
5
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
6 requires = [
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
7 'distribute',
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
8 'Flask',
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
9 'WTForms',
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
10 'itsdangerous',
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
11 'python-dateutil < 2.0',
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
12 ]
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
13
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
14 try:
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
15 import argparse
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
16 except ImportError:
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
17 # we have python < 2.7
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
18 requires.append('argparse')
100
3024c77310d1 Minor cleanup of setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 50
diff changeset
19
212
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
20 try:
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
21 from collections import OrderedDict
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
22 except ImportError:
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
23 # we have python < 2.7
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
24 requires.append('ordereddict')
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
25
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
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
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
40 setup(name='ltpdarepo',
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
41 version=version,
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
42 keywords='',
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
43 author='Daniele Nicolodi',
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
44 author_email='nicolodi@science.unitn.it',
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
45 url='http://dev.grinta.net/hg/ltpdarepo/',
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
46 license='AGPLv3+',
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
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
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
50 include_package_data=True,
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
51 zip_safe=False,
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
52 install_requires=requires,
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
53 entry_points={
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
54 'console_scripts': [
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
55 'run = ltpdarepo:main',
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
56 'admin = ltpdarepo.admin:main', ]
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
57 }
ca6999a5b402 Better setup.py.
Daniele Nicolodi <daniele@grinta.net>
parents: 191
diff changeset
58 )