From 4c9899f471139670b0f1bfd359c37a67c507447d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 28 Feb 2020 00:23:57 +0100 Subject: [PATCH] Only get setuptools < 44 on Python 3.4 (#1677) This allows to have multiple setuptools versions (for 3.4 and newer). --- docs/changelog/1677.misc.rst | 1 + virtualenv.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 docs/changelog/1677.misc.rst diff --git a/docs/changelog/1677.misc.rst b/docs/changelog/1677.misc.rst new file mode 100644 index 000000000..7074b09db --- /dev/null +++ b/docs/changelog/1677.misc.rst @@ -0,0 +1 @@ +Don't attempt to use setuptools 44+ with Python 3.4 - by ``hroncok`` \ No newline at end of file diff --git a/virtualenv.py b/virtualenv.py index c7f71e6d7..3085d1d18 100755 --- a/virtualenv.py +++ b/virtualenv.py @@ -998,6 +998,8 @@ def find_wheels(projects, search_dirs): ) if project == "pip" and sys.version_info[0:2] == (3, 4): wheel = next(p for v, p in versions if v <= (19, 1, 1)) + elif project == "setuptools" and sys.version_info[0:2] == (3, 4): + wheel = next(p for v, p in versions if v < (44,)) else: wheel = versions[0][1] wheels.append(wheel) @@ -1091,9 +1093,13 @@ def space_path2url(p): ) ).encode("utf8") - if sys.version_info[0:2] == (3, 4) and "pip" in project_names: - at = project_names.index("pip") - project_names[at] = "pip<19.2" + if sys.version_info[0:2] == (3, 4): + if "pip" in project_names: + at = project_names.index("pip") + project_names[at] = "pip<19.2" + if "setuptools" in project_names: + at = project_names.index("setuptools") + project_names[at] = "setuptools<44" cmd = [py_executable, "-"] + project_names logger.start_progress("Installing {}...".format(", ".join(project_names)))