django-analytical/tox.ini
Peter Bittner a021e07e15
Improve GHA test jobs, move tool config to pyproject.toml (#202)
* Move Tox tool config settings to pyproject.toml
* Restore older Bandit version for predictive setup
   Bandit UX is seriously broken. Unfortunately, only <1.6 works predictably.
* Exclude unsupported Python/Django combinations
   Use a more self-explanatory build job name for tests
* Help pytest find the Django test project settings
* Use clean range for Django 4.0
* Keep load on the GHA runners low, use newer Python for checks
2022-02-04 19:04:03 +01:00

82 lines
1.7 KiB
INI

[tox]
envlist =
isort
flake8
bandit
# Python/Django combinations that are officially supported
py{36,37,38,39}-django{22}
py{36,37,38,39,310}-django{32}
py{38,39,310}-django{40}
readme
docs
[testenv]
description = Unit tests
deps =
coverage
pytest-django
django22: Django>=2.2,<3.0
django32: Django>=3.2,<4.0
django40: Django>=4.0,<4.1
commands =
coverage run -m pytest
coverage xml
[testenv:bandit]
description = PyCQA security linter
deps = bandit<1.6
commands = -bandit --ini tox.ini {posargs:-r .}
[testenv:docs]
description = Build the HTML documentation
deps = sphinx
commands = sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
allowlist_externals = make
[testenv:flake8]
description = Static code analysis and code style
deps = flake8
commands = flake8 {posargs}
[testenv:isort]
description = Ensure imports are ordered consistently
deps = isort[colors]
commands = isort --check-only --diff {posargs:analytical setup.py tests}
skip_install = True
[testenv:readme]
description = Ensure README renders on PyPI
deps = twine
commands =
{envpython} setup.py -q sdist bdist_wheel
twine check dist/*
[testenv:clean]
description = Clean up bytecode and build artifacts
deps = pyclean
commands =
pyclean -v {toxinidir}
rm -rf .tox/ build/ dist/ django_analytical.egg-info/ .coverage coverage.xml
allowlist_externals =
rm
[bandit]
exclude = .git,.github,.tox,build,dist,docs,tests
[flake8]
exclude = .cache,.git,.tox,build,dist
max-line-length = 100
[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310
[gh-actions:env]
DJANGO =
2.2: django22
3.2: django32
4.0: django40