Browse Source

Clean up tox.ini

Change-Id: Ic766773ddcf51811867b0598fc890bee740d0d02
Witold Bedyk 1 year ago
parent
commit
ba64c4e922
2 changed files with 6 additions and 62 deletions
  1. 0
    57
      tools/tox_install.sh
  2. 6
    5
      tox.ini

+ 0
- 57
tools/tox_install.sh View File

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

+ 6
- 5
tox.ini View File

@@ -7,18 +7,19 @@ skipsdist = True
7 7
 setenv =
8 8
     VIRTUAL_ENV={envdir}
9 9
     OS_TEST_PATH=tests
10
-    CLIENT_NAME=monasca-notification
11 10
 passenv =
12 11
     *_proxy
13 12
     *_PROXY
14 13
 usedevelop = True
15
-install_command =
16
-    {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} --pre
14
+install_command = pip install {opts} {packages}
17 15
 whitelist_externals = bash
18 16
                       find
19 17
                       rm
20
-deps = -r{toxinidir}/test-requirements.txt
21
-       .[jira_plugin]
18
+deps =
19
+  -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
20
+  -r{toxinidir}/requirements.txt
21
+  -r{toxinidir}/test-requirements.txt
22
+   .[jira_plugin]
22 23
 commands =
23 24
  find . -type f -name "*.pyc" -delete
24 25
  rm -Rf .testrepository/times.dbm

Loading…
Cancel
Save