summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-02-17 03:43:33 +0000
committerGerrit Code Review <review@openstack.org>2017-02-17 03:43:33 +0000
commit6dc818d9dd4cb0b0dbc6b42aee78dcffc2ce1621 (patch)
tree373f3ca6cfffe927d5e4996cb4df642606301223
parent6db35ea998bf517eebb73b81b5020ee822c01906 (diff)
parent05b2c645bb48f98754693d0194c997ce8c3dbd5b (diff)
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 @@
1#!/usr/bin/env bash
2
3# Client constraint file contains this client version pin that is in conflict
4# with installing the client from source. We should remove the version pin in
5# the constraints file before applying it for from-source installation.
6
7CONSTRAINTS_FILE="$1"
8shift 1
9
10set -e
11
12# NOTE(tonyb): Place this in the tox enviroment's log dir so it will get
13# published to logs.openstack.org for easy debugging.
14localfile="$VIRTUAL_ENV/log/upper-constraints.txt"
15
16if [[ "$CONSTRAINTS_FILE" != http* ]]; then
17 CONSTRAINTS_FILE="file://$CONSTRAINTS_FILE"
18fi
19# NOTE(tonyb): need to add curl to bindep.txt if the project supports bindep
20curl "$CONSTRAINTS_FILE" --insecure --progress-bar --output "$localfile"
21
22pip install -c"$localfile" openstack-requirements
23
24# This is the main purpose of the script: Allow local installation of
25# the current repo. It is listed in constraints file and thus any
26# install will be constrained and we need to unconstrain it.
27edit-constraints "$localfile" -- "$CLIENT_NAME"
28
29pip install -c"$localfile" -U "$@"
30exit $?
diff --git a/tox.ini b/tox.ini
index 2cb62d0..7616bf2 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,8 +1,12 @@
1[tox] 1[tox]
2minversion = 2.0
2envlist = py34,py27,pep8 3envlist = py34,py27,pep8
3 4
4[testenv] 5[testenv]
6install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
5setenv = VIRTUAL_ENV={envdir} 7setenv = VIRTUAL_ENV={envdir}
8 BRANCH_NAME=master
9 CLIENT_NAME=mox3
6deps = -r{toxinidir}/requirements.txt 10deps = -r{toxinidir}/requirements.txt
7 -r{toxinidir}/test-requirements.txt 11 -r{toxinidir}/test-requirements.txt
8commands = 12commands =
@@ -18,7 +22,6 @@ commands = flake8
18commands = {posargs} 22commands = {posargs}
19 23
20[testenv:cover] 24[testenv:cover]
21setenv = VIRTUAL_ENV={envdir}
22commands = 25commands =
23 python setup.py testr --coverage 26 python setup.py testr --coverage
24 27