-
Notifications
You must be signed in to change notification settings - Fork 115
Expand file tree
/
Copy pathsetup.py
More file actions
43 lines (35 loc) · 1.12 KB
/
setup.py
File metadata and controls
43 lines (35 loc) · 1.12 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
"""Cython extension build configuration for CRISPResso2.
All package metadata, dependencies, and entry points are defined in
pyproject.toml. This file only exists to configure the Cython/C
extension modules, which setuptools does not support declaratively.
"""
from setuptools import setup, Extension
try:
from Cython.Build import cythonize
from Cython.Distutils import build_ext
ext = '.pyx'
has_cython = True
except ImportError:
ext = '.c'
has_cython = False
from numpy import get_include as numpy_get_include
ext_modules = [
Extension(
"CRISPResso2.CRISPRessoCOREResources",
["CRISPResso2/CRISPRessoCOREResources" + ext],
include_dirs=[numpy_get_include()],
extra_compile_args=['-w', '-Ofast'],
),
Extension(
"CRISPResso2.CRISPResso2Align",
["CRISPResso2/CRISPResso2Align" + ext],
include_dirs=[numpy_get_include()],
extra_compile_args=['-w', '-Ofast'],
),
]
if has_cython:
ext_modules = cythonize(ext_modules, language_level="3")
setup(
ext_modules=ext_modules,
cmdclass={'build_ext': build_ext} if has_cython else {},
)