22import os .path
33import sys
44
5- from . import _pythoninfo , _utils
5+ from . import _utils
66
77GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py"
88# pip 6 is the first version supporting environment markers
99MIN_PIP = "6.0"
10- OLD_PIP = "7.1.2"
1110OLD_SETUPTOOLS = "18.5"
1211
1312
@@ -21,21 +20,6 @@ def get_pkg_name(req):
2120 return req
2221
2322
24- def get_best_pip_version (python ):
25- """Return the pip to install for the given Python executable."""
26- if not python or isinstance (python , str ):
27- info = _pythoninfo .get_info (python )
28- else :
29- info = python
30- # On Python: 3.5a0 <= version < 3.5.0 (final), install pip 7.1.2,
31- # the last version working on Python 3.5a0:
32- # https://sourceforge.net/p/pyparsing/bugs/100/
33- if 0x30500A0 <= info .sys .hexversion < 0x30500F0 :
34- return OLD_PIP
35- else :
36- return None
37-
38-
3923def run_pip (cmd , * args , ** kwargs ):
4024 """Return the result of running pip with the given args."""
4125 return _utils .run_python ("-m" , "pip" , cmd , * args , ** kwargs )
@@ -90,9 +74,6 @@ def install_pip(
9074
9175 # python get-pip.py
9276 argv = [python , "-u" , filename ]
93- version = get_best_pip_version (info or python )
94- if version :
95- argv .append (version )
9677 res = _utils .run_cmd (argv , env = env )
9778 ec , _ , _ = res
9879 if ec != 0 :
@@ -113,14 +94,8 @@ def upgrade_pip(
11394 if not python :
11495 python = getattr (info , "executable" , None ) or sys .executable
11596
116- version = get_best_pip_version (info or python )
117- if version :
118- reqs = [f"pip=={ version } " ]
119- if installer :
120- reqs .append (f"setuptools=={ OLD_SETUPTOOLS } " )
121- else :
122- # pip 6 is the first version supporting environment markers
123- reqs = [f"pip>={ MIN_PIP } " ]
97+ # pip 6 is the first version supporting environment markers
98+ reqs = [f"pip>={ MIN_PIP } " ]
12499 res = install_requirements (* reqs , python = python , upgrade = True , ** kwargs )
125100 ec , _ , _ = res
126101 if ec != 0 :
0 commit comments