Remove unneeded pip installs from setup script
Python pip installs occur on the python virtualenv during test
runtime. For users running VTS directly without tradefed,
pypi-packages-local.sh has been added and the manuals have been
updated. Predownloading of pypi packages is handled
in ./download-pypi-packages.sh and ./pip_requirements.txt.
Bug: 36301243
Change-Id: Ide25da97e73006248cd201a8993d75537eccd572
Fixes: 36301243
Test: make vts -j40 && vts-tradefed run commandAndExit vts
diff --git a/doc/testcase_develop_manual/run_vts_directly.md b/doc/testcase_develop_manual/run_vts_directly.md
index a626fe2..a4a2082 100644
--- a/doc/testcase_develop_manual/run_vts_directly.md
+++ b/doc/testcase_develop_manual/run_vts_directly.md
@@ -2,6 +2,10 @@
First of all, if you have not done [VTS setup](../setup/index.md), that is required here.
+## Download required Python packages to local host
+
+`$ . test/vts/script/pypi-packages-local.sh`
+
## Build Binaries
`$ cd test/vts/script`
diff --git a/doc/user_manual.md b/doc/user_manual.md
index 86b55d3..0aba7c9 100644
--- a/doc/user_manual.md
+++ b/doc/user_manual.md
@@ -8,8 +8,17 @@
### 1.1. Host setup
+Please follow:
+
* [Setup Manual](setup/index.md)
+(Optional)
+During VTS test runs, required Python packages are downloaded from the [Python Package Index](https://pypi.python.org/simple/). There is an option to instead install these packages from a local directory during test runtime by predownloading the packages. First run the lunch command, then set an environment variable VTS_PYPI_PATH as a new local directory to host the Python packages. Then run the download-pypi-packages.sh script:
+
+* `$ cd ${branch}`
+
+* `$ . test/vts/script/download-pypi-packages.sh`
+
### 1.2. Checkout master git repository
[Download Android Source Code](https://source.android.com/source/downloading.html)
diff --git a/script/pypi-packages-local.sh b/script/pypi-packages-local.sh
new file mode 100644
index 0000000..efc3d88
--- /dev/null
+++ b/script/pypi-packages-local.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+#
+# Copyright 2017 Google Inc. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+if [ -z "$ANDROID_BUILD_TOP" ]; then
+ echo "Please run the lunch command first."
+else
+ echo "Downloading PyPI packages"
+ sudo pip install -r $ANDROID_BUILD_TOP/test/vts/script/pip_requirements.txt
+ sudo pip install matplotlib # TODO(jaeshin): b/38371975, downloaded separately in download-pypi-packages.sh
+fi
diff --git a/script/setup.sh b/script/setup.sh
index d9a1555..5794b3c 100755
--- a/script/setup.sh
+++ b/script/setup.sh
@@ -28,27 +28,7 @@
sudo apt-get -y install python3-pip
sudo apt-get -y install python-virtualenv
-echo "Install Python modules for VTS Runner"
-sudo pip install future
-sudo pip install futures
-sudo pip install enum
-sudo pip install protobuf
-sudo pip install setuptools
-sudo pip install requests
-sudo pip install httplib2
-sudo pip install oauth2client
-sudo pip install google-api-python-client
-sudo pip install google-cloud-pubsub
-
-echo "Install packages for Kernel tests"
-sudo pip install parse
-sudo pip install ply
-
echo "Install packages for Camera ITS tests"
sudo apt-get -y install python-tk
-sudo pip install numpy
-sudo pip install scipy
-sudo pip install matplotlib
sudo apt-get -y install libjpeg-dev
sudo apt-get -y install libtiff-dev
-sudo pip install Pillow