forked from ver228/tierpsy-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·48 lines (39 loc) · 1.36 KB
/
Copy pathsetup.py
File metadata and controls
executable file
·48 lines (39 loc) · 1.36 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
#!/usr/bin/env python
from setuptools import setup
from distutils.extension import Extension
from Cython.Build import cythonize
from Cython.Distutils import build_ext
import numpy
import os
module_name = 'tierpsy'
exec(open(module_name + '/version.py').read())
#build cython files
# python3 setup.py build_ext --inplace
path_parts = [module_name, 'analysis', 'ske_create', 'segWormPython', 'cython_files']
cython_path = os.path.join(*path_parts)
def _add_path(f_list):
return [os.path.join(cython_path, x) for x in f_list]
def _get_mod_path(name):
return '.'.join(path_parts + [name])
ext_files = {
"circCurvature" : ["circCurvature.pyx", "c_circCurvature.c"],
"curvspace" : ["curvspace.pyx", "c_curvspace.c"]
}
include_dirs = [numpy.get_include()]
ext_modules = cythonize(os.path.join(cython_path, "*_cython.pyx"))
ext_modules += [Extension(_get_mod_path(name),
sources=_add_path(files),
include_dirs=include_dirs)
for name, files in ext_files.items()]
#install setup
setup(name=module_name,
version=__version__,
description='Tierpsy Tracker',
author='Avelino Javer',
author_email='avelino.javer@imperial.ac.uk',
url='https://github.com/ver228/tierpsy-tracker',
packages=['tierpsy'],
cmdclass={'build_ext': build_ext},
ext_modules=ext_modules,
include_dirs=[numpy.get_include()]
)