diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index e66c7d4a6fa6..ab0ca38b5f8c 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -126,6 +126,11 @@ def compare_versions(a, b): else: return False +if not compare_versions(six.__version__, '1.5'): + raise ImportError( + 'six 1.5 or later is required; you have %s' % ( + six.__version__)) + try: import pyparsing except ImportError: diff --git a/setupext.py b/setupext.py index bfe3aaaa6b02..e42f4e7105af 100644 --- a/setupext.py +++ b/setupext.py @@ -1090,6 +1090,7 @@ def get_extension(self): class Six(SetupPackage): name = "six" + min_version = "1.5" def check(self): try: @@ -1098,10 +1099,15 @@ def check(self): return ( "six was not found.") + if not is_min_version(six.__version__, self.min_version): + raise CheckFailed( + "Requires six %s or later. Found %s." % + (self.min_version, version)) + return "using six version %s" % six.__version__ def get_install_requires(self): - return ['six'] + return ['six>={0}'.format(self.min_version)] class Dateutil(SetupPackage):