##// END OF EJS Templates
Clean up pip version check
Thomas Kluyver -
Show More
@@ -17,23 +17,21 b' requires utilities which are not available under Windows."""'
17 # The full license is in the file COPYING.rst, distributed with this software.
17 # The full license is in the file COPYING.rst, distributed with this software.
18 #-----------------------------------------------------------------------------
18 #-----------------------------------------------------------------------------
19
19
20 #-----------------------------------------------------------------------------
21 # Minimal Python version sanity check
22 #-----------------------------------------------------------------------------
23 from __future__ import print_function
20 from __future__ import print_function
24
21
25 import sys
22 import sys
26
23
24 # **Python version check**
25 #
27 # This check is also made in IPython/__init__, don't forget to update both when
26 # This check is also made in IPython/__init__, don't forget to update both when
28 # changing Python version requirements.
27 # changing Python version requirements.
29 if sys.version_info < (3,3):
28 if sys.version_info < (3,3):
29 pip_message = 'This may be due to an out of date pip. Make sure you have pip >= 9.0.1.'
30 try:
30 try:
31 pip_message = 'This may be due to an out of date pip. Make sure you have pip >= 9.0.1. '
32 import pip
31 import pip
33 pip_version = tuple([int(x) for x in pip.__version__.split('.')[:3]])
32 pip_version = tuple([int(x) for x in pip.__version__.split('.')[:3]])
34 print(pip_version)
35 if pip_version < (9, 0, 1) :
33 if pip_version < (9, 0, 1) :
36 pip_message = 'You pip version is out of date, please install pip >= 9.0.1.'\
34 pip_message = 'Your pip version is out of date, please install pip >= 9.0.1. '\
37 'pip {} detected.'.format(pip.__version__)
35 'pip {} detected.'.format(pip.__version__)
38 except Exception:
36 except Exception:
39 pass
37 pass
General Comments 0
You need to be logged in to leave comments. Login now