diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2022-01-02 11:38:07 +0100 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2022-01-02 11:41:02 +0100 |
commit | db787a453996d7441f5791dd901b284b4cfbbfb9 (patch) | |
tree | d726324db723c5e700ad0f6e8b252607d8e0f864 /setup.py | |
parent | ebd4d2d98459e94cc3d187556f7d19246d7ebe05 (diff) | |
download | cython-db787a453996d7441f5791dd901b284b4cfbbfb9.tar.gz |
Reduce code verbosity.
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -141,20 +141,17 @@ def compile_cython_modules(profile=False, coverage=False, compile_more=False, cy extensions = [] for module in compiled_modules: source_file = os.path.join(source_root, *module.split('.')) - if os.path.exists(source_file + ".py"): - pyx_source_file = source_file + ".py" - else: - pyx_source_file = source_file + ".pyx" + pyx_source_file = source_file + ".py" + if not os.path.exists(pyx_source_file): + pyx_source_file += "x" # .py -> .pyx + dep_files = [] if os.path.exists(source_file + '.pxd'): dep_files.append(source_file + '.pxd') - if '.refnanny' in module: - defines_for_module = [] - else: - defines_for_module = defines + extensions.append(Extension( module, sources=[pyx_source_file], - define_macros=defines_for_module, + define_macros=defines if '.refnanny' not in module else [], depends=dep_files)) # XXX hack around setuptools quirk for '*.pyx' sources extensions[-1].sources[0] = pyx_source_file |