forked from mcellteam/mcell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
117 lines (105 loc) · 3.23 KB
/
setup.py
File metadata and controls
117 lines (105 loc) · 3.23 KB
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
117
#!/usr/bin/env python
# command to build pymcell
# python setup.py build
# command to create pymcell tarball
# python setup.py sdist
"""
setup.py file for pyMCell
"""
from distutils.core import setup, Extension
from distutils.command.build import build
from distutils.command.sdist import sdist
import os
import shutil
import sys
def disallow_python2():
if sys.version_info[0] == 2:
sys.exit("Sorry, Python 2 is not supported.")
class CustomBuild(build):
def run(self):
disallow_python2()
os.system("mkdir build")
shutil.copy("./requirements.py", "./build")
os.system("cd build; python requirements.py; cd ..")
shutil.copy("./appveyor_windows/config.h", "./src")
shutil.copy("./appveyor_windows/version.h", "./src")
shutil.copy("./src/pymcell_helpers.py", ".")
shutil.copy("./src/data_model_import.py", ".")
self.run_command('build_ext')
shutil.copy("./src/pymcell.py", ".")
build.run(self)
class CustomSDist(sdist):
def run(self):
disallow_python2()
sdist.run(self)
mcell_module = Extension(
'_pymcell',
include_dirs=['./include'],
libraries=['nfsim_c', 'NFsim'],
library_dirs=['./build/lib'],
sources=[
'./src/argparse.c',
'./src/chkpt.c',
'./src/count_util.c',
'./src/diffuse.c',
'./src/diffuse_trimol.c',
'./src/diffuse_util.c',
'./src/dyngeom.c',
'./src/dyngeom_lex.c',
'./src/dyngeom_parse_extras.c',
'./src/dyngeom_yacc.c',
'./src/grid_util.c',
'./src/hashmap.c',
'./src/init.c',
'./src/isaac64.c',
'./src/logging.c',
'./src/mcell_dyngeom.c',
'./src/mcell_init.c',
'./src/mcell_misc.c',
'./src/mcell_objects.c',
'./src/mcell_react_out.c',
'./src/mcell_reactions.c',
'./src/mcell_release.c',
'./src/mcell_run.c',
'./src/mcell_species.c',
'./src/mcell_surfclass.c',
'./src/mcell_viz.c',
'./src/mem_util.c',
'./src/nfsim_func.c',
'./src/pymcell.i',
'./src/react_cond.c',
'./src/react_outc.c',
'./src/react_outc_nfsim.c',
'./src/react_outc_trimol.c',
'./src/react_output.c',
'./src/react_trig.c',
'./src/react_trig_nfsim.c',
'./src/react_util.c',
'./src/react_util_nfsim.c',
'./src/rng.c',
'./src/sched_util.c',
'./src/strfunc.c',
'./src/sym_table.c',
'./src/triangle_overlap.c',
'./src/util.c',
'./src/vector.c',
'./src/version_info.c',
'./src/viz_output.c',
'./src/vol_util.c',
'./src/volume_output.c',
'./src/wall_util.c',
],
swig_opts=['-py3'],
extra_compile_args=['-O2'])
setup(name='pymcell',
version='0.1',
author="The MCell team",
description="""Python bindings to libmcell""",
author_email="mcell-devel@salk.edu",
url="https://github.com/mcellteam/mcell",
download_url="https://github.com/mcellteam/mcell/archive/pymcell_0.1.tar.gz",
ext_modules=[mcell_module],
license='GPL v2',
py_modules=["pymcell"],
cmdclass={'build': CustomBuild, 'sdist': CustomSDist},
)