Skip to content

Commit

Permalink
undo dumb setuptools bug clobbering .pyx sources back to .c
Browse files Browse the repository at this point in the history
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 #1805
  • Loading branch information
minrk authored and wesm committed Sep 8, 2012
1 parent a73fb1f commit 7eaf5ca
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 7eaf5ca

Please sign in to comment.