summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWitold Bedyk <witold.bedyk@est.fujitsu.com>2018-02-09 15:31:24 +0100
committerWitold Bedyk <witold.bedyk@est.fujitsu.com>2018-02-09 15:31:24 +0100
commitba64c4e9226c587d0c116f08b9d20e9ad51f4682 (patch)
tree59df70cc01cee72a27a324849482c9dec95d6bf3
parent1a91c0d9a57912bbd10facc478fefb1dba51edfd (diff)
Clean up tox.ini
Notes
Notes (review): Code-Review+2: Amir Mofakhar <amofakhar@op5.com> Code-Review+2: Dobroslaw Zybort <dobroslaw.zybort@ts.fujitsu.com> Workflow+1: Dobroslaw Zybort <dobroslaw.zybort@ts.fujitsu.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Mon, 19 Feb 2018 11:48:14 +0000 Reviewed-on: https://review.openstack.org/542852 Project: openstack/monasca-notification Branch: refs/heads/master
-rwxr-xr-xtools/tox_install.sh57
-rw-r--r--tox.ini11
2 files changed, 6 insertions, 62 deletions
diff --git a/tools/tox_install.sh b/tools/tox_install.sh
deleted file mode 100755
index f8a403d..0000000
--- a/tools/tox_install.sh
+++ /dev/null
@@ -1,57 +0,0 @@
1#!/usr/bin/env bash
2
3# Constraint file contains this package version pin that is in conflict
4# with installing the package 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
9PACKAGE_NAME=monasca-notification
10requirements_installed=$(echo "import openstack_requirements" | python 2>/dev/null ; echo $?)
11
12set -e
13
14git config --global url.https://git.openstack.org/.insteadOf git://git.openstack.org/
15
16CONSTRAINTS_FILE=$1
17shift
18
19install_cmd="pip install"
20mydir=$(mktemp -dt "$PACKAGE_NAME-tox_install-XXXXXXX")
21trap "rm -rf $mydir" EXIT
22localfile=$mydir/upper-constraints.txt
23if [[ $CONSTRAINTS_FILE != http* ]]; then
24 CONSTRAINTS_FILE=file://$CONSTRAINTS_FILE
25fi
26curl $CONSTRAINTS_FILE -k -o $localfile
27install_cmd="$install_cmd -c$localfile"
28
29if [ $requirements_installed -eq 0 ]; then
30 echo "ALREADY INSTALLED" > /tmp/tox_install.txt
31 echo "Requirements already installed; using existing package"
32elif [ -x "$ZUUL_CLONER" ]; then
33 echo "ZUUL CLONER" > /tmp/tox_install.txt
34 pushd $mydir
35 $ZUUL_CLONER --cache-dir \
36 /opt/git \
37 --branch $BRANCH_NAME \
38 git://git.openstack.org \
39 openstack/requirements
40 cd openstack/requirements
41 $install_cmd -e .
42 popd
43else
44 echo "PIP HARDCODE" > /tmp/tox_install.txt
45 if [ -z "$REQUIREMENTS_PIP_LOCATION" ]; then
46 REQUIREMENTS_PIP_LOCATION="git+https://git.openstack.org/openstack/requirements@$BRANCH_NAME#egg=requirements"
47 fi
48 $install_cmd -U -e ${REQUIREMENTS_PIP_LOCATION}
49fi
50
51# This is the main purpose of the script: Allow local installation of
52# the current repo. It is listed in constraints file and thus any
53# install will be constrained and we need to unconstrain it.
54edit-constraints $localfile -- $PACKAGE_NAME "-e file://$PWD#egg=$PACKAGE_NAME"
55
56$install_cmd -U $*
57exit $?
diff --git a/tox.ini b/tox.ini
index 9e2204c..bd83fac 100644
--- a/tox.ini
+++ b/tox.ini
@@ -7,18 +7,19 @@ skipsdist = True
7setenv = 7setenv =
8 VIRTUAL_ENV={envdir} 8 VIRTUAL_ENV={envdir}
9 OS_TEST_PATH=tests 9 OS_TEST_PATH=tests
10 CLIENT_NAME=monasca-notification
11passenv = 10passenv =
12 *_proxy 11 *_proxy
13 *_PROXY 12 *_PROXY
14usedevelop = True 13usedevelop = True
15install_command = 14install_command = pip install {opts} {packages}
16 {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} --pre
17whitelist_externals = bash 15whitelist_externals = bash
18 find 16 find
19 rm 17 rm
20deps = -r{toxinidir}/test-requirements.txt 18deps =
21 .[jira_plugin] 19 -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
20 -r{toxinidir}/requirements.txt
21 -r{toxinidir}/test-requirements.txt
22 .[jira_plugin]
22commands = 23commands =
23 find . -type f -name "*.pyc" -delete 24 find . -type f -name "*.pyc" -delete
24 rm -Rf .testrepository/times.dbm 25 rm -Rf .testrepository/times.dbm