summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.com>2017-12-20 11:44:10 +0100
committerAndreas Jaeger <aj@suse.com>2017-12-20 11:44:10 +0100
commitd317ab8c300da42da1b5566c00683c8fb00d9180 (patch)
tree501ab131fc6cf20a253ee33764b923270e8bb0ca
parentc70ab43107d638319706da3004762d7b5b689317 (diff)
Avoid tox_install.sh for constraints support
We do not need tox_install.sh, pip can handle constraints itself and install the project correctly. Thus update tox.ini and remove the now obsolete tools/tox_install.sh file. This follows https://review.openstack.org/#/c/508061 to remove tools/tox_install.sh. Change-Id: I12fe30e11c7462b6cada89b12946c0cd6fae1607
Notes
Notes (review): Code-Review+2: Berezovsky Irena <irenab.dev@gmail.com> Code-Review+2: Antoni Segura Puimedon <celebdor@gmail.com> Workflow+1: Antoni Segura Puimedon <celebdor@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Wed, 20 Dec 2017 14:54:39 +0000 Reviewed-on: https://review.openstack.org/529292 Project: openstack/kuryr Branch: refs/heads/master
-rwxr-xr-xtools/tox_install.sh53
-rw-r--r--tox.ini7
2 files changed, 4 insertions, 56 deletions
diff --git a/tools/tox_install.sh b/tools/tox_install.sh
deleted file mode 100755
index 4df42eb..0000000
--- a/tools/tox_install.sh
+++ /dev/null
@@ -1,53 +0,0 @@
1#!/usr/bin/env bash
2
3# [limao] This file is refer to tox_install.sh in neutron-lib.
4# Library constraint file contains this library version pin that is in conflict
5# with installing the library from source. We should replace the version pin in
6# the constraints file before applying it for from-source installation.
7
8ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner
9BRANCH_NAME=master
10LIB_NAME=kuryr-lib
11requirements_installed=$(echo "import openstack_requirements" | python 2>/dev/null ; echo $?)
12
13set -e
14
15CONSTRAINTS_FILE=$1
16shift
17
18install_cmd="pip install"
19mydir=$(mktemp -dt "$LIB_NAME-tox_install-XXXXXXX")
20trap "rm -rf $mydir" EXIT
21localfile=$mydir/upper-constraints.txt
22if [[ $CONSTRAINTS_FILE != http* ]]; then
23 CONSTRAINTS_FILE=file://$CONSTRAINTS_FILE
24fi
25curl $CONSTRAINTS_FILE -k -o $localfile
26install_cmd="$install_cmd -c$localfile"
27
28if [ $requirements_installed -eq 0 ]; then
29 echo "Requirements already installed; using existing package"
30elif [ -x "$ZUUL_CLONER" ]; then
31 pushd $mydir
32 $ZUUL_CLONER --cache-dir \
33 /opt/git \
34 --branch $BRANCH_NAME \
35 git://git.openstack.org \
36 openstack/requirements
37 cd openstack/requirements
38 $install_cmd -e .
39 popd
40else
41 if [ -z "$REQUIREMENTS_PIP_LOCATION" ]; then
42 REQUIREMENTS_PIP_LOCATION="git+https://git.openstack.org/openstack/requirements@$BRANCH_NAME#egg=requirements"
43 fi
44 $install_cmd -U -e ${REQUIREMENTS_PIP_LOCATION}
45fi
46
47# This is the main purpose of the script: Allow local installation of
48# the current repo. It is listed in constraints file and thus any
49# install will be constrained and we need to unconstrain it.
50edit-constraints $localfile -- $LIB_NAME "-e file://$PWD#egg=$LIB_NAME"
51
52$install_cmd -U $*
53exit $?
diff --git a/tox.ini b/tox.ini
index 9b1d4cf..457ed37 100644
--- a/tox.ini
+++ b/tox.ini
@@ -10,9 +10,10 @@ setenv = VIRTUAL_ENV={envdir}
10 PYTHONHASHSEED=0 10 PYTHONHASHSEED=0
11 PYTHONWARNINGS=default::DeprecationWarning 11 PYTHONWARNINGS=default::DeprecationWarning
12usedevelop = True 12usedevelop = True
13install_command = 13install_command = pip install {opts} {packages}
14 {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} 14deps =
15deps = -r{toxinidir}/requirements.txt 15 -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
16 -r{toxinidir}/requirements.txt
16 -r{toxinidir}/test-requirements.txt 17 -r{toxinidir}/test-requirements.txt
17whitelist_externals = sh 18whitelist_externals = sh
18 find 19 find