Skip to content

Commit

Permalink
Avoid a full install in tox environments that do not need it
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dtantsur committed Dec 14, 2020
1 parent 8b8266b commit 8d52a77
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
6 changes: 6 additions & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
10 changes: 0 additions & 10 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 17 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[tox]
minversion = 3.2.1
skipsdist = True
envlist = py3,pep8,functional-py38
ignore_basepython_conflict=true

Expand All @@ -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]
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 8d52a77

Please sign in to comment.