Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

devops: install Python 3.8 on Ubuntu 18.04 (#16101)

Andrey Lushnikov505197bfac30
diff --git a/browser_patches/docker_build.sh b/browser_patches/docker_build.sh
index d31b17fe35..529fc99069 100755
--- a/browser_patches/docker_build.sh
+++ b/browser_patches/docker_build.sh
@@ -131,15 +131,24 @@ function ensure_docker_container {
apt-get update && apt-get install -y wget \
git-core \
- python3 \
- python3-pip \
curl \
autoconf2.13 \
tzdata \
sudo \
zip \
- unzip \
- python3-distutils
+ unzip
+
+ # Ubuntu 18 installs Python 3.6 as Python3 by default; this, however,
+ # fails to run Firefox build scripts.
+ # Install Python3.8 instead on Ubuntu 18.04 as Python3.
+ if [[ "${BUILD_FLAVOR}" == *ubuntu-18.04* ]]; then
+ apt-get install -y python3.8 python3.8-pip python3.8-distutils
+ # Point python3 to python3.8
+ update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2
+ else
+ apt-get install -y python3 python3-pip python3-distutils
+ fi
+
# Create the pwuser and make it passwordless sudoer.
adduser --disabled-password --gecos "" pwuser