forked from HXSecurity/DongTai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
31 lines (25 loc) · 757 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
29
30
31
import glob
import multiprocessing
import os
import sys
from distutils.core import setup
from tempfile import gettempdir
from Cython.Build import cythonize
CPU_COUNT = multiprocessing.cpu_count()
if "-j" not in sys.argv:
sys.argv.append("-j")
sys.argv.append(str(CPU_COUNT))
dir_set = set(glob.glob("**/*.py", recursive=True))
migrations_dir_set = set(glob.glob("**/migrations/**/*.py", recursive=True))
dir_set -= migrations_dir_set
dir_set.remove("manage.py")
dir_set.remove("setup.py")
setup(
ext_modules=cythonize(
dir_set,
compiler_directives={"language_level": 3, "annotation_typing": False},
exclude_failures=True,
cache=os.path.join(gettempdir(), "cythoncache"),
nthreads=CPU_COUNT,
)
)