Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools: Install setuptools, packaging and wheel (and others) through apt #28056

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions Tools/environment_install/install-prereqs-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,13 @@ else
fi

# Lists of packages to install
BASE_PKGS="build-essential ccache g++ gawk git make wget valgrind screen python3-pexpect"
PYTHON_PKGS="future lxml pymavlink pyserial MAVProxy geocoder empy==3.3.4 ptyprocess dronecan"
BASE_PKGS="build-essential ccache g++ gawk git make wget valgrind screen python3-pexpect python3-packaging python3-setuptools python3-wheel python3-lxml python3-pygame"
PYTHON_PKGS="future pymavlink pyserial MAVProxy geocoder empy==3.3.4 ptyprocess dronecan"
PYTHON_PKGS="$PYTHON_PKGS flake8 junitparser"

# add some Python packages required for commonly-used MAVProxy modules and hex file generation:
if [[ $SKIP_AP_EXT_ENV -ne 1 ]]; then
PYTHON_PKGS="$PYTHON_PKGS pygame intelhex"
PYTHON_PKGS="$PYTHON_PKGS intelhex"
fi
ARM_LINUX_PKGS="g++-arm-linux-gnueabihf $INSTALL_PKG_CONFIG"
# python-wxgtk packages are added to SITL_PKGS below
Expand All @@ -181,7 +181,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 @@ -391,6 +391,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 @@ -400,13 +404,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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes our setup for everything, even if it isn't using venv.

Doesn't this mean we're no longer updating wheel and packaging outside of those things doing venv?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. I bundled them together because if you update wheel without updating setuptools, then that is another way to hose the environment. We want to ensure they all stay ABI compatible. Either they all go in as APT and are kept compatible by the OS, or they all stay at latest from pip.


if [ "$GITHUB_ACTIONS" == "true" ]; then
PIP_USER_ARGUMENT+=" --progress-bar off"
fi
Expand Down