tripleo-quickstart-extras/tox.ini
Chandan Kumar (raukadah) de60904bca Use pip-compile to generate dependency list
When there is an unpinned dependency in requirements file, then
pip uses pip-resolver to pull multiple version of a package
which takes time and it openstack-tox-molecule job gots
timeout.

In order to avoid that, let'use pip-compile to generate the
dependencies and use the same in the testenv

The constraints.txt file needs to be generated only
when there is a breakage in dependency.

Due to use of PIP_CONSTRAINT in passenv, the latest
version of package mentioned in upper constriants will
be installed automatically.

Closes-Bug: #1942704

Signed-off-by: Chandan Kumar (raukadah) <chkumar@redhat.com>
Change-Id: I64d0b1c17c224856143966162000a75e252a08af
2021-09-09 13:11:29 +05:30

67 lines
1.8 KiB
INI

[tox]
minversion = 3.9.0
envlist = linters
skipdist = True
requires =
tox-bindep>=0.2.1
[testenv]
usedevelop = True
setenv =
ANSIBLE_FORCE_COLOR=1
passenv =
ANSIBLE_*
CURL_CA_BUNDLE
DOCKER_*
MOLECULE_*
REQUESTS_CA_BUNDLE
SSH_AUTH_SOCK
SSL_CERT_FILE
TERM
PIP_CONSTRAINT={env:PIP_CONSTRAINT:constraints.txt}
deps = -r{toxinidir}/constraints.txt
whitelist_externals = bash
[testenv:bindep]
basepython = python3
# Do not install any requirements. We want this to be fast and work even if
# system dependencies are missing, since it's used to tell you what system
# dependencies are missing! This also means that bindep must be installed
# separately, outside of the requirements files.
deps = bindep
commands = bindep test
[testenv:releasenotes]
deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
basepython = python3
whitelist_externals = bash
commands = bash -c ci-scripts/releasenotes_tox.sh
[testenv:linters]
basepython = python3
deps =
jinja2
pre-commit
commands =
python -m pre_commit run -a
# TODO(ssbarnea) make is a real pre-commit hook so we can reuse it
python ci-scripts/validate_jinja2.py
[testenv:venv]
basepython = python3
commands = {posargs}
[testenv:molecule]
commands =
python -m pytest --color=yes --html={envlogdir}/reports.html --self-contained-html -rA --molecule-unavailable-driver=fail {tty:-s} {posargs:-k 'molecule and docker'}
[testenv:deps]
description = pip-compile the dependencies
basepython = python3
deps =
pip-tools>=5.4.0
skip_install = true
commands =
pip-compile -o constraints.txt test-requirements.txt molecule-requirements.txt --pip-args "-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}"