diff --git a/setup.py b/setup.py index 5e9d070982242..9a6c42e511545 100755 --- a/setup.py +++ b/setup.py @@ -403,6 +403,14 @@ def srcpath(name=None, suffix='.pyx', subdir='src'): if not ISRELEASED: extensions.extend([sandbox_ext]) +if suffix == '.pyx' and 'setuptools' in sys.modules: + # undo dumb setuptools bug clobbering .pyx sources back to .c + for ext in extensions: + if ext.sources[0].endswith('.c'): + root, _ = os.path.splitext(ext.sources[0]) + ext.sources[0] = root + suffix + + # if _have_setuptools: # setuptools_kwargs["test_suite"] = "nose.collector"