fix: install Python dependencies
This change adds a new script - `install_python_deps_tf.sh` - which
creates and loads a clean Python virtual environment and within it
installs TF-A's Python dependencies.
The previous method for doing this (sourcing the environment from
within the pre-build hook) was not working as the environment was going
out of scope after returning from the function.
Change-Id: I1c2e404665853d33212254ad576a8095b5c25aa0
Signed-off-by: Chris Kay <chris.kay@arm.com>
diff --git a/script/build_package.sh b/script/build_package.sh
index 10d1df4..a52b3f3 100755
--- a/script/build_package.sh
+++ b/script/build_package.sh
@@ -1387,6 +1387,8 @@
source "$plat_utils"
fi
+ source "$ci_root/script/install_python_deps_tf.sh"
+
archive="$build_archive"
tf_build_root="$tf_root/build"
diff --git a/script/install_python_deps_tf.sh b/script/install_python_deps_tf.sh
new file mode 100644
index 0000000..1103181
--- /dev/null
+++ b/script/install_python_deps_tf.sh
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+python3 -m venv .venv && \
+ . .venv/bin/activate && \
+ python3 -m pip install -r "$tf_root/docs/requirements.txt"