Dependency reorganization

By adjusting the way we manage our tox dependencies
and increasing the number of mocked submodules during test runs and doc
building, we can minimize issues stemming from unexpected changes to constraints.

Patch also includes some style changes in the tox.ini file,
to harmonize the format of format definitions.

Closes-Bug: #1942508

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I73009d251f2c2a333903c02ab1c07c99247f73ab
This commit is contained in:
Jiri Podivin 2021-09-03 10:15:18 +02:00
parent 3f65cc05b3
commit c33d395811
3 changed files with 18 additions and 18 deletions

View File

@ -15,6 +15,7 @@
import os import os
import sys import sys
from unittest import mock
# Add the project # Add the project
sys.path.insert(0, os.path.abspath('../..')) sys.path.insert(0, os.path.abspath('../..'))
@ -50,7 +51,10 @@ openstackdocs_bug_tag = 'documentation'
# autodoc generation is a bit aggressive and a nuisance when doing heavy # autodoc generation is a bit aggressive and a nuisance when doing heavy
# text edit cycles. # text edit cycles.
# execute "export SPHINX_DEBUG=1" in your terminal to disable # execute "export SPHINX_DEBUG=1" in your terminal to disable
autodoc_mock_imports = ['validations_libs', 'oslotest'] autodoc_mock_imports = ['validations_libs', 'oslotest', 'ansible']
# Mocking autodoc deps manually
sys.modules['ansible.module_utils.basic'] = mock.Mock()
# The suffix of source filenames. # The suffix of source filenames.
source_suffix = '.rst' source_suffix = '.rst'

View File

@ -2,8 +2,7 @@
# of appearance. Changing the order has an impact on the overall integration # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
openstackdocstheme>=1.20.0 # Apache-2.0 ansible>=2.8,!=2.8.9,!=2.9.12,<2.10.0 # GPLv3+
coverage!=4.4,>=4.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0
stestr>=3.0.1 # Apache-2.0 stestr>=3.0.1 # Apache-2.0
@ -11,4 +10,4 @@ testscenarios>=0.4 # Apache-2.0/BSD
testtools>=2.2.0 # MIT testtools>=2.2.0 # MIT
reno>=2.5.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0
netaddr>=0.7.18 # BSD netaddr>=0.7.18 # BSD
pre-commit # MIT pre-commit>=2.3.0 # MIT

25
tox.ini
View File

@ -35,11 +35,9 @@ setenv =
commands = commands =
stestr run --slowest --color {posargs} stestr run --slowest --color {posargs}
deps = deps =
-c {env:TOX_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt} -r {toxinidir}/requirements.txt
-r {toxinidir}/requirements.txt -r {toxinidir}/test-requirements.txt
-r {toxinidir}/test-requirements.txt -r {toxinidir}/doc/requirements.txt
-r {toxinidir}/molecule-requirements.txt
-r {toxinidir}/doc/requirements.txt
whitelist_externals = bash whitelist_externals = bash
[testenv:py27] [testenv:py27]
@ -54,10 +52,10 @@ commands_pre =
commands = commands =
python2.7 -m unittest discover -s {envtmpdir}/validations_common/tests python2.7 -m unittest discover -s {envtmpdir}/validations_common/tests
deps = deps =
-c {env:TOX_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/train/upper-constraints.txt} -c {env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/train}
-r {toxinidir}/requirements.txt -r {toxinidir}/requirements.txt
-r {toxinidir}/test-requirements.txt -r {toxinidir}/test-requirements.txt
ansible>=2 ansible>=2
whitelist_externals = whitelist_externals =
bash bash
cp cp
@ -116,9 +114,9 @@ commands =
[testenv:linters] [testenv:linters]
deps = deps =
-r {toxinidir}/requirements.txt -c {env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r {toxinidir}/test-requirements.txt -r {toxinidir}/requirements.txt
-r {toxinidir}/molecule-requirements.txt -r {toxinidir}/test-requirements.txt
commands = commands =
python '{toxinidir}/tools/validate-files.py' . python '{toxinidir}/tools/validate-files.py' .
{[testenv:ansible-lint]commands} {[testenv:ansible-lint]commands}
@ -150,9 +148,8 @@ commands =
[testenv:docs] [testenv:docs]
deps = deps =
-c {env:TOX_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt} -c {env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r {toxinidir}/doc/requirements.txt -r {toxinidir}/doc/requirements.txt
-r {toxinidir}/molecule-requirements.txt
commands= commands=
sphinx-build -a -E -W -d doc/build/doctrees --keep-going -b html doc/source doc/build/html -T sphinx-build -a -E -W -d doc/build/doctrees --keep-going -b html doc/source doc/build/html -T
doc8 doc doc8 doc