summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-12-21 23:11:49 +0000
committerGerrit Code Review <review@openstack.org>2016-12-21 23:11:49 +0000
commit927351f011ae3d185811562bc93f27c343dfcf3a (patch)
treed38268782fcb9e066d0ce5431eed1582167824a0
parentc61d2d47bd39c31f1cd06faf497ffa85ae66cdd4 (diff)
parenta07e1320e74d913b4983ef0f3c8cf20ea1775b13 (diff)
downloadoslo-db-927351f011ae3d185811562bc93f27c343dfcf3a.tar.gz
Merge "Add Constraints support"
-rwxr-xr-xtools/tox_install.sh30
-rw-r--r--tox.ini5
2 files changed, 34 insertions, 1 deletions
diff --git a/tools/tox_install.sh b/tools/tox_install.sh
new file mode 100755
index 0000000..e61b63a
--- /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
+# NOTE(tonyb): need to add curl to bindep.txt if the project supports bindep
+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 $?
diff --git a/tox.ini b/tox.ini
index a1d7bf0..3767b73 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,13 +1,16 @@
[tox]
-minversion = 1.8
+minversion = 2.0
envlist = py35,py34,py27,pep8,pip-missing-reqs
[testenv]
+install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
whitelist_externals = bash
env
setenv =
VIRTUAL_ENV={envdir}
BASECOMMAND=bash tools/pretty_tox.sh
+ BRANCH_NAME=master
+ CLIENT_NAME=oslo.db
{postgresql,all}: PIFPAF_POSTGRESQL=pifpaf -g OS_TEST_DBAPI_ADMIN_CONNECTION run postgresql --
{mysql,all}: PIFPAF_MYSQL=pifpaf -g OS_TEST_DBAPI_ADMIN_CONNECTION run mysql --