File size: 680 Bytes
d241368
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from __future__ import annotations

from setuptools import Extension, setup


def build_extensions() -> list[Extension]:
    try:
        from Cython.Build import cythonize
        import numpy
    except Exception:
        return []

    extensions = [
        Extension(
            "bat_tracker._fast_merge",
            ["bat_tracker/_fast_merge.pyx"],
            include_dirs=[numpy.get_include()],
        ),
        Extension(
            "bat_tracker._fast_tracker",
            ["bat_tracker/_fast_tracker.pyx"],
            include_dirs=[numpy.get_include()],
        )
    ]
    return cythonize(extensions, language_level="3")


setup(ext_modules=build_extensions())