From ce0c76813eae3a0c27cbed14cf8b93bdfcde165b Mon Sep 17 00:00:00 2001 From: Andrii Ostapenko Date: Wed, 17 Oct 2018 15:52:56 -0500 Subject: [PATCH] Install pip packages during requirements build Install packages from PIP_PACKAGES before wheel build to be able to limit dependencies specified in "setup_requires" of packages listed in upper-constraints.txt, that pip has no way to control. This is intended to work around https://github.com/lxc/pylxd/issues/308 or similar issues. Change-Id: I36bd4347727b4c7f4beea2cdba6674445fbb4ca4 --- scripts/requirements.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/requirements.sh b/scripts/requirements.sh index 176b485..3808ff4 100755 --- a/scripts/requirements.sh +++ b/scripts/requirements.sh @@ -29,6 +29,17 @@ export CASS_DRIVER_BUILD_CONCURRENCY=8 # NOTE(hrw): Drop python packages requested by monasca_analytics. Their # build time is huge and on !x86 we do not get binaries from Pypi. egrep -v "(scipy|scikit-learn)" /upper-constraints.txt | split -l1 + +# NOTE(aostapenko): When a package uses the variable 'setup_requires' in 'setup.py', 'pip wheel' +# dependency management will be overridden, resulting in possible incompatibilities +# between packages. Installing packages using upper-constraints.txt before building the wheels +# ensures the correct package versions will be available and installed locally. +# https://pip.readthedocs.io/en/stable/user_guide/#installation-bundles +# This allows to work around such issues as https://github.com/lxc/pylxd/issues/308 +if [ ! -z "${PIP_PACKAGES}" ]; then + pip install -c /upper-constraints.txt ${PIP_PACKAGES} +fi + echo uwsgi enum-compat ${PIP_PACKAGES} | xargs -n1 | split -l1 -a3 ls -1 | xargs -n1 -P20 -t bash -c 'pip wheel --no-deps --wheel-dir / -c /upper-constraints.txt -r $1 || echo %1 >> /failure' _ | tee /tmp/wheels.txt