From 5e12438e0dbed995e2ae1c74e89d068ea03164f9 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Tue, 3 Dec 2019 11:13:56 -0600 Subject: [PATCH] Split bindep and wheel invocations We need to run bindep before installing git, because otherwise if a project needs git in its bindep, it won't show up because it'll be on the build host. Split the function in two and call them before and after the git installation. Change-Id: I316b1bc643eb9293500b31e676361eec7060701d --- docker/python-builder/scripts/assemble | 37 +++++++++++++++++--------- 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/docker/python-builder/scripts/assemble b/docker/python-builder/scripts/assemble index 83a9ba939d..611ff44f82 100755 --- a/docker/python-builder/scripts/assemble +++ b/docker/python-builder/scripts/assemble @@ -27,15 +27,7 @@ cd /tmp/src apt-get update -# pbr needs git installed, else nothing will work -apt-get install -y git - -# Use a clean virtualenv for install steps to prevent things from the -# current environment making us not build a wheel. -python -m venv /tmp/venv -/tmp/venv/bin/pip install -U pip wheel - -function install_pwd { +function install_bindep { # Protect from the bindep builder image use of the assemble script # to produce a wheel. Note we append because we want all # sibling packages in here too @@ -46,7 +38,9 @@ function install_pwd { apt-get install -y ${compile_packages} fi fi +} +function install_wheels { # Build a wheel so that we have an install target. # pip install . in the container context with the mounted # source dir gets ... exciting. @@ -79,13 +73,32 @@ function install_pwd { done } -# Install the main package -install_pwd +# bindep the main package +install_bindep # go through ZUUL_SIBLINGS, if any, and build those wheels too for sibling in ${ZUUL_SIBLINGS:-}; do pushd .zuul-siblings/${sibling} - install_pwd + install_bindep + popd +done + +# pbr needs git installed, else nothing will work. Do this in between +# bindep and wheel so that we don't miss git in target images. +apt-get install -y git + +# Use a clean virtualenv for install steps to prevent things from the +# current environment making us not build a wheel. +python -m venv /tmp/venv +/tmp/venv/bin/pip install -U pip wheel + +# Install the main package +install_wheels + +# go through ZUUL_SIBLINGS, if any, and build those wheels too +for sibling in ${ZUUL_SIBLINGS:-}; do + pushd .zuul-siblings/${sibling} + install_wheels popd done