tenks/tox.ini
Will Miller 740432dbd0 Add basic package structure
* Use PBR with minimal setup files to allow packaging
* Add tox configuration and enable PEP8/ansible-lint environments
2018-08-28 11:02:47 +00:00

47 lines
1.2 KiB
INI

[tox]
minversion = 2.0
envlist = py35,py27,pep8,alint
skipsdist = True
[testenv]
usedevelop = True
install_command = pip install {opts} {packages}
passenv =
HOME
whitelist_externals =
bash
rm
setenv =
VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=60
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/rocky}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
[testenv:pep8]
basepython = python3
commands =
flake8 {posargs}
[testenv:alint]
basepython = python3
# ansible-lint doesn't support custom modules, so add ours to the Ansible path.
setenv = ANSIBLE_LIBRARY = {toxinidir}/ansible/action_plugins/
# Exclude roles downloaded from Galaxy (in the form 'author.role') from
# linting.
commands = bash -c "ansible-lint \
$(find {toxinidir}/ansible -path '*.yml' \
-not -path '{toxinidir}/ansible/roles/*.*/*' -print)"
[flake8]
# E123, E125 skipped as they are invalid PEP-8.
show-source = True
ignore = E123,E125
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build