-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_engine.py
More file actions
33 lines (30 loc) · 786 Bytes
/
build_engine.py
File metadata and controls
33 lines (30 loc) · 786 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
"""
build_engine.py
~~~~~~~~~~~~~~~
Direct Cython build script for the PyPDFPatra engine.
Run: python build_engine.py build_ext --inplace
"""
from Cython.Build import cythonize
from setuptools import Extension, setup
ext_modules = cythonize(
[
Extension(
"pypdfpatra.engine.tree",
sources=["src/pypdfpatra/engine/tree.pyx"],
extra_compile_args=["/O2"]
if __import__("sys").platform == "win32"
else ["-O3"],
),
],
compiler_directives={
"boundscheck": False,
"wraparound": False,
"language_level": "3",
},
force=True, # Always recompile, don't use cached .c files
)
setup(
name="pypdfpatra-engine",
ext_modules=ext_modules,
package_dir={"": "src"},
)