From 8d52a7789ac9eba2b5f8fa34e10922cd917f8e36 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Mon, 14 Dec 2020 14:18:46 +0100 Subject: [PATCH] Avoid a full install in tox environments that do not need it Usage of usedevelop=True results in all requirements.txt dependencies always installed (without constraints) even when requirements.txt is not explicitly added. Override usedevelop for these environments. Add requirements.txt to the 'docs' environment since it imports the whole ironic in the process. Create a separate doc/requirements.txt. Change-Id: I352f21772ccd68b35806f46851f254edb7c24c60 --- doc/requirements.txt | 6 ++++++ test-requirements.txt | 10 ---------- tox.ini | 19 +++++++++++++++++-- 3 files changed, 23 insertions(+), 12 deletions(-) create mode 100644 doc/requirements.txt diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 000000000..60abdfd59 --- /dev/null +++ b/doc/requirements.txt @@ -0,0 +1,6 @@ +os-api-ref>=1.4.0 # Apache-2.0 +reno>=3.1.0 # Apache-2.0 +sphinx>=2.0.0,!=2.1.0 # BSD +sphinxcontrib-svg2pdfconverter>=0.1.0 # BSD +sphinxcontrib-apidoc>=0.2.0 # BSD +openstackdocstheme>=2.2.0 # Apache-2.0 diff --git a/test-requirements.txt b/test-requirements.txt index 802230747..99c5fd381 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,17 +4,7 @@ bandit!=1.6.0,>=1.1.0,<2.0.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 -os-api-ref>=1.4.0 # Apache-2.0 pymemcache!=1.3.0,>=1.2.9 # Apache-2.0 stestr>=1.0.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD oslotest>=3.2.0 # Apache-2.0 - -# DOC test requirements -doc8>=0.6.0 # Apache-2.0 -reno>=3.1.0 # Apache-2.0 -sphinx>=2.0.0,!=2.1.0 # BSD -sphinxcontrib-svg2pdfconverter>=0.1.0 # BSD -sphinxcontrib-apidoc>=0.2.0 # BSD -openstackdocstheme>=2.2.0 # Apache-2.0 - diff --git a/tox.ini b/tox.ini index 5a8006885..85cfc44f2 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,6 @@ [tox] minversion = 3.2.1 +skipsdist = True envlist = py3,pep8,functional-py38 ignore_basepython_conflict=true @@ -23,11 +24,19 @@ passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY commands = {posargs} [testenv:api-ref] +usedevelop = False +deps = + -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} + -r{toxinidir}/doc/requirements.txt whitelist_externals = bash commands = sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html [testenv:releasenotes] +usedevelop = False +deps = + -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} + -r{toxinidir}/doc/requirements.txt commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [testenv:cover] @@ -42,6 +51,7 @@ commands = coverage html -d ./cover --omit='*test*' [testenv:pep8] +usedevelop = False deps = flake8-import-order>=0.17.1 # LGPLv3 hacking>=3.1.0,<4.0.0 # Apache-2.0 @@ -86,9 +96,11 @@ import_exceptions = ironic_inspector.common.i18n [testenv:docs] setenv = PYTHONHASHSEED=0 sitepackages = False +# NOTE(dtantsur): documentation building process requires importing ironic deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} - -r{toxinidir}/test-requirements.txt + -r{toxinidir}/requirements.txt + -r{toxinidir}/doc/requirements.txt commands = sphinx-build -W -b html doc/source doc/build/html @@ -106,7 +118,10 @@ deps = -r{toxinidir}/requirements.txt [testenv:bandit] -deps = -r{toxinidir}/test-requirements.txt +usedevelop = False +deps = + -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} + -r{toxinidir}/test-requirements.txt commands = bandit -r ironic_inspector -x test -n 5 -ll -c tools/bandit.yml # This environment can be used to quickly validate that all needed system