summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.com>2018-03-14 22:16:23 +0100
committerAndreas Jaeger <aj@suse.com>2018-03-26 09:55:39 +0200
commitde8ae66407f77928ad83d99788d168e4f2b83ec8 (patch)
treee929d5b702b64b932575f8d6028af0e4295fcc02
parent990e4d5e57af0eceb7211a18e0b3cc727e69ef75 (diff)
Avoid tox-install.sh
Instead of using tox-install.sh, we can install horizon and neutron now directly from pypi - or use the current branch in CI system using tox-siblings. Update tox.ini for this change and add neutron to requirements file. Change-Id: Id401732c06ecfc3c10cfe89a88bb6b60beb9a519
Notes
Notes (review): Code-Review+2: Yushiro FURUKAWA <y.furukawa_2@jp.fujitsu.com> Workflow+1: Yushiro FURUKAWA <y.furukawa_2@jp.fujitsu.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Mon, 26 Mar 2018 09:25:33 +0000 Reviewed-on: https://review.openstack.org/553078 Project: openstack/networking-fujitsu Branch: refs/heads/master
-rw-r--r--requirements.txt4
-rwxr-xr-xtools/tox_install.sh70
-rw-r--r--tox.ini5
3 files changed, 7 insertions, 72 deletions
diff --git a/requirements.txt b/requirements.txt
index 03d5076..1e181ad 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -8,3 +8,7 @@ oslo.log>=3.36.0 # Apache-2.0
8oslo.utils>=3.33.0 # Apache-2.0 8oslo.utils>=3.33.0 # Apache-2.0
9paramiko>=2.0.0 # LGPLv2.1+ 9paramiko>=2.0.0 # LGPLv2.1+
10pbr!=2.1.0,>=2.0.0 # Apache-2.0 10pbr!=2.1.0,>=2.0.0 # Apache-2.0
11
12# These repos are installed from git in OpenStack CI if the job
13# configures them as required-projects:
14neutron>=12.0.0 # Apache-2.0
diff --git a/tools/tox_install.sh b/tools/tox_install.sh
deleted file mode 100755
index fb31ec2..0000000
--- a/tools/tox_install.sh
+++ /dev/null
@@ -1,70 +0,0 @@
1#!/usr/bin/env bash
2
3# Many of neutron's repos suffer from the problem of depending on neutron,
4# but it not existing on pypi.
5
6# This wrapper for tox's package installer will use the existing package
7# if it exists, else use zuul-cloner if that program exists, else grab it
8# from neutron master via a hard-coded URL. That last case should only
9# happen with devs running unit tests locally.
10
11# From the tox.ini config page:
12# install_command=ARGV
13# default:
14# pip install {opts} {packages}
15
16ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner
17BRANCH_NAME=master
18neutron_installed=$(echo "import neutron" | python 2>/dev/null ; echo $?)
19NEUTRON_DIR=$HOME/neutron
20
21set -e
22set -x
23
24install_cmd="pip install -c$1"
25shift
26
27# The devstack based functional tests have neutron checked out in
28# $NEUTRON_DIR on the test systems - with the change to test in it.
29# Use this directory if it exists, so that this script installs the
30# neutron version to test here.
31# Note that the functional tests use sudo to run tox and thus
32# variables used for zuul-cloner to check out the correct version are
33# lost.
34if [ -d "$NEUTRON_DIR" ]; then
35 echo "FOUND Neutron code at $NEUTRON_DIR - using"
36 $install_cmd -U -e $NEUTRON_DIR
37elif [ $neutron_installed -eq 0 ]; then
38 echo "ALREADY INSTALLED" > /tmp/tox_install.txt
39 location=$(python -c "import neutron; print(neutron.__file__)")
40 echo "ALREADY INSTALLED at $location"
41
42 echo "Neutron already installed; using existing package"
43elif [ -x "$ZUUL_CLONER" ]; then
44 echo "ZUUL CLONER" > /tmp/tox_install.txt
45 # Make this relative to current working directory so that
46 # git clean can remove it. We cannot remove the directory directly
47 # since it is referenced after $install_cmd -e.
48 mkdir -p .tmp
49 NEUTRON_DIR=$(/bin/mktemp -d -p $(pwd)/.tmp)
50 pushd $NEUTRON_DIR
51 $ZUUL_CLONER --cache-dir \
52 /opt/git \
53 --branch $BRANCH_NAME \
54 git://git.openstack.org \
55 openstack/neutron
56 cd openstack/neutron
57 $install_cmd -e .
58 popd
59else
60 echo "PIP HARDCODE" > /tmp/tox_install.txt
61 if [ -z "$NEUTRON_GIT_REPO" ]; then
62 NEUTRON_GIT_REPO="https://git.openstack.org/openstack/neutron"
63 fi
64 SRC_DIR="$VIRTUAL_ENV/src/neutron"
65 git clone --depth 1 --branch $BRANCH_NAME $NEUTRON_GIT_REPO $SRC_DIR
66 $install_cmd -U -e $SRC_DIR
67fi
68
69$install_cmd -U $*
70exit $?
diff --git a/tox.ini b/tox.ini
index 68c2ced..3132074 100644
--- a/tox.ini
+++ b/tox.ini
@@ -5,11 +5,12 @@ skipsdist = True
5 5
6[testenv] 6[testenv]
7usedevelop = True 7usedevelop = True
8install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} 8install_command = pip install {opts} {packages}
9setenv = 9setenv =
10 VIRTUAL_ENV={envdir} 10 VIRTUAL_ENV={envdir}
11 PYTHONWARNINGS=default::DeprecationWarning 11 PYTHONWARNINGS=default::DeprecationWarning
12deps = -r{toxinidir}/requirements.txt 12deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
13 -r{toxinidir}/requirements.txt
13 -r{toxinidir}/test-requirements.txt 14 -r{toxinidir}/test-requirements.txt
14whitelist_externals = bash find 15whitelist_externals = bash find
15commands = ostestr --regex '{posargs}' 16commands = ostestr --regex '{posargs}'