summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.com>2018-03-14 21:04:06 +0100
committerAndreas Jaeger <aj@suse.com>2018-03-20 09:42:20 +0100
commit0525d287672589f9edad7a9c93dbf2d79375505e (patch)
tree4932d1ce2e679195314c3382a0c6c803ef3ed8c4
parentbafb47595df33e5be4d628617e3a2b8a0ccaf783 (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 horizon to requirements file. Change-Id: I898fb222f5b36714c61e60c222e8b57ddea99df6
Notes
Notes (review): Code-Review+2: Kazunori Shinohara <ksnhr.tech@gmail.com> Workflow+1: Kazunori Shinohara <ksnhr.tech@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Tue, 20 Mar 2018 11:20:26 +0000 Reviewed-on: https://review.openstack.org/553039 Project: openstack/heat-dashboard Branch: refs/heads/master
-rw-r--r--requirements.txt4
-rw-r--r--test-requirements.txt2
-rwxr-xr-xtools/tox_install.sh65
-rw-r--r--tox.ini12
4 files changed, 10 insertions, 73 deletions
diff --git a/requirements.txt b/requirements.txt
index 450f3f9..570ec36 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -9,3 +9,7 @@
9# PBR should always appear first 9# PBR should always appear first
10pbr!=2.1.0,>=2.0.0 # Apache-2.0 10pbr!=2.1.0,>=2.0.0 # Apache-2.0
11python-heatclient>=1.10.0 # Apache-2.0 11python-heatclient>=1.10.0 # Apache-2.0
12
13# This will be installed from git in OpenStack CI if the job setting
14# required-projects for horizon:
15horizon>=13.0.0 # Apache-2.0
diff --git a/test-requirements.txt b/test-requirements.txt
index fd81553..8842a87 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -22,5 +22,3 @@ nosehtmloutput>=0.0.3 # Apache-2.0
22nosexcover>=1.0.10 # BSD 22nosexcover>=1.0.10 # BSD
23openstack.nose-plugin>=0.7 # Apache-2.0 23openstack.nose-plugin>=0.7 # Apache-2.0
24testtools>=2.2.0 # MIT 24testtools>=2.2.0 # MIT
25# This also needs xvfb library installed on your OS
26http://tarballs.openstack.org/horizon/horizon-master.tar.gz#egg=horizon
diff --git a/tools/tox_install.sh b/tools/tox_install.sh
deleted file mode 100755
index ebb8315..0000000
--- a/tools/tox_install.sh
+++ /dev/null
@@ -1,65 +0,0 @@
1#!/usr/bin/env bash
2
3# Many of horizon's repos suffer from the problem of depending on horizon,
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 horizon 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
18GIT_BASE=${GIT_BASE:-https://git.openstack.org/}
19
20install_project() {
21 local project=$1
22 local branch=${2:-$BRANCH_NAME}
23 local module_name=${project//-/_}
24
25 set +e
26 project_installed=$(echo "import $module_name" | python 2>/dev/null ; echo $?)
27 set -e
28
29 if [ $project_installed -eq 0 ]; then
30 echo "ALREADY INSTALLED" > /tmp/tox_install.txt
31 echo "$project already installed; using existing package"
32 elif [ -x "$ZUUL_CLONER" ]; then
33 echo "ZUUL CLONER" > /tmp/tox_install.txt
34 # Make this relative to current working directory so that
35 # git clean can remove it. We cannot remove the directory directly
36 # since it is referenced after $install_cmd -e
37 mkdir -p .tmp
38 PROJECT_DIR=$(/bin/mktemp -d -p $(pwd)/.tmp)
39 pushd $PROJECT_DIR
40 $ZUUL_CLONER --cache-dir \
41 /opt/git \
42 --branch $branch \
43 http://git.openstack.org \
44 openstack/$project
45 cd openstack/$project
46 $install_cmd -e .
47 popd
48 else
49 echo "PIP HARDCODE" > /tmp/tox_install.txt
50 local GIT_REPO="$GIT_BASE/openstack/$project"
51 SRC_DIR="$VIRTUAL_ENV/src/$project"
52 git clone --depth 1 --branch $branch $GIT_REPO $SRC_DIR
53 $install_cmd -U -e $SRC_DIR
54 fi
55}
56
57set -e
58
59install_cmd="pip install -c$1"
60shift
61
62install_project horizon
63
64$install_cmd -U $*
65exit $?
diff --git a/tox.ini b/tox.ini
index 9b703fe..c073f66 100644
--- a/tox.ini
+++ b/tox.ini
@@ -5,9 +5,6 @@ skipsdist = True
5 5
6[testenv] 6[testenv]
7usedevelop = True 7usedevelop = True
8install_command = {toxinidir}/tools/tox_install.sh \
9 {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} \
10 {opts} {packages}
11setenv = 8setenv =
12 VIRTUAL_ENV={envdir} 9 VIRTUAL_ENV={envdir}
13 INTEGRATION_TESTS=0 10 INTEGRATION_TESTS=0
@@ -16,7 +13,8 @@ setenv =
16 NOSE_OPENSTACK_RED=0.05 13 NOSE_OPENSTACK_RED=0.05
17 NOSE_OPENSTACK_YELLOW=0.025 14 NOSE_OPENSTACK_YELLOW=0.025
18 NOSE_OPENSTACK_SHOW_ELAPSED=1 15 NOSE_OPENSTACK_SHOW_ELAPSED=1
19deps = -r{toxinidir}/requirements.txt 16deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
17 -r{toxinidir}/requirements.txt
20 -r{toxinidir}/test-requirements.txt 18 -r{toxinidir}/test-requirements.txt
21commands = 19commands =
22 py27: {[unit_tests]commands} 20 py27: {[unit_tests]commands}
@@ -91,11 +89,13 @@ commands =
91 {[unit_tests]commands} 89 {[unit_tests]commands}
92 90
93[testenv:docs] 91[testenv:docs]
94deps = -r{toxinidir}/doc/requirements.txt 92deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
93 -r{toxinidir}/doc/requirements.txt
95commands = python setup.py build_sphinx 94commands = python setup.py build_sphinx
96 95
97[testenv:releasenotes] 96[testenv:releasenotes]
98deps = -r{toxinidir}/doc/requirements.txt 97deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
98 -r{toxinidir}/doc/requirements.txt
99commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html 99commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
100 100
101[hacking] 101[hacking]