Skip to content

Commit

Permalink
Clarify warning messages for Cython version check during setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaase-de committed Jun 1, 2016
1 parent 80e0ae7 commit 45e7a21
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,25 @@
f.close()

setup_kwargs = {}
cython_installed = True
cython_min_version = '0.22.1'
try:
from Cython.Distutils import build_ext
from Cython import __version__ as cython_version
if StrictVersion(cython_version) < StrictVersion('0.22.1'):
cython_installed = False
warnings.warn('Your Cython appears to be an older version. You may '
'need to upgrade Cython in order to build the peewee '
'C extensions. For now, Cython support is disabled.')
except ImportError:
cython_installed = False
warnings.warn('Cython C extensions for peewee will NOT be built, because '
'Cython does not seem to be installed. To enable Cython C '
'extensions, install Cython >=' + cython_min_version + '.')
else:
if StrictVersion(cython_version) < StrictVersion(cython_min_version):
cython_installed = False
warnings.warn('Cython C extensions for peewee will NOT be built, '
'because the installed Cython version '
'(' + cython_version + ') is too old. To enable Cython '
'C extensions, install Cython >=' + cython_min_version +
'.')
else:
cython_installed = True

speedups_ext_module = Extension(
'playhouse._speedups',
Expand Down

0 comments on commit 45e7a21

Please sign in to comment.