Avoid tox-install.sh

Instead of using tox-install.sh, we can install horizon now directly
from pypi - or use the current branch in CI system using tox-siblings.

Create doc/requriements.txt for doc requirements as well.

Update tox.ini for this change and add horizon to requirements
file.

Change-Id: I35fb782b7bad4c046930926c43b0f7b3c1bb07b7
This commit is contained in:
Andreas Jaeger 2018-03-07 07:58:45 +01:00 committed by Brianna Poulos
parent bbcebe522f
commit a17eb51430
5 changed files with 21 additions and 77 deletions

9
doc/requirements.txt Normal file
View File

@ -0,0 +1,9 @@
openstackdocstheme>=1.16.0 # Apache-2.0
reno # Apache-2.0
sphinx>=1.6.2 # BSD
# Needed for building docs
django-nose>=1.4.4 # BSD
mock>=2.0 # BSD
mox3 # Apache-2.0
horizon>=13.0.0 # Apache-2.0

View File

@ -12,6 +12,6 @@ Babel>=2.3.4,!=2.4.0 # BSD
Django>=1.8,<2.0 # BSD
django-babel>=0.5.1 # BSD
django_compressor>=2.0 # MIT
django_openstack_auth>=3.5.0 # Apache-2.0
django-pyscss>=2.0.2 # BSD License (2 clause)
castellan>=0.7.0 # Apache-2.0
horizon>=13.0.0 # Apache-2.0

View File

@ -12,17 +12,14 @@ hacking>=0.12.0,!=0.13.0,<0.14 # Apache-2.0
coverage>=4.0,!=4.4 # Apache-2.0
django-nose>=1.4.4 # BSD
mock>=2.0 # BSD
mox3>=0.7.0,!=0.19.0 # Apache-2.0
mox3 # Apache-2.0
nodeenv>=0.9.4 # BSD
nose # LGPL
nose-exclude # LGPL
nosehtmloutput>=0.0.3 # Apache-2.0
nosexcover # BSD
openstack.nose_plugin>=0.7 # Apache-2.0
openstackdocstheme>=1.16.0 # Apache-2.0
reno>=1.8.0,!=2.3.1 # Apache-2.0
selenium>=2.50.1 # Apache-2.0
sphinx>=1.6.2 # BSD
testtools>=1.4.0 # MIT
# This also needs xvfb library installed on your OS
xvfbwrapper>=0.1.3 #license: MIT

View File

@ -1,65 +0,0 @@
#!/usr/bin/env bash
# Many of neutron's repos suffer from the problem of depending on neutron,
# but it not existing on pypi.
# This wrapper for tox's package installer will use the existing package
# if it exists, else use zuul-cloner if that program exists, else grab it
# from neutron master via a hard-coded URL. That last case should only
# happen with devs running unit tests locally.
# From the tox.ini config page:
# install_command=ARGV
# default:
# pip install {opts} {packages}
ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner
BRANCH_NAME=master
GIT_BASE=${GIT_BASE:-https://git.openstack.org/}
install_project() {
local project=$1
local branch=${2:-$BRANCH_NAME}
local module_name=${project//-/_}
set +e
project_installed=$(echo "import $module_name" | python 2>/dev/null ; echo $?)
set -e
if [ $project_installed -eq 0 ]; then
echo "ALREADY INSTALLED" > /tmp/tox_install.txt
echo "$project already installed; using existing package"
elif [ -x "$ZUUL_CLONER" ]; then
echo "ZUUL CLONER" > /tmp/tox_install.txt
# Make this relative to current working directory so that
# git clean can remove it. We cannot remove the directory directly
# since it is referenced after $install_cmd -e
mkdir -p .tmp
PROJECT_DIR=$(/bin/mktemp -d -p $(pwd)/.tmp)
pushd $PROJECT_DIR
$ZUUL_CLONER --cache-dir \
/opt/git \
--branch $branch \
http://git.openstack.org \
openstack/$project
cd openstack/$project
$install_cmd -e .
popd
else
echo "PIP HARDCODE" > /tmp/tox_install.txt
local GIT_REPO="$GIT_BASE/openstack/$project"
SRC_DIR="$VIRTUAL_ENV/src/$project"
git clone --depth 1 --branch $branch $GIT_REPO $SRC_DIR
$install_cmd -U -e $SRC_DIR
fi
}
set -e
install_cmd="pip install -c$1"
shift
install_project horizon
$install_cmd -U $*
exit $?

17
tox.ini
View File

@ -5,16 +5,14 @@ skipsdist = True
[testenv]
usedevelop = True
setenv = VIRTUAL_ENV={envdir}
BRANCH_NAME=master
CLIENT_NAME=castellan-ui
NOSE_WITH_OPENSTACK=1
setenv = NOSE_WITH_OPENSTACK=1
NOSE_OPENSTACK_COLOR=1
NOSE_OPENSTACK_RED=0.05
NOSE_OPENSTACK_YELLOW=0.025
NOSE_OPENSTACK_SHOW_ELAPSED=1
install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
deps = -r{toxinidir}/requirements.txt
install_command = pip install -U {opts} {packages}
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = python manage.py test {posargs} --settings=castellan_ui.test.settings
@ -58,9 +56,14 @@ commands =
echo "nexecute `npm run test`"
[testenv:docs]
commands = python setup.py build_sphinx
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -d doc/build/doctrees -b html doc/source/ doc/build/html
[testenv:releasenotes]
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[flake8]