diff --git a/docker/python-builder/scripts/assemble b/docker/python-builder/scripts/assemble index 611ff44f82..6b314170c8 100755 --- a/docker/python-builder/scripts/assemble +++ b/docker/python-builder/scripts/assemble @@ -73,6 +73,8 @@ function install_wheels { done } +PACKAGES=$* + # bindep the main package install_bindep @@ -83,17 +85,25 @@ for sibling in ${ZUUL_SIBLINGS:-}; do 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 +# If we got a list of packages, install them, otherwise install the +# main package. +if [[ $PACKAGES ]] ; then + /tmp/venv/bin/pip install --cache-dir=/output/wheels $PACKAGES + for package in $PACKAGES ; do + echo "$package" >> /output/packages.txt + done +else + # 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 + + install_wheels +fi # go through ZUUL_SIBLINGS, if any, and build those wheels too for sibling in ${ZUUL_SIBLINGS:-}; do diff --git a/docker/python-builder/scripts/install-from-bindep b/docker/python-builder/scripts/install-from-bindep index 742028c88a..35cc1664a3 100755 --- a/docker/python-builder/scripts/install-from-bindep +++ b/docker/python-builder/scripts/install-from-bindep @@ -32,11 +32,17 @@ for extra in $* ; do EXTRAS="${EXTRAS} -f /output/$extra/requirements.txt" done -# Install the wheels. Use --force here because sibling wheels might -# be built with the same version number as the latest release, but we -# really want the speculatively built wheels installed over any -# automatic dependencies. -pip install --force --cache-dir=/output/wheels /output/wheels/*.whl $EXTRAS +if [ -f /output/packages.txt ] ; then + # If a package list was passed to assemble, install that in the final + # image. + pip install --cache-dir=/output/wheels -r /output/packages.txt $EXTRAS +else + # Install the wheels. Use --force here because sibling wheels might + # be built with the same version number as the latest release, but we + # really want the speculatively built wheels installed over any + # automatic dependencies. + pip install --force --cache-dir=/output/wheels /output/wheels/*.whl $EXTRAS +fi # clean up after ourselves apt-get clean