Files
cinderlib/tools/special_install.sh
Brian Rosmaita e4dd75a3b4 Add local upper constraints support
The issue is that we want to install os-brick from source, but if we
do this using upper-constraints on the install, it will fail.  This
patch modifies the tox install command used by appropriate testenvs
so it will create and use a local constraints file with os-brick
removed.

The local u-c file is named 'local-upper-constraints.txt'.  The
constraints file used can be overridden via the
CINDERLIB_CONSTRAINTS_FILE environment variable.

Change-Id: I8cb4085dd465043a783c974886f56e49820871a1
2022-06-25 06:25:13 +00:00

24 lines
741 B
Bash
Executable File

#!/bin/bash
# special-purpose pip installer, intended for tox use only
INSTALL_CMD="$*"
# need to know the toxinidir
if [[ -z "${TOX_INI_DIR:-}" ]] ; then
echo "[error] This testenv must set the TOX_INI_DIR env var"
exit 1
fi
if [[ -z "${CINDERLIB_CONSTRAINTS_FILE:-}" ]] ; then
# generate the local constraints file without os_brick
$TOX_INI_DIR/tools/generate_uc.sh -d $TOX_INI_DIR -n -x $CINDERLIB_RELEASE
# use the absolute path to the generated file
CINDERLIB_CONSTRAINTS_FILE="${TOX_INI_DIR}/local-upper-constraints.txt"
fi
# need to specify that we want the python in this testenv, not
# the default python bash would use
$TOX_ENV_DIR/bin/python -m pip install -c$CINDERLIB_CONSTRAINTS_FILE $INSTALL_CMD