forked from bowman-lab/enspara
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·116 lines (104 loc) · 3.35 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import platform
import sys
from setuptools import find_packages
from distutils.core import setup
from distutils.extension import Extension
__version__ = '0.1.0'
CLASSIFIERS = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Programming Language :: Cython",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering :: Chemistry",
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: MacOS",
]
# protect agaist absent cython/numpy
try:
import numpy as np
import Cython
if Cython.__version__ < '0.19':
raise ImportError
from Cython.Build import cythonize
except ImportError:
sys.stderr.write('-' * 80)
sys.stderr.write('\n'.join([
'Error: building enspara requires numpy and cython>=0.19',
'Try running the command ``pip install numpy cython`` or'
'``conda install numpy cython``.',
'or see http://docs.scipy.org/doc/numpy/user/install.html and'
'http://cython.org/ for more information.']))
# this probably won't work for everyone. Works for me, though!
# they'll need gcc 7 installed. Unfortunately, I don't have any idea how
# to detect local c compilers. :/
if 'darwin' in platform.system().lower():
use_openmp = False
else:
use_openmp = True
extra_compile_args = ['-Wno-unreachable-code']
extra_link_args = []
if use_openmp:
extra_compile_args += ['-fopenmp']
extra_link_args = ['-fopenmp']
# build cython with `python setup.py build_ext --inplace`
cython_extensions = [
Extension(
"enspara.info_theory.libinfo",
["enspara/info_theory/libinfo.pyx"],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
), Extension(
"enspara.geometry.libdist",
["enspara/geometry/libdist.pyx"],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
), Extension(
"enspara.msm.libmsm",
["enspara/msm/libmsm.pyx"],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
)]
setup(
name='enspara',
packages=find_packages(exclude=["tests"],),
version=__version__,
project_urls={
'Documentation': 'https://enspara.readthedocs.io',
'Source': 'https://github.com/bowman-lab/enspara',
'Tracker': 'https://github.com/bowman-lab/enspara/issues',
},
platforms=['Linux', 'Mac OS-X', 'Unix'],
classifiers=CLASSIFIERS,
include_dirs=[np.get_include()],
ext_modules=cythonize(cython_extensions),
python_requires='>=3.5,<3.7', # cython is broken for 3.7
entry_points={'console_scripts': ['enspara = enspara.apps.main:main']},
setup_requires=['Cython>=0.24', 'numpy>=1.13'],
install_requires=[
'Cython>=0.24',
'numpy>=1.13',
'tables>=3.2',
'matplotlib>=1.5.1',
'mdtraj>=1.7',
'mpi4py>=2.0.0',
'psutil>=5.2.2',
'pandas',
'scikit-learn>=0.21.0',
'scipy>=0.17'
],
extras_require={
'dev': [
'nose',
],
'docs': [
'Sphinx>=1.6.4',
'sphinx-rtd-theme>=0.2.4',
'sphinxcontrib-websupport>=1.0.1',
'numpydoc>=0.7.0',
]
},
zip_safe=False
)