Skip to content

Commit 91ead06

Browse files
committed
Adjust setuptools installation to workaround upstream changes
New version of setuptools breaks our install model. This change uses one of the suggested workarounds for it. Upstream issue: pypa/setuptools#2352
1 parent 8e6ec47 commit 91ead06

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

cli-setup.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,17 @@ init_venv_python() {
179179
debugging "ERROR: failed to install python package (attempting to install via 'sudo pip install virtualenv')"
180180
if ! (sudo pip${pyver} install virtualenv --user --ignore-installed > /dev/null 2>&1); then
181181
assert "Please install the 'virtualenv' module using 'pip install virtualenv'"
182+
else
183+
# Fix setuptools to be below a certain version to workaround this issue
184+
# https://github.com/pypa/setuptools/issues/2352
185+
debugging "INFO: sudo pip${pyver} install setuptools<50.0 --force-reinstall > /dev/null 2>&1"
186+
sudo pip${pyver} install "setuptools<50.0" --force-reinstall > /dev/null 2>&1
182187
fi
188+
else
189+
# Fix setuptools to be below a certain version to workaround this issue
190+
# https://github.com/pypa/setuptools/issues/2352
191+
debugging "INFO: ${local_pip}${pyver} install setuptools<50.0 --force-reinstall > /dev/null 2>&1"
192+
sudo ${local_pip}${pyver} install "setuptools<50.0" --force-reinstall > /dev/null 2>&1
183193
fi
184194
fi
185195
debugging "INFO: ${local_virtualenv} -p python${pyver} --system-site-packages ${venv} > /dev/null 2>&1"
@@ -420,7 +430,9 @@ else
420430
fi
421431

422432
stdout_log "Upgrading pip"
423-
if ! (${venv_python} -m pip install --upgrade --ignore-installed pip setuptools wheel >> ${log_file} 2>&1); then
433+
# Fix setuptools to be below a certain version to workaround this issue
434+
# https://github.com/pypa/setuptools/issues/2352
435+
if ! (${venv_python} -m pip install --upgrade --ignore-installed pip "setuptools<50.0" wheel >> ${log_file} 2>&1); then
424436
assert "Pip upgrade failed"; fi
425437
debugging "pip install express-cli completed"
426438

0 commit comments

Comments
 (0)