From babc91e956f8536a1f3a5ddd9f3c7275cc008a71 Mon Sep 17 00:00:00 2001 From: Andreas Scheuring Date: Tue, 17 Jan 2017 09:52:03 +0100 Subject: [PATCH] tox: don't check upper constraints Change-Id: I0d3fb8d08a2a4f193d52e87c8583a716dc83c6c0 --- tools/tox_install.sh | 30 ++++++++++++++++++++++++++++++ tox.ini | 3 ++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100755 tools/tox_install.sh diff --git a/tools/tox_install.sh b/tools/tox_install.sh new file mode 100755 index 0000000..9e6b126 --- /dev/null +++ b/tools/tox_install.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +# Client constraint file contains this client version pin that is in conflict +# 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" +shift 1 + +set -e + +# NOTE(tonyb): Place this in the tox enviroment's log dir so it will get +# 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" +fi + +curl "$CONSTRAINTS_FILE" --insecure --progress-bar --output "$localfile" + +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" + +pip install -c"$localfile" -U "$@" +exit $? \ No newline at end of file diff --git a/tox.ini b/tox.ini index cdf6e52..d92db08 100644 --- a/tox.ini +++ b/tox.ini @@ -5,10 +5,11 @@ skipsdist = True [testenv] usedevelop = True -install_command = pip install -c{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} setenv = VIRTUAL_ENV={envdir} PYTHONWARNINGS=default::DeprecationWarning + CLIENT_NAME=os-dpm deps = -r{toxinidir}/test-requirements.txt -r{toxinidir}/requirements.txt whitelist_externals = bash