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: I12fe30e11c7462b6cada89b12946c0cd6fae1607
tags/0.8.0
Andreas Jaeger 1 year ago
parent
commit
d317ab8c30
2 changed files with 4 additions and 56 deletions
  1. 0
    53
      tools/tox_install.sh
  2. 4
    3
      tox.ini

+ 0
- 53
tools/tox_install.sh View File

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

+ 4
- 3
tox.ini View File

@@ -10,9 +10,10 @@ setenv = VIRTUAL_ENV={envdir}
10 10
          PYTHONHASHSEED=0
11 11
          PYTHONWARNINGS=default::DeprecationWarning
12 12
 usedevelop = True
13
-install_command =
14
-    {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
15
-deps = -r{toxinidir}/requirements.txt
13
+install_command = pip install {opts} {packages}
14
+deps =
15
+       -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
16
+       -r{toxinidir}/requirements.txt
16 17
        -r{toxinidir}/test-requirements.txt
17 18
 whitelist_externals = sh
18 19
                       find

Loading…
Cancel
Save