-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
45 lines (39 loc) · 1.13 KB
/
setup.py
File metadata and controls
45 lines (39 loc) · 1.13 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
"""
Cython build configuration for omnibioai-toolserver 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 = [
"toolserver/tools/david_annotation.py",
"toolserver/tools/enrichr_pathway.py",
"toolserver/executor.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-toolserver",
packages=find_packages(exclude=["tests*"]),
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,
)