-
Notifications
You must be signed in to change notification settings - Fork 18
/
setup.py
executable file
·62 lines (56 loc) · 2.36 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env python
from setuptools import setup, find_packages
import os, re
PKG='simplegeo'
VERSIONFILE = os.path.join('simplegeo', '_version.py')
verstr = "unknown"
try:
verstrline = open(VERSIONFILE, "rt").read()
except EnvironmentError:
pass # Okay, there is no version file.
else:
MVSRE = r"^manual_verstr *= *['\"]([^'\"]*)['\"]"
mo = re.search(MVSRE, verstrline, re.M)
if mo:
mverstr = mo.group(1)
else:
print "unable to find version in %s" % (VERSIONFILE,)
raise RuntimeError("if %s.py exists, it must be well-formed" % (VERSIONFILE,))
AVSRE = r"^auto_build_num *= *['\"]([^'\"]*)['\"]"
mo = re.search(AVSRE, verstrline, re.M)
if mo:
averstr = mo.group(1)
else:
averstr = ''
verstr = '.'.join([mverstr, averstr])
setup_requires = []
tests_require = ['mock']
# nosetests is an optional way to get code-coverage results. Uncomment
# the following and run "python setup.py nosetests --with-coverage.
# --cover-erase --cover-tests --cover-inclusive --cover-html"
# tests_require.extend(['coverage', 'nose'])
# trialcoverage is another optional way to get code-coverage
# results. Uncomment the following and run "python setup.py trial
# --reporter=bwverbose-coverage -s simplegeo.test".
# setup_requires.append('setuptools_trial')
# tests_require.extend(['setuptools_trial', 'trialcoverage'])
# As of 2010-11-22 neither of the above options appear to work to
# generate code coverage results, but the following does:
# rm -rf ./.coverage* htmlcov ; coverage run --branch --include=simplegeo/* setup.py test ; coverage html
setup(name=PKG,
version=verstr,
description="Library for interfacing with SimpleGeo's API",
author="Zooko Wilcox-O'Hearn and Ben Standefer",
author_email="ben@simplegeo.com",
url="http://github.com/simplegeo/python-simplegeo",
packages = find_packages(),
license = "MIT License",
install_requires=['httplib2>=0.6.0',
'oauth2>=1.5',
'ipaddr >= 2.0.0',
'simplejson >= 2.1.0'],
keywords="simplegeo",
zip_safe=False, # actually it is zip safe, but zipping packages doesn't help with anything and can cause some problems (http://bugs.python.org/setuptools/issue33 )
test_suite='simplegeo.test',
setup_requires=setup_requires,
tests_require=tests_require)