From 53596b861742fd2ecfcc19d22e64d588e5562f49 Mon Sep 17 00:00:00 2001 From: Ryan Friedman Date: Sat, 7 Sep 2024 13:56:26 -0600 Subject: [PATCH] Tools: Install setuptools, packaging and wheel through apt * Installing these on host OS outside of a VENV can break many other tools * If in VENV, we upgrade them to the latest just in case * Remove focal workaround now that upstream fixed it Signed-off-by: Ryan Friedman --- .../environment_install/install-prereqs-ubuntu.sh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Tools/environment_install/install-prereqs-ubuntu.sh b/Tools/environment_install/install-prereqs-ubuntu.sh index ea22a423c4b49..f4fa10363a880 100755 --- a/Tools/environment_install/install-prereqs-ubuntu.sh +++ b/Tools/environment_install/install-prereqs-ubuntu.sh @@ -164,7 +164,7 @@ else fi # Lists of packages to install -BASE_PKGS="build-essential ccache g++ gawk git make wget valgrind screen python3-pexpect" +BASE_PKGS="build-essential ccache g++ gawk git make wget valgrind screen python3-pexpect python3-packaging python3-setuptools python3-wheel" PYTHON_PKGS="future lxml pymavlink pyserial MAVProxy geocoder empy==3.3.4 ptyprocess dronecan" PYTHON_PKGS="$PYTHON_PKGS flake8 junitparser" @@ -183,7 +183,7 @@ if [ ${RELEASE_CODENAME} == 'bookworm' ] || PYTHON_PKGS+=" numpy pyparsing psutil" SITL_PKGS="python3-dev" else -SITL_PKGS="libtool libxml2-dev libxslt1-dev ${PYTHON_V}-dev ${PYTHON_V}-pip ${PYTHON_V}-setuptools ${PYTHON_V}-numpy ${PYTHON_V}-pyparsing ${PYTHON_V}-psutil" +SITL_PKGS="libtool libxml2-dev libxslt1-dev ${PYTHON_V}-dev ${PYTHON_V}-pip ${PYTHON_V}-numpy ${PYTHON_V}-pyparsing ${PYTHON_V}-psutil" fi # add some packages required for commonly-used MAVProxy modules: @@ -393,6 +393,10 @@ if [ -n "$PYTHON_VENV_PACKAGE" ]; then $SOURCE_LINE PIP_USER_ARGUMENT="" + # Try update packaging, setuptools and wheel before installing pip package that may need compilation. + # This will overwrite the system supplied version in the virtual environment. + $PIP install $PIP_USER_ARGUMENT -U pip packaging setuptools wheel + if [[ -z "${DO_PYTHON_VENV_ENV}" ]] && maybe_prompt_user "Make ArduPilot venv default for python [N/y]?" ; then DO_PYTHON_VENV_ENV=1 fi @@ -402,13 +406,6 @@ if [ -n "$PYTHON_VENV_PACKAGE" ]; then fi fi -# try update packaging, setuptools and wheel before installing pip package that may need compilation -SETUPTOOLS="setuptools" -if [ ${RELEASE_CODENAME} == 'focal' ]; then - SETUPTOOLS=setuptools==70.3.0 -fi -$PIP install $PIP_USER_ARGUMENT -U pip packaging $SETUPTOOLS wheel - if [ "$GITHUB_ACTIONS" == "true" ]; then PIP_USER_ARGUMENT+=" --progress-bar off" fi