1
0
mirror of https://github.com/enpaul/kodak.git synced 2024-11-23 15:07:13 +00:00

Overhaul tox config for new locked dependency standards

This commit is contained in:
Ethan Paul 2020-12-21 21:52:23 -05:00
parent ac3910ca62
commit 179771adc0
No known key found for this signature in database
GPG Key ID: C5F5542B54A4D9C6

97
tox.ini
View File

@ -1,69 +1,74 @@
[tox]
envlist = py37, py38, static, static-tests, security, docs
envlist =
py{37,38,39}
static
static-tests
security
docs
isolated_build = true
skip_missing_interpreters = true
[testenv]
description = Run the tests
deps =
pytest == 5.4.3
pytest-cov == 2.9.0
toml == 0.10.1
require_locked_deps = true
locked_deps =
pytest
pytest-cov
toml
commands =
pytest --cov={envsitepackagesdir}/imagemonk --cov-config ./.coveragerc tests/ --cov-report term-missing
pytest --cov={envsitepackagesdir}/imagemonk --cov-config {toxinidir}/.coveragerc --cov-report term-missing {toxinidir}/tests/
[testenv:static]
description = Static code analysis
basepython = python3.7
description = Static formatting and quality enforcement
basepython = python3.8
ignore_errors = true
deps =
pre-commit == 2.4.0
pylint == 2.5.2
mypy == 0.782
skip_install = true
locked_deps =
black
blacken-docs
mypy
reorder-python-imports
pre-commit
pre-commit-hooks
pylint
commands =
pre-commit run --all-files
pylint imagemonk/
mypy imagemonk/ --ignore-missing-imports --no-strict-optional
pylint --rcfile {toxinidir}/.pylintrc {toxinidir}/imagemonk/
mypy --ignore-missing-imports --no-strict-optional {toxinidir}/imagemonk/
[testenv:static-tests]
description = Tests code analysis for tests
basepython = python3.7
description = Static formatting and quality enforcement for the tests
basepython = python3.8
ignore_errors = true
deps =
pre-commit == 2.4.0
pylint == 2.5.2
mypy == 0.782
pytest == 5.4.3
allowlist_externals =
bash
skip_install = true
locked_deps =
pylint
mypy
commands =
pre-commit run --all-files
bash -c "pylint tests/*.py"
mypy tests/ --ignore-missing-imports --no-strict-optional
pylint --rcfile {toxinidir}/.pylintrc {toxinidir}/tests/
mypy --ignore-missing-imports --no-strict-optional {toxinidir}/tests/
[testenv:security]
description = Security checks (bandit+safety)
basepython = python3.7
description = Security checks
basepython = python3.8
skip_install = true
ignore_errors = true
deps =
bandit == 1.6.2
safety == 1.9.0
allowlist_externals =
bash
locked_deps =
bandit
safety
poetry
commands =
bandit imagemonk/ --recursive
bandit tests/ --recursive --skip B101
bash -c "poetry export --format requirements.txt --without-hashes --dev | safety check --stdin --bare"
bandit --recursive --quiet {toxinidir}/imagemonk/
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
[testenv:docs]
description = Build the html documentation with Sphinx
basepython = python3.7
deps =
sphinx == 3.0.4
sphinx-autodoc-typehints == 1.10.3
allowlist_externals =
rm
description = Build the documentation
basepython = python3.8
locked_deps =
sphinx
sphinx-autodoc-typehints
commands =
sphinx-apidoc -o docs/ imagemonk
rm docs/modules.rst
sphinx-build -M html docs/ docs/_build -W
sphinx-apidoc --no-toc --output-dir {toxinidir}/docs/ {toxinidir}/imagemonk/
sphinx-build -W -b html {toxinidir}/docs/ {toxinidir}/docs/_build