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: I85d256e9e66bbf940f5b645c4a887b1f2a3707de
This commit is contained in:
parent
0c82a02530
commit
3977c673e0
@ -1,30 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Client constraint file contains this client version pin that is in conflict
|
|
||||||
# with installing the client from source. We should remove the version pin in
|
|
||||||
# the constraints file before applying it for from-source installation.
|
|
||||||
|
|
||||||
CONSTRAINTS_FILE="$1"
|
|
||||||
shift 1
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# NOTE(tonyb): Place this in the tox enviroment's log dir so it will get
|
|
||||||
# published to logs.openstack.org for easy debugging.
|
|
||||||
localfile="$VIRTUAL_ENV/log/upper-constraints.txt"
|
|
||||||
|
|
||||||
if [[ "$CONSTRAINTS_FILE" != http* ]]; then
|
|
||||||
CONSTRAINTS_FILE="file://$CONSTRAINTS_FILE"
|
|
||||||
fi
|
|
||||||
# NOTE(tonyb): need to add curl to bindep.txt if the project supports bindep
|
|
||||||
curl "$CONSTRAINTS_FILE" --insecure --progress-bar --output "$localfile"
|
|
||||||
|
|
||||||
pip install -c"$localfile" openstack-requirements
|
|
||||||
|
|
||||||
# This is the main purpose of the script: Allow local installation of
|
|
||||||
# the current repo. It is listed in constraints file and thus any
|
|
||||||
# install will be constrained and we need to unconstrain it.
|
|
||||||
edit-constraints "$localfile" -- "$CLIENT_NAME"
|
|
||||||
|
|
||||||
pip install -c"$localfile" -U "$@"
|
|
||||||
exit $?
|
|
21
tox.ini
21
tox.ini
@ -5,13 +5,12 @@ skipsdist = True
|
|||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
|
install_command = pip install {opts} {packages}
|
||||||
setenv =
|
setenv =
|
||||||
VIRTUAL_ENV={envdir}
|
VIRTUAL_ENV={envdir}
|
||||||
BRANCH_NAME=master
|
deps =
|
||||||
CLIENT_NAME=bandit
|
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
|
||||||
VIRTUAL_ENV={envdir}
|
-r{toxinidir}/requirements.txt
|
||||||
deps = -r{toxinidir}/requirements.txt
|
|
||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
commands =
|
commands =
|
||||||
find bandit -type f -name "*.pyc" -delete
|
find bandit -type f -name "*.pyc" -delete
|
||||||
@ -24,16 +23,16 @@ passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
|||||||
commands = oslo_debug_helper -t tests {posargs}
|
commands = oslo_debug_helper -t tests {posargs}
|
||||||
|
|
||||||
[testenv:linters]
|
[testenv:linters]
|
||||||
usedevelop = False
|
|
||||||
deps = {[testenv:pep8]deps}
|
deps = {[testenv:pep8]deps}
|
||||||
|
usedevelop = False
|
||||||
commands = flake8 {posargs} bandit
|
commands = flake8 {posargs} bandit
|
||||||
flake8 {posargs} tests
|
flake8 {posargs} tests
|
||||||
bandit-baseline -r bandit -ll -ii
|
bandit-baseline -r bandit -ll -ii
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
usedevelop = False
|
|
||||||
deps = {[testenv]deps}
|
deps = {[testenv]deps}
|
||||||
.
|
.
|
||||||
|
usedevelop = False
|
||||||
commands = flake8 {posargs} bandit
|
commands = flake8 {posargs} bandit
|
||||||
flake8 {posargs} tests
|
flake8 {posargs} tests
|
||||||
{[testenv:pylint]commands}
|
{[testenv:pylint]commands}
|
||||||
@ -43,14 +42,12 @@ commands = flake8 {posargs} bandit
|
|||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
|
||||||
[testenv:codesec]
|
[testenv:codesec]
|
||||||
usedevelop = False
|
|
||||||
deps = {[testenv]deps}
|
deps = {[testenv]deps}
|
||||||
.
|
.
|
||||||
|
usedevelop = False
|
||||||
commands = bandit-baseline -r bandit -ll -ii
|
commands = bandit-baseline -r bandit -ll -ii
|
||||||
|
|
||||||
[testenv:cover]
|
[testenv:cover]
|
||||||
deps = -r{toxinidir}/requirements.txt
|
|
||||||
-r{toxinidir}/test-requirements.txt
|
|
||||||
setenv =
|
setenv =
|
||||||
{[testenv]setenv}
|
{[testenv]setenv}
|
||||||
PYTHON=coverage run --source bandit --parallel-mode
|
PYTHON=coverage run --source bandit --parallel-mode
|
||||||
@ -60,7 +57,9 @@ commands =
|
|||||||
coverage report
|
coverage report
|
||||||
|
|
||||||
[testenv:openstack_coverage]
|
[testenv:openstack_coverage]
|
||||||
deps = PyYAML>=3.1.0
|
deps =
|
||||||
|
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
|
||||||
|
PyYAML>=3.1.0
|
||||||
requests>=2.7.0
|
requests>=2.7.0
|
||||||
commands = python tools/openstack_coverage.py
|
commands = python tools/openstack_coverage.py
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user