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

Android check python version #460

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

roxell
Copy link
Collaborator

@roxell roxell commented Aug 11, 2023

No description provided.

@roxell roxell force-pushed the android-check-python-version branch from 5109556 to ea5496e Compare August 11, 2023 10:47
@@ -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}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

why you want to drop .9 here?

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}
Copy link
Collaborator

Choose a reason for hiding this comment

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

what's the reason to drop ".9" here?

java_path="/usr/lib/jvm/java-17-openjdk-amd64/bin/java"
fi

PKG_DEPS="coreutils usbutils curl wget zip xz-utils python-lxml python-setuptools python-pexpect aapt lib32z1-dev libc6-dev-i386 lib32gcc1 libc6:i386 libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386 python-dev python-protobuf protobuf-compiler python-virtualenv python-pip python-pexpect psmisc"
Copy link
Collaborator

Choose a reason for hiding this comment

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

some of them are not available for 20.04, if you specify SKIP_INSTALL to false, and run on 20.04 host, it will fail.

@@ -22,6 +30,7 @@ case "${dist}" in
;;
esac

chech_python_version "$(python --verison)" "3.8" "Error"
Copy link
Collaborator

Choose a reason for hiding this comment

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

FYI, if like running Android11 cts/vts, python3.8 is not required, in fact it's just required for the AOSP master from now on. In the case of running Android11 cts/vts on Ubuntu18.04, python3.8 needs to be installed manually, otherwise it will fail here.

@roxell roxell force-pushed the android-check-python-version branch 2 times, most recently from f10d64f to c4b62b2 Compare August 17, 2023 11:27
Add a generic way to check python version if a specific minimum version
is needed.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
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 <anders.roxell@linaro.org>
Readd install_deps so the test can install the correct dependencies
without having to find them.
Add a python version check that errors out if the python version isn't
>=3.8.

Fixes: 2caa92b ("noninteractive-tradefed: change to work with python3")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
@roxell roxell force-pushed the android-check-python-version branch from c4b62b2 to 7154752 Compare August 21, 2023 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants