diff --git a/tox.ini b/tox.ini index 8b9d4ec..8f68577 100644 --- a/tox.ini +++ b/tox.ini @@ -1,17 +1,19 @@ [tox] -envlist = py36, py37, py38, static, security +envlist = py36, py37, py38, static, static-tests, security isolated_build = true [testenv] description = Run the tests deps = - requests + pytest + pytest-cov + toml commands = - pip freeze + pytest --cov tox_poetry_installer --cov-config {toxinidir}/.coveragerc tests/ --cov-report term-missing [testenv:static] -description = Static code quality checks and formatting enforcement -basepython = python3.7 +description = Static formatting and quality enforcement +basepython = python3.8 ignore_errors = true deps = pylint @@ -20,21 +22,41 @@ deps = reorder-python-imports pre-commit commands = - black tox_poetry_installer.py - reorder-python-imports tox_poetry_installer.py - pylint tox_poetry_installer.py - mypy tox_poetry_installer.py --ignore-missing-imports --no-strict-optional + black {toxinidir}/tox_poetry_installer.py + reorder-python-imports {toxinidir}/tox_poetry_installer.py pre-commit run --all-files + pylint --rcfile {toxinidir}/.pylintrc {toxinidir}/tox_poetry_installer.py + mypy --ignore-missing-imports --no-strict-optional {toxinidir}/tox_poetry_installer.py -[testenv:security] -description = Security checks -basepython = python3.7 -ignore_errors = true +[testenv:static-tests] +description = Static formatting and quality enforcement for the tests +basepython = python3.8 +ingore_errors = true deps = - bandit - safety + pylint + mypy + black + reorder-python-imports allowlist_externals = bash commands = - bandit tox_poetry_installer.py --recursive + black {toxinidir}/tests/ + bash -c "reorder-python-imports {toxinidir}/tests/*.py --unclassifiable-application-module tox_poetry_installer" + pylint --rcfile {toxinidir}/.pylintrc {toxinidir}/tests/ + mypy --ignore-missing-imports --no-strict-optional {toxinidir}/tests/ + +[testenv:security] +description = Security checks +basepython = python3.8 +ignore_errors = true +skip_install = true +deps = + bandit + safety + poetry +allowlist_externals = + bash +commands = + bandit --recursive {toxinidir}/tox_poetry_installer.py + bash -c "bandit --skip B101 {toxinidir}/tests/*.py" bash -c "poetry export --format requirements.txt --without-hashes --dev | safety check --stdin --bare"