From ba3a0eb7754399adfe6fe186e2bfa30268a19981 Mon Sep 17 00:00:00 2001
From: Monty Taylor <mordred@inaugust.com>
Date: Wed, 22 Apr 2020 14:37:54 -0500
Subject: [PATCH] Allow requesting a list of extras to install

We produce lists of extras requirements to install, but installing
them takes an extra step. Allow it to be done all at once by accepting
names of extras on the install-from-bindep command line.

Change-Id: Ie75b9a668569c759f78b70617e311ed6f025039a
---
 docker/python-builder/scripts/install-from-bindep | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/docker/python-builder/scripts/install-from-bindep b/docker/python-builder/scripts/install-from-bindep
index b78343bc6e..742028c88a 100755
--- a/docker/python-builder/scripts/install-from-bindep
+++ b/docker/python-builder/scripts/install-from-bindep
@@ -26,11 +26,17 @@ if [ -f /output/requirements.txt ] ; then
     pip install --cache-dir=/output/wheels -r /output/requirements.txt
 fi
 
+# Add any requested extras to the list of things to install
+EXTRAS=""
+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
+pip install --force --cache-dir=/output/wheels /output/wheels/*.whl $EXTRAS
 
 # clean up after ourselves
 apt-get clean