-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
108 lines (95 loc) · 3.49 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
# from distutils.core import setup
from setuptools import setup, find_packages
from setuptools.extension import Extension
import sys
import os
import platform
from distutils.sysconfig import get_python_inc
import versioneer
try:
import numpy
except ImportError: # We do not have numpy installed
build_requires = ['numpy>=1.14']
else:
# If we're building a wheel, assume there already exist numpy wheels
# for this platform, so it is safe to add numpy to build requirements.
# See gh-5184.
build_requires = (['numpy>=1.14'] if 'bdist_wheel' in sys.argv[1:]
else [])
try:
from Cython.Distutils.build_ext import build_ext as _build_ext
except ImportError:
from setuptools.command.build_ext import build_ext as _build_ext
use_cython = False
else:
use_cython = True
# factory function
def my_build_ext(pars):
# import delayed:
# include_dirs adjusted:
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
__builtins__.__NUMPY_SETUP__ = False
import numpy
self.include_dirs.append(numpy.get_include())
# object returned:
return build_ext(pars)
#### libs
if platform.system() == "Windows":
math_lib = []
else:
math_lib = ['m']
#### Python include
py_inc = [get_python_inc()]
#### cmdclass
cmdclass = versioneer.get_cmdclass()
#### Extension modules
ext_modules = []
if use_cython:
cmdclass.update({'build_ext': my_build_ext})
ext_modules += [Extension("pydyno.lcs",
["pydyno/lcs/clcs.c",
"pydyno/lcs/lcs.pyx"],
libraries=math_lib,
include_dirs=py_inc)]
else:
cmdclass.update({'build_ext': my_build_ext})
ext_modules += [Extension("pydyno.lcs",
["pydyno/lcs/clcs.c",
"pydyno/lcs/lcs.c"],
libraries=math_lib,
include_dirs=py_inc)]
install_requires = ['pysb', 'matplotlib', 'anytree', 'scikit-learn', 'pydot', 'tqdm',
'editdistance', 'pandas', 'networkx', 'numpy', 'sympy==1.5']
this_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_directory, 'README.md'), 'r') as f:
long_description = f.read()
setup(name='pydyno',
version=versioneer.get_version(),
description='Dynamic analysis of systems biology models',
long_description=long_description,
long_description_content_type='text/markdown',
author='Oscar Ortega',
author_email='oscar.ortega@vanderbilt.edu',
packages=find_packages(),
include_package_data=True,
install_requires=install_requires,
setup_requires=build_requires,
tests_require=['pytest', 'pathos', 'hdbscan'],
cmdclass=cmdclass,
ext_modules=ext_modules,
keywords=['systems', 'biology', 'model'],
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Topic :: Scientific/Engineering :: Chemistry',
'Topic :: Scientific/Engineering :: Mathematics',
],
)