-
Notifications
You must be signed in to change notification settings - Fork 13
/
setup.py
64 lines (52 loc) · 1.92 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
63
64
#!/usr/bin/env python
"""Setup file for osmosis"""
import urllib
import zipfile
import os
import sys
# If the data is not already there:
if not os.path.exists('./osmosis/data'):
# You might need to get the data:
print ("Downloading test-data from arokem.org...")
# Get the test data and put it in the right place
f=urllib.urlretrieve("http://arokem.org/data/osmosis_test_data.zip")[0]
zf = zipfile.ZipFile(f)
zf.extractall(path='./osmosis/')
# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
# update it when the contents of directories change.
if os.path.exists('MANIFEST'):
os.remove('MANIFEST')
from distutils.core import setup
# Get version and release info, which is all stored in nitime/version.py
ver_file = os.path.join('osmosis', 'version.py')
execfile(ver_file)
opts = dict(name=NAME,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
url=URL,
download_url=DOWNLOAD_URL,
license=LICENSE,
classifiers=CLASSIFIERS,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
platforms=PLATFORMS,
version=VERSION,
packages=PACKAGES,
package_data=PACKAGE_DATA,
requires=REQUIRES,
scripts=[BIN + x for x in os.listdir(BIN)],
)
# For some commands, use setuptools. Note that we do NOT list install here!
# If you want a setuptools-enhanced install, just run 'setupegg.py install'
needs_setuptools = set(('develop', ))
if len(needs_setuptools.intersection(sys.argv)) > 0:
import setuptools
# Only add setuptools-specific flags if the user called for setuptools, but
# otherwise leave it alone
if 'setuptools' in sys.modules:
opts['zip_safe'] = False
# Now call the actual setup function
if __name__ == '__main__':
setup(**opts)