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: Id401732c06ecfc3c10cfe89a88bb6b60beb9a519
Andreas Jaeger 1 year ago
parent
commit
de8ae66407
3 changed files with 7 additions and 72 deletions
  1. 4
    0
      requirements.txt
  2. 0
    70
      tools/tox_install.sh
  3. 3
    2
      tox.ini

+ 4
- 0
requirements.txt View File

@@ -8,3 +8,7 @@ oslo.log>=3.36.0 # Apache-2.0
8 8
 oslo.utils>=3.33.0 # Apache-2.0
9 9
 paramiko>=2.0.0 # LGPLv2.1+
10 10
 pbr!=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:
14
+neutron>=12.0.0  # Apache-2.0

+ 0
- 70
tools/tox_install.sh View File

@@ -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
-
16
-ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner
17
-BRANCH_NAME=master
18
-neutron_installed=$(echo "import neutron" | python 2>/dev/null ; echo $?)
19
-NEUTRON_DIR=$HOME/neutron
20
-
21
-set -e
22
-set -x
23
-
24
-install_cmd="pip install -c$1"
25
-shift
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.
34
-if [ -d "$NEUTRON_DIR" ]; then
35
-    echo "FOUND Neutron code at $NEUTRON_DIR - using"
36
-    $install_cmd -U -e $NEUTRON_DIR
37
-elif [ $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"
43
-elif [ -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
59
-else
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
67
-fi
68
-
69
-$install_cmd -U $*
70
-exit $?

+ 3
- 2
tox.ini View File

@@ -5,11 +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 11
    PYTHONWARNINGS=default::DeprecationWarning
12
-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
13 14
        -r{toxinidir}/test-requirements.txt
14 15
 whitelist_externals = bash find
15 16
 commands = ostestr --regex '{posargs}'

Loading…
Cancel
Save