From 4f1fd662afecec160ff7183772d015836c58ef7b Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Sun, 11 Nov 2018 15:56:20 +0000 Subject: [PATCH] Adops recipe to avoid outdated tox dependecies Applies official workaround indicated by tox core maintainers for avoiding https://github.com/tox-dev/tox/issues/149 which allowed tox to run with without updating dependencies declared in external files. Depends-On: https://review.openstack.org/#/c/617145/ Change-Id: I358b80d183a2667a04cfaac2054e101a9d7454ed --- tox.ini | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tox.ini b/tox.ini index 8f2a9d80b..1af57b67a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,12 @@ [tox] -minversion = 2.2 +minversion = 3.2.1 envlist = linters, docs, py34, py35, py36, py27, cover skip_missing_interpreters = true -# custom vars (no meaning to tox) -install_test_deps = pip install -q -r test-requirements.txt + +# plugin to workaround https://github.com/tox-dev/tox/issues/149 +# where tox fails to update already existing virtualenvs +tox_pip_extensions_ext_venv_update = true +requires = tox-pip-extensions [testenv] setenv = @@ -12,12 +15,13 @@ setenv = SUBUNIT_FORMATTER=tee testr_subunit_log VIRTUAL_ENV={envdir} usedevelop = True -install_command = pip install {opts} {packages} # cleanup is needed mostly for dev environmnts and assures that if dev # is switching branch, no lefovers will impact execution. # No git commands here because test should run even from a source archive. +deps = + -rrequirements.txt + -rtest-requirements.txt commands = - {[tox]install_test_deps} - find . -type f -name "*.pyc" -delete - find . -type d -name "__pycache__" -delete # test that we can call jjb using both variants with same results @@ -29,7 +33,6 @@ whitelist_externals = [testenv:tips] # tests what happens with unreleased version of dependencies, like python-jenkins -install_command = pip install -U {opts} {packages} commands = bash -c "if [ -d {toxinidir}/../python-jenkins ]; then \ pip install -q -U -e 'git+file://{toxinidir}/../python-jenkins#egg=python-jenkins' ; else \ @@ -41,7 +44,6 @@ setenv = {[testenv]setenv} PYTHON=coverage run --source jenkins_jobs --parallel-mode commands = - {[tox]install_test_deps} stestr run {posargs} coverage combine coverage html -d cover @@ -50,7 +52,6 @@ commands = [testenv:linters] basepython = python3 commands = - {[tox]install_test_deps} python -m pre_commit run --all # points to linters, kept only for developer convenience @@ -73,7 +74,6 @@ commands = jenkins-jobs test -o .test/new/out/ .test/new/config/ [testenv:docs] commands = - {[tox]install_test_deps} python setup.py build_sphinx {posargs} [testenv:docs-linkcheck]