Commit db787a45 authored by Stefan Behnel's avatar Stefan Behnel

Reduce code verbosity.

parent ebd4d2d9
...@@ -141,20 +141,17 @@ def compile_cython_modules(profile=False, coverage=False, compile_more=False, cy ...@@ -141,20 +141,17 @@ def compile_cython_modules(profile=False, coverage=False, compile_more=False, cy
extensions = [] extensions = []
for module in compiled_modules: for module in compiled_modules:
source_file = os.path.join(source_root, *module.split('.')) source_file = os.path.join(source_root, *module.split('.'))
if os.path.exists(source_file + ".py"): pyx_source_file = source_file + ".py"
pyx_source_file = source_file + ".py" if not os.path.exists(pyx_source_file):
else: pyx_source_file += "x" # .py -> .pyx
pyx_source_file = source_file + ".pyx"
dep_files = [] dep_files = []
if os.path.exists(source_file + '.pxd'): if os.path.exists(source_file + '.pxd'):
dep_files.append(source_file + '.pxd') dep_files.append(source_file + '.pxd')
if '.refnanny' in module:
defines_for_module = []
else:
defines_for_module = defines
extensions.append(Extension( extensions.append(Extension(
module, sources=[pyx_source_file], module, sources=[pyx_source_file],
define_macros=defines_for_module, define_macros=defines if '.refnanny' not in module else [],
depends=dep_files)) depends=dep_files))
# XXX hack around setuptools quirk for '*.pyx' sources # XXX hack around setuptools quirk for '*.pyx' sources
extensions[-1].sources[0] = pyx_source_file extensions[-1].sources[0] = pyx_source_file
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment