summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtools/tox_install.sh55
-rw-r--r--tox.ini10
2 files changed, 6 insertions, 59 deletions
diff --git a/tools/tox_install.sh b/tools/tox_install.sh
deleted file mode 100755
index 66b6710..0000000
--- a/tools/tox_install.sh
+++ /dev/null
@@ -1,55 +0,0 @@
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 replace the version pin in
5# the constraints file before applying it for from-source installation.
6
7ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner
8BRANCH_NAME=master
9CLIENT_NAME=python-muranoclient
10requirements_installed=$(echo "import openstack_requirements" | python 2>/dev/null ; echo $?)
11
12set -e
13
14CONSTRAINTS_FILE=$1
15shift
16
17install_cmd="pip install"
18mydir=$(mktemp -dt "$CLIENT_NAME-tox_install-XXXXXXX")
19trap "rm -rf $mydir" EXIT
20localfile=$mydir/upper-constraints.txt
21if [[ $CONSTRAINTS_FILE != http* ]]; then
22 CONSTRAINTS_FILE=file://$CONSTRAINTS_FILE
23fi
24curl $CONSTRAINTS_FILE -k -o $localfile
25install_cmd="$install_cmd -c$localfile"
26
27if [ $requirements_installed -eq 0 ]; then
28 echo "ALREADY INSTALLED" > /tmp/tox_install.txt
29 echo "Requirements already installed; using existing package"
30elif [ -x "$ZUUL_CLONER" ]; then
31 echo "ZUUL CLONER" > /tmp/tox_install.txt
32 pushd $mydir
33 $ZUUL_CLONER --cache-dir \
34 /opt/git \
35 --branch $BRANCH_NAME \
36 git://git.openstack.org \
37 openstack/requirements
38 cd openstack/requirements
39 $install_cmd -e .
40 popd
41else
42 echo "PIP HARDCODE" > /tmp/tox_install.txt
43 if [ -z "$REQUIREMENTS_PIP_LOCATION" ]; then
44 REQUIREMENTS_PIP_LOCATION="git+https://git.openstack.org/openstack/requirements@$BRANCH_NAME#egg=requirements"
45 fi
46 $install_cmd -U -e ${REQUIREMENTS_PIP_LOCATION}
47fi
48
49# This is the main purpose of the script: Allow local installation of
50# the current repo. It is listed in constraints file and thus any
51# install will be constrained and we need to unconstrain it.
52edit-constraints $localfile -- $CLIENT_NAME "-e file://$PWD#egg=$CLIENT_NAME"
53
54$install_cmd -U $*
55exit $?
diff --git a/tox.ini b/tox.ini
index 6ea40e5..be2c932 100644
--- a/tox.ini
+++ b/tox.ini
@@ -7,11 +7,11 @@ skipsdist = True
7usedevelop = True 7usedevelop = True
8whitelist_externals = bash 8whitelist_externals = bash
9 find 9 find
10install_command = 10install_command = pip install {opts} {packages}
11 {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
12setenv = VIRTUAL_ENV={envdir} 11setenv = VIRTUAL_ENV={envdir}
13passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY 12passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
14deps = 13deps =
14 -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
15 -r{toxinidir}/requirements.txt 15 -r{toxinidir}/requirements.txt
16 -r{toxinidir}/test-requirements.txt 16 -r{toxinidir}/test-requirements.txt
17commands = bash tools/pretty_tox.sh '{posargs}' 17commands = bash tools/pretty_tox.sh '{posargs}'
@@ -20,7 +20,7 @@ commands = bash tools/pretty_tox.sh '{posargs}'
20commands = flake8 {posargs} 20commands = flake8 {posargs}
21 21
22[testenv:py27-mitaka] 22[testenv:py27-mitaka]
23install_command = 23install_command = pip install -U {opts} {packages}
24 {toxinidir}/tools/tox_install.sh https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/mitaka {opts} {packages} 24 {toxinidir}/tools/tox_install.sh https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/mitaka {opts} {packages}
25 25
26[testenv:venv] 26[testenv:venv]
@@ -43,7 +43,9 @@ commands =
43 oslo_debug_helper -t muranoclient/tests {posargs} 43 oslo_debug_helper -t muranoclient/tests {posargs}
44 44
45[testenv:pyflakes] 45[testenv:pyflakes]
46deps = flake8 46deps =
47 -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
48 flake8
47commands = flake8 49commands = flake8
48 50
49[testenv:releasenotes] 51[testenv:releasenotes]