Skip to content

Commit

Permalink
android: apk-automation: don't hardcode python version
Browse files Browse the repository at this point in the history
Don't hardcode installing python3.9, because the call trace says
>=python3.9, so later versions works too.
Add a check that error's out if the installed python version isn't
>=3.9.

Fixes: 7220645 ("apk-automation: install and use python3.9")
Signed-off-by: Anders Roxell <[email protected]>
  • Loading branch information
roxell committed Aug 11, 2023
1 parent dfef2f3 commit 6b6dab9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions automated/android/apk-automation/apk-automation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if [ "${SKIP_INSTALL}" = "true" ] || [ "${SKIP_INSTALL}" = "True" ]; then
else
! check_root && error_msg "Please run this script as superuser!"
#install_deps "git python python-lxml python-pil python-setuptools python-requests python-matplotlib python-requests ca-certificates curl tar xz-utils" "${SKIP_INSTALL}"
install_deps "python3.9 python3-distutils git ca-certificates curl tar xz-utils" "${SKIP_INSTALL}"
install_deps "python3 python3-distutils git ca-certificates curl tar xz-utils" "${SKIP_INSTALL}"
if python3 --version|grep 'Python 3.6'; then
# Workaround for Ubuntu 18.04 Bionic version.
# ModuleNotFoundError: No module named 'distutils.cmd' needs python3-distutils
Expand All @@ -53,12 +53,13 @@ else
url_android_view_clien="https://github.com/dtmilano/AndroidViewClient"
fi

chech_python_version "$(python --verison)" "3.9" "Error"
curl "${url_pip}" -o get-pip.py
sudo python3 get-pip.py
sudo pip install virtualenv
pip --version
virenv_dir=python-workspace
virtualenv --python=python3.9 ${virenv_dir}
virtualenv --python=python3 ${virenv_dir}
[ ! -d AndroidViewClient ] && git clone --depth 1 "${url_android_view_clien}"
# shellcheck disable=SC1090
source ${virenv_dir}/bin/activate
Expand Down

0 comments on commit 6b6dab9

Please sign in to comment.