Skip to content

Commit

Permalink
Force cython when building sdist
Browse files Browse the repository at this point in the history
and add a warning if cython could not be loaded, but is not required

Fixes #182
  • Loading branch information
perlpunk authored and ingydotnet committed Jun 28, 2018
1 parent 3dc3f5f commit 582c1cb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion setup.py
Expand Up @@ -77,12 +77,18 @@
sys.modules['distutils.command.build_ext'].Extension = _Extension

with_cython = False
if 'sdist' in sys.argv:
# we need cython here
with_cython = True
try:
from Cython.Distutils.extension import Extension as _Extension
from Cython.Distutils import build_ext as _build_ext
with_cython = True
except ImportError:
pass
if with_cython:
raise
else:
log.warn("WARNING: failed to import cython, may not be able compile extensions")

try:
from wheel.bdist_wheel import bdist_wheel
Expand Down

0 comments on commit 582c1cb

Please sign in to comment.