Make tox runnable in a directory with spaces

I noticed a disturbing lack of quote-wrapping in change
I7cb4b44952713752435e1faf0f63bf0d37e7dda6 but as I poked at it, I
realized that trouble runs rampant.

This seems to clean it all up, though I haven't tested *every*
environment we define.

Change-Id: I1454eb113e5bd9125d39f2e57e2ed96f6ddc42fc
This commit is contained in:
Tim Burke
2017-11-28 11:02:45 -08:00
parent 2b3a659da4
commit cb2778659e
2 changed files with 10 additions and 9 deletions

View File

@@ -4,7 +4,7 @@
# with installing the client from source. We should remove the version pin in
# the constraints file before applying it for from-source installation.
CONSTRAINTS_FILE=$1
CONSTRAINTS_FILE="$1"
shift 1
set -e
@@ -13,18 +13,18 @@ set -e
# published to logs.openstack.org for easy debugging.
localfile="$VIRTUAL_ENV/log/upper-constraints.txt"
if [[ $CONSTRAINTS_FILE != http* ]]; then
CONSTRAINTS_FILE=file://$CONSTRAINTS_FILE
if [[ "$CONSTRAINTS_FILE" != http* ]]; then
CONSTRAINTS_FILE="file://$CONSTRAINTS_FILE"
fi
# NOTE(tonyb): need to add curl to bindep.txt if the project supports bindep
curl $CONSTRAINTS_FILE --insecure --progress-bar --output $localfile
curl "$CONSTRAINTS_FILE" --insecure --progress-bar --output "$localfile"
pip install -c$localfile openstack-requirements
python -m pip install -c"$localfile" openstack-requirements
# This is the main purpose of the script: Allow local installation of
# the current repo. It is listed in constraints file and thus any
# install will be constrained and we need to unconstrain it.
edit-constraints $localfile -- $CLIENT_NAME
python "$(which edit-constraints)" "$localfile" -- $CLIENT_NAME
pip install -c$localfile -U $*
python -m pip install -c"$localfile" -U "$@"
exit $?

View File

@@ -5,7 +5,8 @@ skipsdist = True
[testenv]
usedevelop = True
install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
install_command = "{toxinidir}/tools/tox_install.sh" "{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}" {opts} {packages}
list_dependencies_command = python -m pip freeze
setenv =
LANG=en_US.utf8
VIRTUAL_ENV={envdir}
@@ -24,7 +25,7 @@ passenv = SWIFT_* *_proxy
[testenv:pep8]
commands =
flake8 swiftclient tests
python -m flake8 swiftclient tests
[testenv:venv]
commands = {posargs}