Browse Source

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: I6a3543aa5bfd7e622be76de8b96c1a521d7a1627
Andreas Jaeger 1 year ago
parent
commit
45aa0b395f
3 changed files with 4 additions and 69 deletions
  1. 1
    0
      requirements.txt
  2. 0
    65
      tools/tox_install.sh
  3. 3
    4
      tox.ini

+ 1
- 0
requirements.txt View File

@@ -15,3 +15,4 @@ oslo.serialization!=2.19.1,>=2.18.0 # Apache-2.0
15 15
 oslo.utils>=3.33.0 # Apache-2.0
16 16
 
17 17
 python-neutronclient>=6.7.0 # Apache-2.0
18
+neutron>=12.0.0  # Apache-2.0

+ 0
- 65
tools/tox_install.sh View File

@@ -1,65 +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
-
16
-ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner
17
-BRANCH_NAME=master
18
-GIT_BASE=${GIT_BASE:-https://git.openstack.org/}
19
-
20
-install_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
-
57
-set -e
58
-
59
-install_cmd="pip install -c$1"
60
-shift
61
-
62
-install_project neutron
63
-
64
-$install_cmd -U $*
65
-exit $?

+ 3
- 4
tox.ini View File

@@ -5,13 +5,12 @@ skipsdist = True
5 5
 
6 6
 [testenv]
7 7
 usedevelop = True
8
-install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
8
+install_command = pip install {opts} {packages}
9 9
 setenv =
10 10
    VIRTUAL_ENV={envdir}
11
-   BRANCH_NAME=master
12
-   CLIENT_NAME=networking-hyperv
13 11
    PYTHONWARNINGS=default::DeprecationWarning
14
-deps = -r{toxinidir}/requirements.txt
12
+deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
13
+       -r{toxinidir}/requirements.txt
15 14
        -r{toxinidir}/test-requirements.txt
16 15
 
17 16
 commands = python setup.py testr --slowest --testr-args='{posargs}'

Loading…
Cancel
Save