Skip to content

Commit 4f2947a

Browse files
committed
undo dumb setuptools bug clobbering .pyx sources back to .c
setuptools (not distribute) will replace '.pyx' extensions with '.c' if *pyrex* is not importable. This checks if that happened, and reverses it if so. closes pandas-dev#1805
1 parent 95f30ca commit 4f2947a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

setup.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,14 @@ def srcpath(name=None, suffix='.pyx', subdir='src'):
403403
if not ISRELEASED:
404404
extensions.extend([sandbox_ext])
405405

406+
if suffix == '.pyx' and 'setuptools' in sys.modules:
407+
# undo dumb setuptools bug clobbering .pyx sources back to .c
408+
for ext in extensions:
409+
if ext.sources[0].endswith('.c'):
410+
root, _ = os.path.splitext(ext.sources[0])
411+
ext.sources[0] = root + suffix
412+
413+
406414
# if _have_setuptools:
407415
# setuptools_kwargs["test_suite"] = "nose.collector"
408416

0 commit comments

Comments
 (0)