Skip to content

Commit e3b6727

Browse files
committed
Avoid issue with Ubuntu 21.10+ setuptools>=06
pypa/setuptools#2956 https://gist.github.com/altendky/b852296ac520b343890c55eabc90c880 ``` File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 290, in set_undefined_options setattr(self, dst_option, getattr(src_cmd_obj, src_option)) File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 103, in __getattr__ raise AttributeError(attr) AttributeError: install_layout ```
1 parent 0554d92 commit e3b6727

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

install.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ if $UBUNTU; then
6161
# Mint 20.04 repsonds with 20 here so 20 instead of 20.04
6262
UBUNTU_PRE_2004=$(echo "$LSB_RELEASE<20" | bc)
6363
UBUNTU_2100=$(echo "$LSB_RELEASE>=21" | bc)
64+
UBUNTU_2110_PLUS=$(echo "$LSB_RELEASE>=21.10" | bc)
6465
fi
6566

6667
# Manage npm and other install requirements on an OS specific basis
@@ -166,8 +167,16 @@ fi
166167
# shellcheck disable=SC1091
167168
. ./activate
168169
# pip 20.x+ supports Linux binary wheels
169-
python -m pip install --upgrade pip
170-
python -m pip install wheel
170+
171+
if [ "$UBUNTU_2110_PLUS" = "true" ]; then
172+
# https://github.com/pypa/setuptools/issues/2956
173+
SETUPTOOLS_FOR_PIP='setuptools<60'
174+
else
175+
SETUPTOOLS_FOR_PIP='setuptools'
176+
fi
177+
178+
python -m pip install --upgrade pip wheel "${SETUPTOOLS_FOR_PIP}"
179+
171180
#if [ "$INSTALL_PYTHON_VERSION" = "3.8" ]; then
172181
# This remains in case there is a diversion of binary wheels
173182
python -m pip install --extra-index-url https://pypi.chia.net/simple/ miniupnpc==2.2.2

0 commit comments

Comments
 (0)