Browse Source

Remove tox_install

The tox_install script is not longer required, this patch removes it.

Change-Id: Ia291d99245160c2ba864ed63f99ee341523b7385
Michael Johnson 1 year ago
parent
commit
4fdadf64bb
3 changed files with 4 additions and 107 deletions
  1. 1
    0
      requirements.txt
  2. 0
    105
      tools/tox_install.sh
  3. 3
    2
      tox.ini

+ 1
- 0
requirements.txt View File

@@ -2,6 +2,7 @@
2 2
 # of appearance. Changing the order has an impact on the overall integration
3 3
 # process, which may cause wedges in the gate later.
4 4
 
5
+horizon>=13.0.0  # Apache-2.0
5 6
 oslo.log>=3.36.0 # Apache-2.0
6 7
 pbr!=2.1.0,>=2.0.0 # Apache-2.0
7 8
 Babel!=2.4.0,>=2.3.4 # BSD

+ 0
- 105
tools/tox_install.sh View File

@@ -1,105 +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
-
16
-ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner
17
-BRANCH_NAME=master
18
-
19
-install_project() {
20
-    local project=$1
21
-    local branch=${2:-$BRANCH_NAME}
22
-    local PROJECT_DIR=$HOME/$project
23
-    local ZUULV3_PROJECT_DIR=$HOME/src/git.openstack.org/openstack/$project
24
-
25
-    set +e
26
-    project_installed=$(echo "import $project" | python 2>/dev/null ; echo $?)
27
-    set -e
28
-
29
-    # The devstack based functional tests have project checked out in
30
-    # $PROJECT_DIR on the test systems - with the change to test in it.
31
-    # Use this directory if it exists, so that this script installs the
32
-    # project version to test here.
33
-    # Note that the functional tests use sudo to run tox and thus
34
-    # variables used for zuul-cloner to check out the correct version are
35
-    # lost.
36
-    if [ -d "$ZUULV3_PROJECT_DIR" ]; then
37
-        echo "FOUND $project code at $ZUULV3_PROJECT_DIR - using"
38
-        $install_cmd -U $ZUULV3_PROJECT_DIR
39
-    elif [ -d "$PROJECT_DIR" ]; then
40
-        echo "FOUND $project code at $PROJECT_DIR - using"
41
-        $install_cmd -U $PROJECT_DIR
42
-    elif [ $project_installed -eq 0 ]; then
43
-        echo "ALREADY INSTALLED" > /tmp/tox_install.txt
44
-        location=$(python -c "import $project; print($project.__file__)")
45
-        echo "ALREADY INSTALLED at $location"
46
-
47
-        echo "$project already installed; using existing package"
48
-    elif [ -x "$ZUUL_CLONER" ]; then
49
-        echo "ZUUL CLONER" > /tmp/tox_install.txt
50
-        # Make this relative to current working directory so that
51
-        # git clean can remove it. We cannot remove the directory directly
52
-        # since it is referenced after $install_cmd
53
-        mkdir -p .tmp
54
-        PROJECT_DIR=$(/bin/mktemp -d -p $(pwd)/.tmp)
55
-        pushd $PROJECT_DIR
56
-        $ZUUL_CLONER --cache-dir \
57
-            /opt/git \
58
-            --branch $branch \
59
-            http://git.openstack.org \
60
-            openstack/$project
61
-        cd openstack/$project
62
-        $install_cmd .
63
-        popd
64
-    else
65
-        echo "PIP HARDCODE" > /tmp/tox_install.txt
66
-        if [ -z "$PIP_LOCATION" ]; then
67
-            PIP_LOCATION="git+https://git.openstack.org/openstack/$project@$branch#egg=$project"
68
-        fi
69
-        $install_cmd -U ${PIP_LOCATION}
70
-    fi
71
-}
72
-
73
-# Client constraint file contains this client version pin that is in conflict
74
-# with installing the client from source. We should remove the version pin in
75
-# the constraints file before applying it for from-source installation.
76
-
77
-CONSTRAINTS_FILE="$1"
78
-shift 1
79
-
80
-set -e
81
-set -x
82
-
83
-# NOTE(tonyb): Place this in the tox enviroment's log dir so it will get
84
-# published to logs.openstack.org for easy debugging.
85
-localfile="$VIRTUAL_ENV/log/upper-constraints.txt"
86
-
87
-if [[ "$CONSTRAINTS_FILE" != http* ]]; then
88
-    CONSTRAINTS_FILE="file://$CONSTRAINTS_FILE"
89
-fi
90
-# NOTE(tonyb): need to add curl to bindep.txt if the project supports bindep
91
-curl "$CONSTRAINTS_FILE" --insecure --progress-bar --output "$localfile"
92
-
93
-pip install -c"$localfile" openstack-requirements
94
-
95
-# This is the main purpose of the script: Allow local installation of
96
-# the current repo. It is listed in constraints file and thus any
97
-# install will be constrained and we need to unconstrain it.
98
-edit-constraints "$localfile" -- "$CLIENT_NAME"
99
-
100
-install_cmd="pip install -c$localfile"
101
-
102
-install_project horizon
103
-
104
-$install_cmd -U $*
105
-exit $?

+ 3
- 2
tox.ini View File

@@ -5,7 +5,7 @@ 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
    NOSE_WITH_OPENSTACK=1
@@ -14,7 +14,8 @@ setenv =
14 14
    NOSE_OPENSTACK_YELLOW=0.025
15 15
    NOSE_OPENSTACK_SHOW_ELAPSED=1
16 16
    CLIENT_NAME=neutron-lbaas-dashboard
17
-deps = -r{toxinidir}/requirements.txt
17
+deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
18
+       -r{toxinidir}/requirements.txt
18 19
        -r{toxinidir}/test-requirements.txt
19 20
 whitelist_externals = npm
20 21
                       bash

Loading…
Cancel
Save