Commit 7fc080d5 authored by Joseph Weston's avatar Joseph Weston
Browse files

bump required Python version to 3.5

Add check for this in setup.py to avoid potentially confusing
tracebacks later.
parent 42dd420d
......@@ -29,7 +29,7 @@ Prerequisites
=============
Building Kwant requires
* `Python <https://www.python.org/>`_ 3.4 or above (Kwant 1.1 is the last
* `Python <https://www.python.org/>`_ 3.5 or above (Kwant 1.1 is the last
version to support Python 2),
* `NumPy <http://numpy.org/>`_ 1.11.0 or newer,
* `SciPy <https://scipy.org/>`_ 0.17.0 or newer,
......
......@@ -124,6 +124,16 @@ def configure_extensions(exts, aliases=(), build_summary=None):
return exts
def check_python_version(min_version):
installed_version = sys.version_info[:3]
if installed_version < min_version:
print('Error: Python {} required, but {} is installed'.format(
'.'.join(map(str, min_version)),
'.'.join(map(str, installed_version)))
)
sys.exit(1)
def check_versions():
global version, version_is_from_git
......@@ -557,6 +567,7 @@ def maybe_cythonize(exts):
def main():
check_python_version((3, 5))
check_versions()
exts = collections.OrderedDict([
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment