From cb2778659e8d69d8741ca3167314862f8555a989 Mon Sep 17 00:00:00 2001 From: Tim Burke Date: Tue, 28 Nov 2017 11:02:45 -0800 Subject: 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 --- tools/tox_install.sh | 14 +++++++------- tox.ini | 5 +++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tools/tox_install.sh b/tools/tox_install.sh index 43468e4..f3a83e9 100755 --- a/tools/tox_install.sh +++ b/tools/tox_install.sh @@ -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 $? diff --git a/tox.ini b/tox.ini index 303ce66..e737241 100644 --- a/tox.ini +++ b/tox.ini @@ -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} -- cgit v1.2.1