2021-10-06 22:08:46 +00:00
|
|
|
[tox]
|
2024-03-21 22:34:38 +00:00
|
|
|
envlist = py3{7-12}, static, static-tests, security
|
2021-10-06 22:08:46 +00:00
|
|
|
isolated_build = true
|
|
|
|
skip_missing_interpreters = true
|
|
|
|
|
|
|
|
[testenv]
|
|
|
|
description = Run the tests
|
|
|
|
require_locked_deps = true
|
|
|
|
require_poetry = true
|
2022-04-08 06:09:38 +00:00
|
|
|
extras =
|
|
|
|
ansible
|
2023-03-02 21:59:18 +00:00
|
|
|
poetry_dep_groups =
|
|
|
|
test
|
2021-10-06 22:08:46 +00:00
|
|
|
commands =
|
2022-04-08 05:44:50 +00:00
|
|
|
pytest {toxinidir}/tests/ \
|
|
|
|
--cov vault2vault \
|
|
|
|
--cov-config {toxinidir}/.coveragerc \
|
|
|
|
--cov-report term-missing
|
2021-10-06 22:08:46 +00:00
|
|
|
|
|
|
|
[testenv:static]
|
|
|
|
description = Static formatting and quality enforcement
|
2023-03-02 21:59:18 +00:00
|
|
|
basepython = python3.10
|
2021-10-06 22:08:46 +00:00
|
|
|
platform = linux
|
|
|
|
ignore_errors = true
|
2023-03-02 21:59:18 +00:00
|
|
|
poetry_dep_groups =
|
|
|
|
dev
|
2021-10-06 22:08:46 +00:00
|
|
|
commands =
|
2022-04-08 05:44:50 +00:00
|
|
|
pre-commit run \
|
|
|
|
--all-files
|
|
|
|
pylint {toxinidir}/vault2vault.py \
|
|
|
|
--rcfile {toxinidir}/.pylintrc
|
|
|
|
mypy {toxinidir}/vault2vault.py \
|
|
|
|
--ignore-missing-imports \
|
|
|
|
--no-strict-optional
|
2021-10-06 22:08:46 +00:00
|
|
|
|
|
|
|
[testenv:static-tests]
|
|
|
|
description = Static formatting and quality enforcement for the tests
|
2023-03-02 21:59:18 +00:00
|
|
|
basepython = python3.10
|
2021-10-06 22:08:46 +00:00
|
|
|
platform = linux
|
|
|
|
ignore_errors = true
|
|
|
|
locked_deps =
|
|
|
|
pylint
|
|
|
|
pytest
|
|
|
|
mypy
|
2022-04-08 05:44:50 +00:00
|
|
|
types-toml
|
2021-10-06 22:08:46 +00:00
|
|
|
commands =
|
2022-04-08 05:44:50 +00:00
|
|
|
pylint {toxinidir}/tests/ \
|
|
|
|
--rcfile {toxinidir}/.pylintrc
|
|
|
|
mypy {toxinidir}/tests/ \
|
|
|
|
--ignore-missing-imports \
|
|
|
|
--no-strict-optional
|
2021-10-06 22:08:46 +00:00
|
|
|
|
|
|
|
[testenv:security]
|
|
|
|
description = Security checks
|
2023-03-02 21:59:18 +00:00
|
|
|
basepython = python3.10
|
2021-10-06 22:08:46 +00:00
|
|
|
platform = linux
|
|
|
|
ignore_errors = true
|
2022-04-08 05:44:50 +00:00
|
|
|
skip_install = true
|
2023-03-02 21:59:18 +00:00
|
|
|
poetry_dep_groups =
|
|
|
|
security
|
2021-10-06 22:08:46 +00:00
|
|
|
commands =
|
2022-04-08 05:44:50 +00:00
|
|
|
bandit {toxinidir}/vault2vault.py \
|
|
|
|
--recursive \
|
|
|
|
--quiet
|
|
|
|
bandit {toxinidir}/tests/ \
|
|
|
|
--recursive \
|
|
|
|
--quiet \
|
|
|
|
--skip B101
|
|
|
|
poetry export \
|
|
|
|
--format requirements.txt \
|
|
|
|
--output {envtmpdir}/requirements.txt \
|
2023-03-29 22:57:10 +00:00
|
|
|
--without-hashes
|
|
|
|
# For now these groups are disabled until this bug is resolved
|
|
|
|
# in poetry-plugin-export:
|
|
|
|
# https://github.com/python-poetry/poetry-plugin-export/issues/176
|
|
|
|
# --with dev \
|
|
|
|
# --with ci \
|
|
|
|
# --with security \
|
|
|
|
# --with test
|
2022-04-08 05:44:50 +00:00
|
|
|
safety check \
|
|
|
|
--file {envtmpdir}/requirements.txt \
|
|
|
|
--json
|