forked from Farama-Foundation/TinyScaler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
28 lines (24 loc) · 799 Bytes
/
setup.py
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
import platform
from Cython.Build import cythonize
from setuptools import Extension, setup
ext_modules = []
if platform.system() == "Windows": # Windows
ext_modules = [Extension("tinyscaler", ["src/*.pyx"])]
else: # Not Windows
if platform.machine() in ["x86_64", "arm64", "aarch64"]: # Detect 64-bit platforms
ext_modules = [Extension("tinyscaler", ["src/*.pyx"])]
else: # Arm assumed
ext_modules = [
Extension(
"tinyscaler",
["src/*.pyx"],
extra_compile_args=["-mfpu=neon"],
extra_link_args=["-mfpu=neon"],
)
]
setup(
name="tinyscaler",
ext_modules=cythonize(
ext_modules, language_level=3, compiler_directives={"annotation_typing": False}
),
)