Browse Source

Merge "Add Constraints support"

Jenkins 2 years ago
parent
commit
dcc453a946
2 changed files with 34 additions and 3 deletions
  1. 30
    0
      tools/tox_install.sh
  2. 4
    3
      tox.ini

+ 30
- 0
tools/tox_install.sh View File

@@ -0,0 +1,30 @@
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 remove the version pin in
5
+# the constraints file before applying it for from-source installation.
6
+
7
+CONSTRAINTS_FILE="$1"
8
+shift 1
9
+
10
+set -e
11
+
12
+# NOTE(tonyb): Place this in the tox enviroment's log dir so it will get
13
+# published to logs.openstack.org for easy debugging.
14
+localfile="$VIRTUAL_ENV/log/upper-constraints.txt"
15
+
16
+if [[ "$CONSTRAINTS_FILE" != http* ]]; then
17
+    CONSTRAINTS_FILE="file://$CONSTRAINTS_FILE"
18
+fi
19
+# NOTE(tonyb): need to add curl to bindep.txt if the project supports bindep
20
+curl "$CONSTRAINTS_FILE" --insecure --progress-bar --output "$localfile"
21
+
22
+pip install -c"$localfile" openstack-requirements
23
+
24
+# This is the main purpose of the script: Allow local installation of
25
+# the current repo. It is listed in constraints file and thus any
26
+# install will be constrained and we need to unconstrain it.
27
+edit-constraints "$localfile" -- "$CLIENT_NAME"
28
+
29
+pip install -c"$localfile" -U "$@"
30
+exit $?

+ 4
- 3
tox.ini View File

@@ -1,12 +1,14 @@
1 1
 [tox]
2
-minversion = 1.6
2
+minversion = 2.0
3 3
 skipsdist = True
4 4
 envlist = py27,pep8
5 5
 
6 6
 [testenv]
7 7
 usedevelop = True
8
-install_command = pip install -U {opts} {packages}
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}
9 9
 setenv = VIRTUAL_ENV={envdir}
10
+         BRANCH_NAME=master
11
+         CLIENT_NAME=os-apply-config
10 12
 deps = -r{toxinidir}/requirements.txt
11 13
        -r{toxinidir}/test-requirements.txt
12 14
 commands =
@@ -19,7 +21,6 @@ sitepackages = True
19 21
 commands = flake8
20 22
 
21 23
 [testenv:cover]
22
-setenv = VIRTUAL_ENV={envdir}
23 24
 commands =
24 25
   python setup.py test --coverage --coverage-package-name=os_apply_config
25 26
 

Loading…
Cancel
Save