From 179771adc0b280d4ef83851fd750121d3ff2fb37 Mon Sep 17 00:00:00 2001 From: Ethan Paul <24588726+enpaul@users.noreply.github.com> Date: Mon, 21 Dec 2020 21:52:23 -0500 Subject: [PATCH] Overhaul tox config for new locked dependency standards --- tox.ini | 97 ++++++++++++++++++++++++++++++--------------------------- 1 file changed, 51 insertions(+), 46 deletions(-) diff --git a/tox.ini b/tox.ini index a3d9fb2..5d577c2 100644 --- a/tox.ini +++ b/tox.ini @@ -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