Skip to content

Commit 7859923

Browse files
committed
BUG: Fix for cython version checking pandas-dev#9827
1 parent 2734fff commit 7859923

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

setup.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,21 @@
1111
import shutil
1212
import warnings
1313
import re
14+
from distutils.version import LooseVersion
1415

1516
# may need to work around setuptools bug by providing a fake Pyrex
17+
min_cython_ver = '0.19.1'
1618
try:
1719
import Cython
1820
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "fake_pyrex"))
21+
ver = Cython.__version__
22+
_CYTHON_INSTALLED = ver >= LooseVersion(min_cython_ver)
23+
print 'cython version %s' % ver # NOTE: TA DEBUG
24+
# _CYTHON_INSTALLED = True
25+
# if not _CYTHON_INSTALLED:
26+
# sys.exit('Install requires Cython >= %s' % min_cython_ver)
1927
except ImportError:
20-
pass
28+
_CYTHON_INSTALLED = False
2129

2230
# try bootstrapping setuptools if it doesn't exist
2331
try:
@@ -74,6 +82,8 @@
7482
from distutils.command.build_ext import build_ext as _build_ext
7583

7684
try:
85+
if not _CYTHON_INSTALLED:
86+
raise ImportError('No supported version of Cython installed.')
7787
from Cython.Distutils import build_ext as _build_ext
7888
# from Cython.Distutils import Extension # to get pyrex debugging symbols
7989
cython = True

0 commit comments

Comments
 (0)