63 lines
1.8 KiB
INI
63 lines
1.8 KiB
INI
[tox]
|
|
envlist = unit, pep8, coverage, bandit, docs
|
|
|
|
[testenv]
|
|
setenv=
|
|
PYTHONWARNING=all
|
|
basepython=python3.5
|
|
deps = -r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
[testenv:unit]
|
|
commands =
|
|
pytest \
|
|
{posargs}
|
|
|
|
[testenv:pep8]
|
|
commands = flake8 {posargs}
|
|
|
|
[testenv:bandit]
|
|
# NOTE(Bryan Strassner) ignoring airflow plugin which uses a subexec
|
|
commands =
|
|
bandit \
|
|
-r shipyard_airflow shipyard_client \
|
|
-x plugins/rest_api_plugin.py,shipyard_client/tests \
|
|
-n 5
|
|
|
|
[testenv:genconfig]
|
|
commands = oslo-config-generator --config-file=generator/config-generator.conf
|
|
|
|
[testenv:genpolicy]
|
|
commands = oslopolicy-sample-generator --config-file=generator/policy-generator.conf
|
|
|
|
[flake8]
|
|
filename = *.py
|
|
# NOTE(Bryan Strassner) ignoring F841 because of the airflow example pattern
|
|
# of naming variables even if they aren't used for DAGs and Operators.
|
|
# Doing so adds readability and context in this case.
|
|
# TODO(Bryan Strassner) The hacking rules defined as ignored below in many
|
|
# cases need to be un-ignored and fixed up. These are ignored because of
|
|
# the method in which test requirements bring in the hacking rules from
|
|
# other projects.
|
|
ignore = F841, H101, H201, H210, H238, H301, H304, H306, H401, H403, H404, H405
|
|
# NOTE(Bryan Strassner) excluding 3rd party and generated code that is brought into the
|
|
# codebase.
|
|
exclude = .venv,.git,.tox,build,dist,*plugins/rest_api_plugin.py,*lib/python*,*egg,alembic/env.py,docs
|
|
|
|
[testenv:docs]
|
|
whitelist_externals=rm
|
|
commands =
|
|
rm -rf docs/build
|
|
python setup.py build_sphinx {posargs}
|
|
|
|
[testenv:coverage]
|
|
commands =
|
|
pytest \
|
|
{posargs} \
|
|
--cov-branch \
|
|
--cov-report=term-missing:skip-covered \
|
|
--cov-config=.coveragerc \
|
|
--cov=shipyard_airflow \
|
|
--cov=shipyard_client \
|
|
--cov-report=html
|