From 9d562e7acd21e3ac5f58a78dbd44979ad4a73def Mon Sep 17 00:00:00 2001 From: Nyo Date: Thu, 8 Dec 2016 11:43:23 +0100 Subject: [PATCH] .BANCHO. Dynamic setup.py file --- setup.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 5bd2454..b6071e6 100644 --- a/setup.py +++ b/setup.py @@ -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), ) \ No newline at end of file