-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsetup.py
63 lines (58 loc) · 2.43 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
from setuptools import find_packages, setup
#from sys import stderr
from Cython.Build import cythonize
setup(name="Epidemic_Threshold",
version="1.0",
description="Compute the epidemic threshold on time-evolving networks",
author="Eugenio Valdano",
author_email="[email protected]",
platforms=["any"], # or more specific, e.g. "win32", "cygwin", "osx"
license="BSD",
url="http://www.linkedin.com/in/eugeniovaldano",
packages=find_packages(),
test_suite="tests",
install_requires=[i.strip() for i in open("requirements.txt").readlines()],
data_files=[('tests/', ['tests/*.csv'])],
ext_modules=cythonize(["threshold/utilc.pyx"])
)
"""
try:
# try to import Cython. If it can't, it doesn't
from Cython.Build import cythonize
cython_args = {'ext_modules': cythonize(["threshold/utilc.pyx"])}
except ImportError:
print >> stderr, '****** !!! *** No Cython modules, going for pure Python.'
cython_args = {}
try:
# if cython was imported, try to cythonize
setup(name="Epidemic_Threshold",
version="1.0",
description="Compute the epidemic threshold on time-evolving networks",
author="Eugenio Valdano",
author_email="[email protected]",
platforms=["any"], # or more specific, e.g. "win32", "cygwin", "osx"
license="BSD",
url="http://www.linkedin.com/in/eugeniovaldano",
packages=find_packages(),
test_suite="tests",
install_requires=[i.strip() for i in open("requirements.txt").readlines()],
data_files=[('tests/', ['tests/*.csv'])],
**cython_args
)
except:
# no cythonizing around here
print >> stderr, '****** !!! *** No C building, going for pure Python.'
setup(name="Epidemic_Threshold",
version="1.0",
description="Compute the epidemic threshold on time-evolving networks",
author="Eugenio Valdano",
author_email="[email protected]",
platforms=["any"], # or more specific, e.g. "win32", "cygwin", "osx"
license="BSD",
url="http://www.linkedin.com/in/eugeniovaldano",
packages=find_packages(),
test_suite="tests",
install_requires=[i.strip() for i in open("requirements.txt").readlines()],
data_files=[('tests/', ['tests/*.csv'])],
)
"""