-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·35 lines (32 loc) · 923 Bytes
/
setup.py
File metadata and controls
executable file
·35 lines (32 loc) · 923 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
from setuptools import setup, Extension
from Cython.Build import cythonize
import numpy as np
import os
# Ensure the file exists and get the absolute path
src_file = os.path.abspath("src/cython_utils.pyx")
if not os.path.exists(src_file):
raise FileNotFoundError(f"Cython source file not found: {src_file}")
print(f"Found Cython source file: {src_file}")
# Define the extension
extensions = [
Extension(
"src.cython_utils",
sources=[src_file],
include_dirs=[np.get_include()],
extra_compile_args=["-O3"] # Optimize for maximum performance
)
]
# Setup configuration
setup(
name="clickme_processing",
ext_modules=cythonize(
extensions,
compiler_directives={
"language_level": 3,
"boundscheck": False,
"wraparound": False,
"initializedcheck": False,
},
),
include_dirs=[np.get_include()]
)