from setuptools import setup, Extension
from Cython.Build import cythonize
import numpy as np

extensions = [
    Extension('constants_inf', ['constants_inf.pyx']),
    Extension('ai_availability_status', ['ai_availability_status.pyx']),
    Extension('annotation', ['annotation.pyx']),
    Extension('ai_config', ['ai_config.pyx']),
    Extension('onnx_engine', ['onnx_engine.pyx'], include_dirs=[np.get_include()]),
    Extension('inference_engine', ['inference_engine.pyx'], include_dirs=[np.get_include()]),
    Extension('inference', ['inference.pyx'], include_dirs=[np.get_include()]),
]

try:
    import tensorrt
    extensions.append(
        Extension('tensorrt_engine', ['tensorrt_engine.pyx'], include_dirs=[np.get_include()])
    )
except ImportError:
    pass

setup(
    name="azaion.detections",
    ext_modules=cythonize(
        extensions,
        compiler_directives={
            "language_level": 3,
            "emit_code_comments": False,
            "binding": True,
            'boundscheck': False,
            'wraparound': False,
        }
    ),
    zip_safe=False
)
