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 sys
from unittest import mock
# Add the project
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
# text edit cycles.
# 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.
source_suffix = '.rst'

View File

@ -2,8 +2,7 @@
# of appearance. Changing the order has an impact on the overall integration
# 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
oslotest>=3.2.0 # 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
reno>=2.5.0 # Apache-2.0
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 =
stestr run --slowest --color {posargs}
deps =
-c {env:TOX_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
-r {toxinidir}/requirements.txt
-r {toxinidir}/test-requirements.txt
-r {toxinidir}/molecule-requirements.txt
-r {toxinidir}/doc/requirements.txt
-r {toxinidir}/requirements.txt
-r {toxinidir}/test-requirements.txt
-r {toxinidir}/doc/requirements.txt
whitelist_externals = bash
[testenv:py27]
@ -54,10 +52,10 @@ commands_pre =
commands =
python2.7 -m unittest discover -s {envtmpdir}/validations_common/tests
deps =
-c {env:TOX_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/train/upper-constraints.txt}
-r {toxinidir}/requirements.txt
-r {toxinidir}/test-requirements.txt
ansible>=2
-c {env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/train}
-r {toxinidir}/requirements.txt
-r {toxinidir}/test-requirements.txt
ansible>=2
whitelist_externals =
bash
cp
@ -116,9 +114,9 @@ commands =
[testenv:linters]
deps =
-r {toxinidir}/requirements.txt
-r {toxinidir}/test-requirements.txt
-r {toxinidir}/molecule-requirements.txt
-c {env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r {toxinidir}/requirements.txt
-r {toxinidir}/test-requirements.txt
commands =
python '{toxinidir}/tools/validate-files.py' .
{[testenv:ansible-lint]commands}
@ -150,9 +148,8 @@ commands =
[testenv:docs]
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}/molecule-requirements.txt
commands=
sphinx-build -a -E -W -d doc/build/doctrees --keep-going -b html doc/source doc/build/html -T
doc8 doc