OSDN Git Service

[GD Cert] Support Python 3.9
authorJack He <siyuanh@google.com>
Tue, 26 Jan 2021 08:40:36 +0000 (00:40 -0800)
committerJack He <siyuanh@google.com>
Tue, 26 Jan 2021 19:38:51 +0000 (19:38 +0000)
* AOSP upgraded to Python 3.9 recently
* Use Python 3.9 as default test runner
* Modify logging lines in setup.py

Bug: 178410571
Tag: #gd-refactor
Test: gd/cert/run
Change-Id: I65cb619d747102d8f145511feb20a40d8bf38790

gd/cert/run
gd/setup.py

index 6b2c582..13179fc 100755 (executable)
@@ -54,10 +54,16 @@ function check_environment {
       echo
       exit 1
     fi
-    if ! [ -x "$(command -v python3.8)" ] ; then
-      echo -e "${RED}You must have python 3.8 installed${NOCOLOR}"
+    if ! [ -x "$(command -v python3.9)" ] ; then
+      echo -e "${RED}You must have python 3.9 installed${NOCOLOR}"
       exit 1
     fi
+    python3.9 -m virtualenv --version
+    if [[ $? -ne 0 ]] ; then
+        echo "${RED}virtualenv not installed for python3.9${NOCOLOR}"
+        echo "${RED}Please run 'python3.9 -m pip install virtualenv' to install it${NOCOLOR}"
+        exit 1
+    fi
 }
 
 ASHMEM_OUT="/dev/shm/out"
@@ -265,7 +271,7 @@ function setup_venv {
             echo -e "${NOCOLOR}"
         fi
     fi
-    python3.8 -m virtualenv --python `which python3.8` "${CERT_TEST_VENV}"
+    python3.9 -m virtualenv --python `which python3.9` "${CERT_TEST_VENV}"
     if [[ $? -ne 0 ]] ; then
         echo "Error setting up virtualenv"
         exit 1
index 55df659..1a8734a 100644 (file)
@@ -74,9 +74,9 @@ class InstallLocalPackagesForInstallation(install):
         if self.reuse_acts and is_acts_importable():
             self.announce('Reusing existing ACTS installation', log.WARN)
         else:
-            self.announce('Installing ACTS for installation', log.WARN)
+            self.announce('Installing ACTS library', log.WARN)
             setup_acts_for_cmd_or_die("install")
-            self.announce('ACTS installed for installation.', log.WARN)
+            self.announce('ACTS installed.', log.WARN)
         if not is_acts_importable():
             raise DistutilsModuleError("Cannot import acts after installation")
         install.run(self)