Python-EFL: Check the minimum cython version

This commit is contained in:
Davide Andreoli 2013-04-28 15:53:09 +02:00
parent 9d167fdf66
commit 8219a6a52b
1 changed files with 8 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import sys
import subprocess
from distutils.core import setup, Command
from distutils.extension import Extension
from distutils.version import StrictVersion
# Cython
@ -12,10 +13,15 @@ try:
from Cython.Build import cythonize
import Cython.Compiler.Options
min_ver, cur_ver = "0.17.3", Cython.__version__
assert StrictVersion(cur_ver) >= StrictVersion(min_ver)
print("Found Cython: %s" % cur_ver)
Cython.Compiler.Options.fast_fail = True # stop compilation on first error
Cython.Compiler.Options.annotate = False # HTML file annotation generation
except ImportError:
raise SystemExit("Requires Cython (http://cython.org/)")
except (ImportError, AssertionError):
raise SystemExit("Requires Cython >= %s (http://cython.org/)" % min_ver)
# Sphinx