-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathsetup.py
More file actions
36 lines (32 loc) · 900 Bytes
/
Copy pathsetup.py
File metadata and controls
36 lines (32 loc) · 900 Bytes
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
import os
from Cython.Build import cythonize
from setuptools import Extension, setup
trace = os.environ.get("CYTHON_COVERAGE") == "1"
define_macros = [("CYTHON_TRACE", "1")] if trace else []
# -O3 only; no -ffast-math, so results stay bit-for-bit reproducible.
extra_compile_args = [] if trace else ["-O3"]
extensions = [
Extension(
"bitermplus._btm",
["src/bitermplus/_btm.pyx"],
define_macros=define_macros,
extra_compile_args=extra_compile_args,
),
Extension(
"bitermplus._metrics",
["src/bitermplus/_metrics.pyx"],
define_macros=define_macros,
extra_compile_args=extra_compile_args,
),
]
setup(
ext_modules=cythonize(
extensions,
force=True,
compiler_directives={
"language_level": 3,
"embedsignature": True,
"linetrace": trace,
},
)
)