Skip to content

Commit

Permalink
Tools: Install setuptools, packaging and wheel through apt
Browse files Browse the repository at this point in the history
* 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 <ryanfriedman5410+github@gmail.com>
  • Loading branch information
Ryanf55 committed Sep 10, 2024
1 parent d18a2b2 commit 53596b8
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions Tools/environment_install/install-prereqs-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 53596b8

Please sign in to comment.