2019-08-03 18:39:58 +00:00
|
|
|
[tox]
|
2020-11-26 06:22:13 +00:00
|
|
|
envlist = py36, py37, py38, py39, static, static-tests, security, docs
|
2020-02-19 03:37:39 +00:00
|
|
|
isolated_build = true
|
2020-11-26 06:22:13 +00:00
|
|
|
skip_missing_interpreters = true
|
2020-02-19 03:37:39 +00:00
|
|
|
|
|
|
|
[testenv]
|
2020-11-26 06:22:13 +00:00
|
|
|
description = Run the tests
|
|
|
|
require_locked_deps = true
|
|
|
|
locked_deps =
|
2020-02-19 03:37:39 +00:00
|
|
|
pytest
|
|
|
|
pytest-cov
|
2020-11-26 06:22:13 +00:00
|
|
|
toml
|
2020-02-19 04:02:43 +00:00
|
|
|
commands =
|
2020-11-26 06:22:13 +00:00
|
|
|
pytest --cov={envsitepackagesdir}/keyosk --cov-config {toxinidir}/.coveragerc --cov-report term-missing {toxinidir}/tests/
|
2019-08-03 18:39:58 +00:00
|
|
|
|
2020-11-26 06:22:13 +00:00
|
|
|
[testenv:static]
|
|
|
|
description = Static formatting and quality enforcement
|
|
|
|
basepython = python3.8
|
|
|
|
platform = linux
|
|
|
|
ignore_errors = true
|
|
|
|
require_locked_deps = true
|
|
|
|
locked_deps =
|
2020-02-19 03:37:39 +00:00
|
|
|
pre-commit
|
2020-11-26 06:22:13 +00:00
|
|
|
black
|
|
|
|
blacken-docs
|
|
|
|
reorder-python-imports
|
|
|
|
pylint
|
|
|
|
mypy
|
2019-08-03 18:39:58 +00:00
|
|
|
commands =
|
2020-02-19 03:37:39 +00:00
|
|
|
pre-commit run --all-files
|
2020-11-26 06:22:13 +00:00
|
|
|
pylint --rcfile {toxinidir}/.pylintrc {toxinidir}/keyosk/
|
|
|
|
mypy --ignore-missing-imports --no-strict-optional {toxinidir}/keyosk/
|
2019-08-03 18:39:58 +00:00
|
|
|
|
2020-11-26 06:22:13 +00:00
|
|
|
[testenv:static-tests]
|
|
|
|
description = Static formatting and quality enforcement for the tests
|
|
|
|
basepython = python3.8
|
|
|
|
platform = linux
|
|
|
|
ignore_errors = true
|
|
|
|
require_locked_deps = true
|
|
|
|
locked_deps =
|
|
|
|
pylint
|
2020-02-19 03:37:39 +00:00
|
|
|
mypy
|
2020-02-19 04:02:43 +00:00
|
|
|
commands =
|
2020-11-26 06:22:13 +00:00
|
|
|
pylint --rcfile {toxinidir}/.pylintrc {toxinidir}/tests/
|
|
|
|
mypy --ignore-missing-imports --no-strict-optional {toxinidir}/tests/
|
2019-08-03 18:39:58 +00:00
|
|
|
|
2020-02-19 03:37:39 +00:00
|
|
|
[testenv:security]
|
2020-11-26 06:22:13 +00:00
|
|
|
description = Security checks
|
|
|
|
basepython = python3.8
|
|
|
|
platform = linux
|
|
|
|
ingore_errors = true
|
|
|
|
require_locked_deps = true
|
|
|
|
skip_install = true
|
|
|
|
locked_deps =
|
2020-02-19 03:37:39 +00:00
|
|
|
bandit
|
2020-11-26 06:22:13 +00:00
|
|
|
safety
|
|
|
|
allowlist_externals =
|
|
|
|
poetry
|
2020-02-19 03:37:39 +00:00
|
|
|
commands =
|
2020-11-26 06:22:13 +00:00
|
|
|
bandit --recursive --quiet {toxinidir}/keyosk/
|
|
|
|
bandit --recursive --quiet --skip B101 {toxinidir}/tests/
|
|
|
|
poetry export --format requirements.txt --output {envtmpdir}/requirements.txt --without-hashes --dev
|
|
|
|
safety check --bare --file {envtmpdir}/requirements.txt
|
2019-08-03 18:39:58 +00:00
|
|
|
|
2020-02-19 03:37:39 +00:00
|
|
|
[testenv:docs]
|
2020-11-26 06:22:13 +00:00
|
|
|
description = Build sphinx documentation
|
|
|
|
basepython = python3.8
|
|
|
|
platform = linux
|
|
|
|
require_locked_deps = true
|
|
|
|
locked_deps =
|
|
|
|
sphinx
|
|
|
|
sphinx-autodoc-typehints
|
|
|
|
allowlist_externals =
|
2020-02-19 03:37:39 +00:00
|
|
|
rm
|
|
|
|
commands =
|
2020-11-26 06:22:13 +00:00
|
|
|
sphinx-apidoc -o "{toxinidir}/docs/" "keyosk"
|
|
|
|
rm "{toxinidir}/docs/modules.rst"
|
|
|
|
sphinx-build -M html "{toxinidir}/docs/" "{toxinidir}/docs/_build"
|