-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
46 lines (40 loc) · 1.79 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
import os
import sys
import traceback
from setuptools import find_packages, Extension, setup
def make_extensions():
try:
import numpy
except ImportError:
print("Installation requires `numpy`")
raise
try:
from Cython.Build import cythonize
cython_directives = {
'embedsignature': True,
"profile": False
}
extensions = cythonize([
Extension(name='fragment_index.fragment_index', sources=["fragment_index/fragment_index.pyx"],
include_dirs=[numpy.get_include()]),
Extension(name='fragment_index.search', sources=["fragment_index/search.pyx"],
include_dirs=[numpy.get_include()]),
Extension(name='fragment_index.peak_index.peak_index', sources=["fragment_index/peak_index/peak_index.pyx"],
include_dirs=[numpy.get_include()]),
Extension(name='fragment_index.serializer', sources=["fragment_index/serializer.pyx"],
include_dirs=[numpy.get_include()]),
], compiler_directives=cython_directives)
except ImportError:
extensions = [
Extension(name='fragment_index.fragment_index', sources=["fragment_index/fragment_index.c"],
include_dirs=[numpy.get_include()]),
Extension(name='fragment_index.search', sources=["fragment_index/search.c"],
include_dirs=[numpy.get_include()]),
Extension(name='fragment_index.peak_index.peak_index', sources=["fragment_index/peak_index/peak_index.c"],
include_dirs=[numpy.get_include()]),
]
return extensions
setup(name='fragment_index',
packages=find_packages(),
ext_modules=make_extensions(),
include_package_data=True)