-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
97 lines (85 loc) · 3.4 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/usr/bin/env python
import os
import sys
import time
# Install setuptools if it isn't available:
try:
import setuptools
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages, Extension
from distutils.command.install import INSTALL_SCHEMES
from distutils.sysconfig import get_python_version
# This is overwritten by Cython.Distutils.build_ext during package installation:
from distutils.command import build_ext
# This enables the installation of __init__.py files in
# namespace packages:
for scheme in INSTALL_SCHEMES.values():
scheme['data'] = scheme['platlib']
NAME = 'bionet.ted'
VERSION = '0.7.1'
AUTHOR = 'Lev Givon'
AUTHOR_EMAIL = 'lev@columbia.edu'
URL = 'https://github.com/bionet/ted.python/'
MAINTAINER = 'Lev Givon'
MAINTAINER_EMAIL = 'lev@columbia.edu'
DESCRIPTION = 'Time Encoding and Decoding Toolkit'
DOWNLOAD_URL = URL
LICENSE = 'BSD'
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Scientific/Engineering',
'Topic :: Software Development']
metadata = dict(name = NAME,
version = VERSION,
author = AUTHOR,
author_email = AUTHOR_EMAIL,
url = URL,
maintainer = MAINTAINER,
maintainer_email = MAINTAINER_EMAIL,
description = DESCRIPTION,
license = LICENSE,
classifiers = CLASSIFIERS,
packages = find_packages(),
data_files = [('bionet', ['bionet/__init__.py'])],
namespace_packages = ['bionet'],
install_requires = ['cython >= 0.20.0',
'numpy >= 1.2.0',
'scipy >= 0.7.0'],
extras_require = dict(
matplotlib = 'matplotlib >= 0.98',
opencv = 'opencv >= 2.1.0',
tables = 'tables >= 2.1.1',
sphinx = 'sphinx >= 1.3',
sphinx_rtd_theme = 'sphinx_rtd_theme >= 0.1.6'))
# Don't attempt to import numpy when it isn't actually needed; this enables pip
# to install numpy before bottleneck:
ext_modules = []
if not(len(sys.argv) >= 2 and ('--help' in sys.argv[1:] or \
sys.argv[1] in ('--help-commands', 'egg_info', '--version', 'clean'))):
# Needed to build pyx files:
try:
from Cython.Distutils import build_ext
except:
pass
else:
if sys.platform in ['linux2', 'darwin']:
# Need numpy include files to compile BPA extension:
import numpy as np
ext_name = 'bionet.ted.bpa_cython_' + sys.platform
ext_modules = [Extension(ext_name,
['bionet/ted/bpa_cython.pyx'],
[np.get_include()],
libraries=['python' + get_python_version()])]
metadata['ext_modules'] = ext_modules
metadata['cmdclass'] = {'build_ext': build_ext}
if __name__ == '__main__':
if os.path.exists('MANIFEST'):
os.remove('MANIFEST')
setup(**metadata)