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
This commit is contained in:
Dmitry Tantsur 2020-12-14 14:18:46 +01:00
parent 8b8266b910
commit 8d52a7789a
3 changed files with 23 additions and 12 deletions

6
doc/requirements.txt Normal file
View File

@ -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

View File

@ -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

19
tox.ini
View File

@ -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