Skip to content

Commit f860e47

Browse files
committed
Remove code for Python 3.5 pre-releases
1 parent 74a5b03 commit f860e47

2 files changed

Lines changed: 3 additions & 33 deletions

File tree

pyperformance/_pip.py

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
import os.path
33
import sys
44

5-
from . import _pythoninfo, _utils
5+
from . import _utils
66

77
GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py"
88
# pip 6 is the first version supporting environment markers
99
MIN_PIP = "6.0"
10-
OLD_PIP = "7.1.2"
1110
OLD_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-
3923
def 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:

pyperformance/compile.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -373,11 +373,6 @@ def download(self, url, filename):
373373
_utils.download(url, filename)
374374

375375
def _install_pip(self):
376-
# On Python: 3.5a0 <= version < 3.5.0 (final), install pip 7.1.2,
377-
# the last version working on Python 3.5a0:
378-
# https://sourceforge.net/p/pyparsing/bugs/100/
379-
assert self.hexversion > 0x3060000, self.hexversion
380-
381376
# is pip already installed and working?
382377
exitcode = self.run_nocheck(self.program, "-u", "-m", "pip", "--version")
383378
if not exitcode:

0 commit comments

Comments
 (0)