2020-09-23 06:17:30 +00:00
|
|
|
[tox]
|
2020-09-25 01:55:23 +00:00
|
|
|
envlist = py36, py37, py38, static, static-tests, security
|
2020-09-23 06:17:30 +00:00
|
|
|
isolated_build = true
|
|
|
|
|
|
|
|
[testenv]
|
2020-09-24 00:36:11 +00:00
|
|
|
description = Run the tests
|
2020-09-26 14:45:47 +00:00
|
|
|
require_locked_deps = true
|
2020-09-23 06:17:30 +00:00
|
|
|
deps =
|
2020-09-25 01:55:23 +00:00
|
|
|
pytest
|
|
|
|
pytest-cov
|
|
|
|
toml
|
2020-09-23 06:17:30 +00:00
|
|
|
commands =
|
2020-11-12 03:34:42 +00:00
|
|
|
pytest --cov {envsitepackagesdir}/tox_poetry_installer --cov-config {toxinidir}/.coveragerc --cov-report term-missing tests/
|
2020-09-24 00:36:11 +00:00
|
|
|
|
|
|
|
[testenv:static]
|
2020-09-25 01:55:23 +00:00
|
|
|
description = Static formatting and quality enforcement
|
|
|
|
basepython = python3.8
|
2020-11-12 03:34:42 +00:00
|
|
|
platform = linux
|
2020-09-24 00:36:11 +00:00
|
|
|
ignore_errors = true
|
2020-11-12 03:34:42 +00:00
|
|
|
require_locked_deps = true
|
2020-09-24 00:36:11 +00:00
|
|
|
deps =
|
|
|
|
pylint
|
|
|
|
mypy
|
|
|
|
black
|
|
|
|
reorder-python-imports
|
|
|
|
pre-commit
|
2020-11-12 03:34:42 +00:00
|
|
|
allowlist_externals =
|
|
|
|
bash
|
2020-09-24 00:36:11 +00:00
|
|
|
commands =
|
2020-11-12 03:34:42 +00:00
|
|
|
black {toxinidir}/tox_poetry_installer/
|
|
|
|
# Oh man this is a doozy. If submodules are ever added to this plugin this will break, but I'm
|
|
|
|
# frustrated enough at this point that I'll need to take another look at it later to fix that.
|
|
|
|
# reorder-python-imports doesn't support handling directories on the CLI
|
|
|
|
# (https://github.com/asottile/reorder_python_imports/pull/76) and because the command is
|
|
|
|
# invoked directly (see comment below) we need file globbing to work around it.
|
|
|
|
# The "--unclassifiable-application-module" is a work around for reorder-python-imports not
|
|
|
|
# properly detecting the top-level module when run in a bash-wrapped command like this.
|
|
|
|
bash -c "reorder-python-imports {toxinidir}/tox_poetry_installer/*.py --unclassifiable-application-module tox_poetry_installer"
|
2020-09-24 00:36:11 +00:00
|
|
|
pre-commit run --all-files
|
2020-11-12 03:34:42 +00:00
|
|
|
pylint --rcfile {toxinidir}/.pylintrc {toxinidir}/tox_poetry_installer/
|
|
|
|
mypy --ignore-missing-imports --no-strict-optional {toxinidir}/tox_poetry_installer/
|
2020-09-25 01:55:23 +00:00
|
|
|
|
|
|
|
[testenv:static-tests]
|
|
|
|
description = Static formatting and quality enforcement for the tests
|
|
|
|
basepython = python3.8
|
2020-11-12 03:34:42 +00:00
|
|
|
platform = linux
|
2020-09-25 01:55:23 +00:00
|
|
|
ingore_errors = true
|
2020-11-12 03:34:42 +00:00
|
|
|
require_locked_deps = true
|
2020-09-25 01:55:23 +00:00
|
|
|
deps =
|
|
|
|
pylint
|
|
|
|
mypy
|
|
|
|
black
|
|
|
|
reorder-python-imports
|
|
|
|
allowlist_externals =
|
|
|
|
bash
|
|
|
|
commands =
|
|
|
|
black {toxinidir}/tests/
|
2020-11-12 03:34:42 +00:00
|
|
|
# These bash-wrapped commands hurt my face, but these tools expect directories to be valid
|
|
|
|
# python modules, which the "tests/" directory is not. Since tox calls all commands directly
|
|
|
|
# (which is good) file globbing doesn't work. To make file globbing work they need to be wrapped
|
|
|
|
# in a bash call (which is bad).
|
2020-09-25 01:55:23 +00:00
|
|
|
bash -c "reorder-python-imports {toxinidir}/tests/*.py --unclassifiable-application-module tox_poetry_installer"
|
2020-10-11 23:30:52 +00:00
|
|
|
bash -c "pylint --rcfile {toxinidir}/.pylintrc {toxinidir}/tests/*.py"
|
|
|
|
bash -c "mypy --ignore-missing-imports --no-strict-optional {toxinidir}/tests/*.py"
|
2020-09-24 00:36:11 +00:00
|
|
|
|
|
|
|
[testenv:security]
|
|
|
|
description = Security checks
|
2020-09-25 01:55:23 +00:00
|
|
|
basepython = python3.8
|
2020-11-12 03:34:42 +00:00
|
|
|
platform = linux
|
|
|
|
ingore_errors = true
|
|
|
|
require_locked_deps = true
|
2020-09-24 00:36:11 +00:00
|
|
|
deps =
|
|
|
|
bandit
|
|
|
|
safety
|
2020-09-25 01:55:23 +00:00
|
|
|
poetry
|
2020-09-24 00:36:11 +00:00
|
|
|
commands =
|
2020-11-12 03:34:42 +00:00
|
|
|
bandit --recursive --quiet {toxinidir}/tox_poetry_installer/
|
|
|
|
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
|