-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.py
More file actions
34 lines (27 loc) · 1011 Bytes
/
build.py
File metadata and controls
34 lines (27 loc) · 1011 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
import os, platform
from setuptools import Extension
from Cython.Build import cythonize
def build(setup_kwargs):
# Get the current directory
current_dir = os.path.dirname(os.path.abspath(__file__))
# Define the path to your .pyx file
pyx_path = os.path.join(current_dir, 'fluidframe_test', 'core', 'tags', 'tags.pyx')
# Define the extension
extensions = [
Extension(
"fluidframe_test.core.tags.tags",
[pyx_path],
extra_link_args = ["-O3"] if platform.system() != "Windows" else [],
extra_compile_args = ["-O3"] if platform.system() != "Windows" else [],
py_limited_api=True
)
]
# Cythonize the extension
ext_modules = cythonize(extensions, language_level="3")
# Update setup_kwargs with ext_modules
setup_kwargs.update({
'ext_modules': ext_modules,
})
print("Cython extensions built successfully.")
if __name__ == '__main__':
build(setup_kwargs={})