feat: add support for poetry

Poetry will be used for tracking python package dependencies. Utilise
poetry when running scripts. Ensure that the internal CI has access to
to the package.

Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
Change-Id: I3b0991f4fdadc678b50a6bfdce1b374a7e524c2b
diff --git a/script/build_package.sh b/script/build_package.sh
index 63dc520..12eddae 100755
--- a/script/build_package.sh
+++ b/script/build_package.sh
@@ -542,7 +542,7 @@
 
 	# Build TF. Since build output is being directed to the build log, have
 	# descriptor 3 point to the current terminal for build wrappers to vent.
-	$tf_build_wrapper make $make_j_opts $(cat "$config_file") \
+	$tf_build_wrapper poetry run make $make_j_opts $(cat "$config_file") \
 		DEBUG="$DEBUG" V=1 SPIN_ON_BL1_EXIT="$connect_debugger" \
 		$build_targets 3>&1 &>>"$build_log" || fail_build
 	)
@@ -1445,7 +1445,12 @@
 			source "$plat_utils"
 		fi
 
-		source "$ci_root/script/install_python_deps_tf.sh"
+		# Install python build dependencies
+		if is_arm_jenkins_env; then
+			source "$ci_root/script/install_python_deps_tf.sh"
+		fi
+
+		poetry -C "$tf_root" install --without doc
 
 		fvp_tsram_size="$(get_tf_opt FVP_TRUSTED_SRAM_SIZE)"
 		fvp_tsram_size="${fvp_tsram_size:-256}"