-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
37 lines (33 loc) · 1.04 KB
/
setup.py
File metadata and controls
37 lines (33 loc) · 1.04 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
# import subprocess
# import sys
import sysconfig
# subprocess.check_call([sys.executable, "-m", "pip", "install", "numpy>=2.0", "cython>=3.0.10"])
import numpy as np # noqa: E402
from Cython.Build import cythonize # noqa: E402
from setuptools import Extension, setup
py_inc = sysconfig.get_paths().get("include")
py_platinc = sysconfig.get_paths().get("platinclude")
inc_dirs = [
"pyface/components/face_depth/Sim3DR",
np.get_include(),
]
# 有些 runner 只放其中一個,把能拿到的全加進去
for p in (py_inc, py_platinc):
if p:
inc_dirs.append(p)
ext_modules = cythonize(
[
Extension(
"pyface.components.face_depth.Sim3DR.sim3dr_cython",
sources=[
"pyface/components/face_depth/Sim3DR/rasterize.pyx",
"pyface/components/face_depth/Sim3DR/rasterize_kernel.cpp",
],
include_dirs=inc_dirs,
language="c++",
extra_compile_args=["-std=c++11"],
)
],
language_level="3",
)
setup(ext_modules=ext_modules)