Codebase list python-castellan / c673571
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: I11127d4cc7263ced57309952b71df1c7813f57d6 Andreas Jaeger authored 6 years ago Andreas Jaeger committed 6 years ago
2 changed file(s) with 4 addition(s) and 59 deletion(s). Raw diff Collapse all Expand all
+0
-53
tools/tox_install.sh less more
0 #!/usr/bin/env bash
1
2 # [liujiong] This file is refer to tox_install.sh in neutron-lib.
3 # Library constraint file contains this library version pin that is in conflict
4 # with installing the library 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 LIB_NAME=castellan
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 "$LIB_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 "Requirements already installed; using existing package"
29 elif [ -x "$ZUUL_CLONER" ]; then
30 pushd $mydir
31 $ZUUL_CLONER --cache-dir \
32 /opt/git \
33 --branch $BRANCH_NAME \
34 git://git.openstack.org \
35 openstack/requirements
36 cd openstack/requirements
37 $install_cmd -e .
38 popd
39 else
40 if [ -z "$REQUIREMENTS_PIP_LOCATION" ]; then
41 REQUIREMENTS_PIP_LOCATION="git+https://git.openstack.org/openstack/requirements@$BRANCH_NAME#egg=requirements"
42 fi
43 $install_cmd -U -e ${REQUIREMENTS_PIP_LOCATION}
44 fi
45
46 # This is the main purpose of the script: Allow local installation of
47 # the current repo. It is listed in constraints file and thus any
48 # install will be constrained and we need to unconstrain it.
49 edit-constraints $localfile -- $LIB_NAME "-e file://$PWD#egg=$LIB_NAME"
50
51 $install_cmd -U $*
52 exit $?
44
55 [testenv]
66 usedevelop = True
7 install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
7 install_command = pip install {opts} {packages}
88 setenv =
99 VIRTUAL_ENV={envdir}
1010 OS_TEST_PATH=./castellan/tests/unit
11 deps = -r{toxinidir}/requirements.txt
11 deps =
12 -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
13 -r{toxinidir}/requirements.txt
1214 -r{toxinidir}/test-requirements.txt
1315 commands = python setup.py testr --slowest --testr-args='{posargs}'
1416
5254 setenv =
5355 VIRTUAL_ENV={envdir}
5456 OS_TEST_PATH=./castellan/tests/functional
55 deps = -r{toxinidir}/requirements.txt
56 -r{toxinidir}/test-requirements.txt
5757 commands = python setup.py testr --slowest --testr-args='{posargs}'
5858
5959 [testenv:functional-vault]
6363 setenv =
6464 VIRTUAL_ENV={envdir}
6565 OS_TEST_PATH=./castellan/tests/functional
66 deps = -r{toxinidir}/requirements.txt
67 -r{toxinidir}/test-requirements.txt
6866 commands =
6967 {toxinidir}/tools/setup-vault-env.sh pifpaf -e VAULT_TEST run vault -- python setup.py testr --slowest --testr-args='{posargs}'
7068