From 8dca292a60b899eae3aba12a2dcd507e4dc7bec2 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 27 Nov 2010 16:26:31 +0100 Subject: [PATCH] setup.py option '--cython-compile-all' to compile more Cython modules during installation than enabled by default --- setup.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index f0673019..6c15a13f 100644 --- a/setup.py +++ b/setup.py @@ -84,21 +84,24 @@ else: else: scripts = ["cython.py"] -def compile_cython_modules(profile=False): +def compile_cython_modules(profile=False, compile_more=False): source_root = os.path.abspath(os.path.dirname(__file__)) compiled_modules = ["Cython.Plex.Scanners", "Cython.Plex.Actions", "Cython.Compiler.Scanning", "Cython.Compiler.Parsing", "Cython.Compiler.Visitor", - #"Cython.Compiler.ParseTreeTransforms", - #"Cython.Compiler.Nodes", - #"Cython.Compiler.ExprNodes", - #"Cython.Compiler.ModuleNode", - #"Cython.Compiler.Optimize", "Cython.Runtime.refnanny"] - extensions = [] + if compile_more: + compiled_modules.extend([ + "Cython.Compiler.ParseTreeTransforms", + "Cython.Compiler.Nodes", + "Cython.Compiler.ExprNodes", + "Cython.Compiler.ModuleNode", + "Cython.Compiler.Optimize", + ]) + extensions = [] if sys.version_info[0] >= 3: from Cython.Distutils import build_ext as build_ext_orig for module in compiled_modules: @@ -209,10 +212,16 @@ cython_profile = '--cython-profile' in sys.argv if cython_profile: sys.argv.remove('--cython-profile') +try: + sys.argv.remove("--cython-compile-all") + cython_compile_more = True +except ValueError: + cython_compile_more = False + try: sys.argv.remove("--no-cython-compile") except ValueError: - compile_cython_modules(cython_profile) + compile_cython_modules(cython_profile, cython_compile_more) setup_args.update(setuptools_extra_args) -- 2.26.2