2019-08-03 18:39:58 +00:00
|
|
|
[tox]
|
2020-02-19 03:37:39 +00:00
|
|
|
envlist = py37, py36, lint, typing, security, docs
|
|
|
|
isolated_build = true
|
|
|
|
|
|
|
|
[testenv]
|
|
|
|
description = Run the unit tests (pytest)
|
|
|
|
deps =
|
|
|
|
pytest
|
|
|
|
pytest-cov
|
2020-02-19 04:02:43 +00:00
|
|
|
commands =
|
2020-02-24 01:24:39 +00:00
|
|
|
pytest --cov={envsitepackagesdir}/keyosk --cov-config .coveragerc tests/ --cov-report term-missing
|
2019-08-03 18:39:58 +00:00
|
|
|
|
|
|
|
[testenv:lint]
|
|
|
|
description = Check code formatting against black and pylint
|
|
|
|
deps =
|
2020-02-19 03:37:39 +00:00
|
|
|
pre-commit
|
|
|
|
pylint == 2.3.1
|
|
|
|
astroid == 2.2.5
|
2019-08-03 18:39:58 +00:00
|
|
|
commands =
|
2020-02-19 03:37:39 +00:00
|
|
|
pre-commit run --all-files
|
|
|
|
pylint keyosk
|
2019-08-03 18:39:58 +00:00
|
|
|
|
|
|
|
[testenv:typing]
|
|
|
|
description = Check type annotations with mypy
|
2020-02-19 04:02:43 +00:00
|
|
|
deps =
|
2020-02-19 03:37:39 +00:00
|
|
|
mypy
|
2020-02-19 04:02:43 +00:00
|
|
|
commands =
|
2020-02-19 03:37:39 +00:00
|
|
|
mypy keyosk --ignore-missing-imports --no-strict-optional
|
2019-08-03 18:39:58 +00:00
|
|
|
|
2020-02-19 03:37:39 +00:00
|
|
|
[testenv:security]
|
|
|
|
description = Check security vulnerabilities (bandit)
|
2020-02-19 04:02:43 +00:00
|
|
|
deps =
|
2020-02-19 03:37:39 +00:00
|
|
|
bandit
|
|
|
|
commands =
|
|
|
|
bandit --recursive keyosk
|
2019-08-03 18:39:58 +00:00
|
|
|
|
2020-02-19 03:37:39 +00:00
|
|
|
[testenv:docs]
|
|
|
|
description = Build documentation to check RST syntax (sphinx)
|
|
|
|
deps =
|
|
|
|
sphinx >= 1.7.5, < 2.0
|
|
|
|
sphinx-autodoc-typehints >= 1.3.0, < 2.0
|
|
|
|
whitelist_externals =
|
|
|
|
rm
|
|
|
|
commands =
|
|
|
|
sphinx-apidoc -o "./docs/" "keyosk"
|
|
|
|
rm "docs/modules.rst"
|
2020-02-23 04:17:27 +00:00
|
|
|
sphinx-build -M html "./docs/" "./docs/_build" -W
|
|
|
|
sphinx-build -M latex "./docs/" "./docs/_build" -W
|