-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
48 lines (42 loc) · 1.17 KB
/
Copy pathsetup.py
File metadata and controls
48 lines (42 loc) · 1.17 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
"""
Cython build configuration for omnibioai-security-sdk IP protection.
Usage: python setup.py build_ext --inplace
"""
import os
from setuptools import setup, find_packages
from Cython.Build import cythonize
from Cython.Compiler import Options
from setuptools.extension import Extension
Options.annotate = False
EXTENSIONS = [
"middleware/policy.py",
"middleware/s2s.py",
"auth/service.py",
"policy/client.py",
"iam/client.py",
"iam/cache.py",
]
def make_extensions(paths):
exts = []
for p in paths:
if not os.path.exists(p):
print(f"WARNING: {p} not found, skipping")
continue
module = p.replace("/", ".").replace("\\", ".").removesuffix(".py")
exts.append(Extension(module, [p]))
return exts
setup(
name="omnibioai-security-sdk",
packages=find_packages(exclude=["tests*", "migrations*"]),
ext_modules=cythonize(
make_extensions(EXTENSIONS),
compiler_directives={
"language_level": "3",
"boundscheck": False,
"wraparound": False,
"cdivision": True,
},
nthreads=os.cpu_count() or 4,
),
zip_safe=False,
)