2020-09-16 07:41:53 +00:00
|
|
|
[tox]
|
2020-12-22 02:52:23 +00:00
|
|
|
envlist =
|
|
|
|
py{37,38,39}
|
|
|
|
static
|
|
|
|
static-tests
|
|
|
|
security
|
2020-09-16 07:41:53 +00:00
|
|
|
isolated_build = true
|
|
|
|
skip_missing_interpreters = true
|
|
|
|
|
|
|
|
[testenv]
|
|
|
|
description = Run the tests
|
2020-12-22 02:52:23 +00:00
|
|
|
require_locked_deps = true
|
2021-05-08 02:02:43 +00:00
|
|
|
require_poetry = true
|
2020-12-22 02:52:23 +00:00
|
|
|
locked_deps =
|
2021-05-08 02:39:16 +00:00
|
|
|
openapi-spec-validator
|
2020-12-22 02:52:23 +00:00
|
|
|
pytest
|
|
|
|
pytest-cov
|
2021-05-08 02:39:16 +00:00
|
|
|
ruamel.yaml
|
2020-12-22 02:52:23 +00:00
|
|
|
toml
|
2020-09-16 07:41:53 +00:00
|
|
|
commands =
|
2021-10-28 23:03:09 +00:00
|
|
|
pytest --cov={envsitepackagesdir}/fresnel_lens --cov-config {toxinidir}/.coveragerc --cov-report term-missing {toxinidir}/tests/
|
2020-09-16 07:41:53 +00:00
|
|
|
|
|
|
|
[testenv:static]
|
2020-12-22 02:52:23 +00:00
|
|
|
description = Static formatting and quality enforcement
|
|
|
|
basepython = python3.8
|
2020-09-16 07:41:53 +00:00
|
|
|
ignore_errors = true
|
2020-12-22 02:52:23 +00:00
|
|
|
skip_install = true
|
|
|
|
locked_deps =
|
|
|
|
black
|
|
|
|
blacken-docs
|
2021-05-02 22:12:04 +00:00
|
|
|
mdformat
|
|
|
|
mdformat-gfm
|
2020-12-22 02:52:23 +00:00
|
|
|
mypy
|
|
|
|
reorder-python-imports
|
|
|
|
pre-commit
|
|
|
|
pre-commit-hooks
|
|
|
|
pylint
|
2020-09-16 07:41:53 +00:00
|
|
|
commands =
|
|
|
|
pre-commit run --all-files
|
2021-10-28 23:03:09 +00:00
|
|
|
pylint --rcfile {toxinidir}/.pylintrc {toxinidir}/fresnel_lens/
|
|
|
|
mypy --ignore-missing-imports --no-strict-optional {toxinidir}/fresnel_lens/
|
2020-09-16 07:41:53 +00:00
|
|
|
|
|
|
|
[testenv:static-tests]
|
2020-12-22 02:52:23 +00:00
|
|
|
description = Static formatting and quality enforcement for the tests
|
|
|
|
basepython = python3.8
|
2020-09-16 07:41:53 +00:00
|
|
|
ignore_errors = true
|
2020-12-22 02:52:23 +00:00
|
|
|
skip_install = true
|
|
|
|
locked_deps =
|
|
|
|
pylint
|
|
|
|
mypy
|
2020-09-16 07:41:53 +00:00
|
|
|
commands =
|
2020-12-22 02:52:23 +00:00
|
|
|
pylint --rcfile {toxinidir}/.pylintrc {toxinidir}/tests/
|
|
|
|
mypy --ignore-missing-imports --no-strict-optional {toxinidir}/tests/
|
2020-09-16 07:41:53 +00:00
|
|
|
|
|
|
|
[testenv:security]
|
2020-12-22 02:52:23 +00:00
|
|
|
description = Security checks
|
|
|
|
basepython = python3.8
|
|
|
|
skip_install = true
|
2020-09-16 07:41:53 +00:00
|
|
|
ignore_errors = true
|
2020-12-22 02:52:23 +00:00
|
|
|
locked_deps =
|
|
|
|
bandit
|
|
|
|
safety
|
|
|
|
poetry
|
2020-09-16 07:41:53 +00:00
|
|
|
commands =
|
2021-10-28 23:03:09 +00:00
|
|
|
bandit --recursive --quiet {toxinidir}/fresnel_lens/
|
2020-12-22 02:52:23 +00:00
|
|
|
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
|