84 lines
2.1 KiB
INI
84 lines
2.1 KiB
INI
# Operator charm helper: tox.ini
|
|
|
|
[tox]
|
|
envlist = pep8,py3
|
|
skipsdist = True
|
|
# NOTE: Avoid build/test env pollution by not enabling sitepackages.
|
|
sitepackages = False
|
|
# NOTE: Avoid false positives by not skipping missing interpreters.
|
|
skip_missing_interpreters = False
|
|
# NOTES:
|
|
# * We avoid the new dependency resolver by pinning pip < 20.3, see
|
|
# https://github.com/pypa/pip/issues/9187
|
|
# * Pinning dependencies requires tox >= 3.2.0, see
|
|
# https://tox.readthedocs.io/en/latest/config.html#conf-requires
|
|
# * It is also necessary to pin virtualenv as a newer virtualenv would still
|
|
# lead to fetching the latest pip in the func* tox targets, see
|
|
# https://stackoverflow.com/a/38133283
|
|
requires = pip < 20.3
|
|
virtualenv < 20.0
|
|
# NOTE: https://wiki.canonical.com/engineering/OpenStack/InstallLatestToxOnOsci
|
|
minversion = 3.2.0
|
|
|
|
[testenv]
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
PYTHONHASHSEED=0
|
|
CHARM_DIR={envdir}
|
|
install_command =
|
|
pip install {opts} {packages}
|
|
commands = stestr run --slowest {posargs}
|
|
whitelist_externals =
|
|
git
|
|
add-to-archive.py
|
|
fetch-libs.sh
|
|
bash
|
|
charmcraft
|
|
passenv = HOME TERM CS_* OS_* TEST_*
|
|
deps = -r{toxinidir}/test-requirements.txt
|
|
|
|
[testenv:fetch]
|
|
basepython = python3
|
|
deps =
|
|
commands =
|
|
./fetch-libs.sh
|
|
|
|
[testenv:py3.8]
|
|
basepython = python3.8
|
|
deps = -r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
[testenv:py3.9]
|
|
basepython = python3.9
|
|
deps = -r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
[testenv:py3]
|
|
basepython = python3
|
|
deps = -r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
[testenv:pep8]
|
|
basepython = python3
|
|
deps = -r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
commands = flake8 {posargs} src unit_tests tests advanced_sunbeam_openstack --exclude unit_tests/lib
|
|
|
|
[coverage:run]
|
|
branch = True
|
|
concurrency = multiprocessing
|
|
parallel = True
|
|
source =
|
|
.
|
|
omit =
|
|
.tox/*
|
|
*/charmhelpers/*
|
|
unit_tests/*
|
|
|
|
[testenv:venv]
|
|
basepython = python3
|
|
commands = {posargs}
|
|
|
|
[flake8]
|
|
# Ignore E902 because the unit_tests directory is missing in the built charm.
|
|
ignore = E402,E226,E902,ANN101,ANN003,W504
|