.BANCHO. Dynamic setup.py file

This commit is contained in:
Nyo 2016-12-08 11:43:23 +01:00
parent 4f4253afce
commit 9d562e7acd
1 changed files with 9 additions and 4 deletions

View File

@ -2,11 +2,16 @@
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
import os
cythonExt = []
for root, dirs, files in os.walk(os.getcwd()):
for file in files:
if file.endswith(".pyx"):
filePath = os.path.relpath(os.path.join(root, file))
cythonExt.append(Extension(filePath.replace("/", ".")[:-4], [filePath]))
setup(
name = "pep.pyx modules",
ext_modules = cythonize([
Extension("helpers.packetHelper", ["helpers/packetHelper.pyx"]),
],
nthreads = 4),
ext_modules = cythonize(cythonExt, nthreads = 4),
)