-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
executable file
·42 lines (31 loc) · 879 Bytes
/
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
import os
from setuptools import setup, Extension
from Cython.Build import cythonize
__author__ = "Joseph Jackson <[email protected]>"
# define cython options
cython_compile_args = [
"-O3"
]
cython_directives = {
"language_level": 3,
}
# enable coverage for cython
if int(os.getenv("CYTHON_LINETRACE", "0")):
cython_directives["linetrace"] = True
cython_compile_args.append("-DCYTHON_TRACE")
# define compiled extensions
exts = [
Extension(
"example_package.fibonacci",
["example_package/fibonacci.pyx"],
language="c",
extra_compile_args=cython_compile_args,
extra_link_args=[],
),
]
# -- build the thing
# this function only manually specifies things that aren't
# supported by setup.cfg (as of setuptools-30.3.0)
setup(
ext_modules=cythonize(exts, compiler_directives=cython_directives),
)