charm-layer-openstack/tox.ini

76 lines
2.4 KiB
INI

[tox]
skipsdist = True
envlist = pep8
toxworkdir = /tmp/tox
# NOTE(beisner): Avoid build/test env pollution by not enabling sitepackages.
sitepackages = False
# NOTE(beisner): 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
setuptools<50.0.0
# NOTE: https://wiki.canonical.com/engineering/OpenStack/InstallLatestToxOnOsci
minversion = 3.18.0
[testenv]
basepython = python3
setenv = VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0
TERM=linux
JUJU_REPOSITORY={envdir}/tmp/build
passenv = http_proxy https_proxy
install_command =
{toxinidir}/pip.sh install {opts} {packages}
deps =
-r{toxinidir}/requirements.txt
whitelist_externals = /bin/true /bin/echo /bin/mkdir /bin/ln
[testenv:build]
# ``charm build`` refuses to output to a subdirectory to the source tree
# The gate check will look for and validate the built artifacts in the source
# tree.
# Build the artifats under /tmp and link back to source directory to alleviate.
commands =
/bin/echo 'WARNING: *build* target is for testing only.'
/bin/mkdir -p {envdir}/tmp
/bin/mkdir -p {envdir}/tmp/build
charm-build --log-level DEBUG -o {envdir}/tmp/build/builds .
/bin/ln -s {envdir}/tmp/build/builds/ {envdir}/tmp/build/trusty
/bin/ln -s {envdir}/tmp/build {toxinidir}/build
[testenv:venv]
commands = {posargs}
[testenv:py34]
basepython = python3.4
deps = -r{toxinidir}/test-requirements.txt
# TODO: Need to write unit tests then remove the following command.
commands = /bin/true
[testenv:py35]
basepython = python3.5
deps = -r{toxinidir}/test-requirements.txt
# TODO: Need to write unit tests then remove the following command.
commands = /bin/true
[testenv:py36]
basepython = python3.6
deps = -r{toxinidir}/test-requirements.txt
# TODO: Need to write unit tests then remove the following command.
commands = /bin/true
[testenv:pep8]
basepython = python3
commands = flake8 --ignore=E402,W503,W504 actions/ reactive/