Skip to content

Commit

Permalink
Only get setuptools < 44 on Python 3.4 (#1677)
Browse files Browse the repository at this point in the history
This allows to have multiple setuptools versions (for 3.4 and newer).
  • Loading branch information
hroncok authored Feb 27, 2020
1 parent 941d218 commit 4c9899f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/changelog/1677.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Don't attempt to use setuptools 44+ with Python 3.4 - by ``hroncok``
12 changes: 9 additions & 3 deletions virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)))
Expand Down

0 comments on commit 4c9899f

Please sign in to comment.