Browse Source

Avoid tox_install.sh for constraints support

We do not need tox_install.sh, pip can handle constraints itself
and install the project correctly. Thus update tox.ini and remove
the now obsolete tools/tox_install.sh file.

This follows https://review.openstack.org/#/c/508061 to remove
tools/tox_install.sh.

Change-Id: Id9b20c3ddb141f5237b2a072d89b3ec0786a1dbd
Andreas Jaeger 1 year ago
parent
commit
d7b253edd7
2 changed files with 2 additions and 56 deletions
  1. 0
    55
      tools/tox_install.sh
  2. 2
    1
      tox.ini

+ 0
- 55
tools/tox_install.sh View File

@@ -1,55 +0,0 @@
1
-#!/usr/bin/env bash
2
-
3
-# Client constraint file contains this client version pin that is in conflict
4
-# with installing the client from source. We should replace the version pin in
5
-# the constraints file before applying it for from-source installation.
6
-
7
-ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner
8
-BRANCH_NAME=master
9
-NAME=murano-pkg-check
10
-requirements_installed=$(echo "import openstack_requirements" | python 2>/dev/null ; echo $?)
11
-
12
-set -e
13
-
14
-CONSTRAINTS_FILE=$1
15
-shift
16
-
17
-install_cmd="pip install"
18
-mydir=$(mktemp -dt "$NAME-tox_install-XXXXXXX")
19
-trap "rm -rf $mydir" EXIT
20
-localfile=$mydir/upper-constraints.txt
21
-if [[ $CONSTRAINTS_FILE != http* ]]; then
22
-    CONSTRAINTS_FILE=file://$CONSTRAINTS_FILE
23
-fi
24
-curl $CONSTRAINTS_FILE -k -o $localfile
25
-install_cmd="$install_cmd -c$localfile"
26
-
27
-if [ $requirements_installed -eq 0 ]; then
28
-    echo "ALREADY INSTALLED" > /tmp/tox_install.txt
29
-    echo "Requirements already installed; using existing package"
30
-elif [ -x "$ZUUL_CLONER" ]; then
31
-    echo "ZUUL CLONER" > /tmp/tox_install.txt
32
-    pushd $mydir
33
-    $ZUUL_CLONER --cache-dir \
34
-        /opt/git \
35
-        --branch $BRANCH_NAME \
36
-        git://git.openstack.org \
37
-        openstack/requirements
38
-    cd openstack/requirements
39
-    $install_cmd -e .
40
-    popd
41
-else
42
-    echo "PIP HARDCODE" > /tmp/tox_install.txt
43
-    if [ -z "$REQUIREMENTS_PIP_LOCATION" ]; then
44
-        REQUIREMENTS_PIP_LOCATION="git+https://git.openstack.org/openstack/requirements@$BRANCH_NAME#egg=requirements"
45
-    fi
46
-    $install_cmd -U -e ${REQUIREMENTS_PIP_LOCATION}
47
-fi
48
-
49
-# This is the main purpose of the script: Allow local installation of
50
-# the current repo. It is listed in constraints file and thus any
51
-# install will be constrained and we need to unconstrain it.
52
-edit-constraints $localfile -- $NAME "-e file://$PWD#egg=$NAME"
53
-
54
-$install_cmd -U $*
55
-exit $?

+ 2
- 1
tox.ini View File

@@ -7,10 +7,11 @@ skipsdist = True
7 7
 usedevelop = True
8 8
 whitelist_externals = bash
9 9
                       find
10
-install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
10
+install_command = pip install {opts} {packages}
11 11
 setenv =
12 12
    VIRTUAL_ENV={envdir}
13 13
 deps =
14
+    -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
14 15
     -r{toxinidir}/requirements.txt
15 16
     -r{toxinidir}/test-requirements.txt
16 17
 commands = python setup.py test --slowest --testr-args='{posargs}'

Loading…
Cancel
Save