Advertisement
Guest User

Untitled

a guest
May 26th, 2021
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.95 KB | None | 0 0
  1. import os
  2. from setuptools import setup
  3.  
  4. from Cython.Build import cythonize
  5. from Cython.Build.Cythonize import Options
  6.  
  7. paths = [
  8.     "/streaming_api",
  9. ]
  10.  
  11.  
  12. # Quick and dirty filter of files that fail to compile.
  13. blacklist = [
  14.     "/streaming_api/BusinessLogic/Configs/environment.py",
  15.     "/streaming_api/API/models/icon.py",
  16. ]
  17.  
  18. Options.annotate = True
  19.  
  20. all_python_files = []
  21. for path in paths:
  22.     for root, dirs, files in os.walk(path):
  23.         for file in files:
  24.             if file.endswith(".py"):
  25.                 full_filename = os.path.join(root, file)
  26.                 if full_filename not in blacklist:
  27.                     all_python_files.append(full_filename)
  28.  
  29. setup(
  30.     ext_modules=cythonize(
  31.         all_python_files,
  32.         annotate=True,
  33.         compiler_directives=dict(
  34.             c_string_encoding="utf-8",
  35.             language_level=3,
  36.         ),
  37.         nthreads=os.cpu_count() * 2,
  38.     ),
  39.     zip_safe=False,
  40. )
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement