[tox]
envlist = py{38,39,311},flake8,isort,black
isolated_build = True

[testenv]
usedevelop = True

deps =
    .[test]

setenv =
    PYTHONNOUSERSITE = /dev/null
    COVERAGE_FILE = {toxworkdir}/{envname}/.coverage

commands =
    pytest {posargs: -n4 --cov src --cov tests --cov-report term-missing \
        --cov-report html \
        --cov-report xml:{toxworkdir}/{envname}/coverage.xml}

[testenv:flake8]
skip_install = True
deps = flake8
commands = flake8 {posargs: src/ tests/}

[testenv:black]
skip_install = True
deps = black
commands = black {posargs: --check src/ tests/}

[testenv:isort]
skip_install = True
deps = isort
commands = isort {posargs: --check-only src/ tests/}

[pytest]
testpaths = tests/
addopts = -v --html=tests-report/index.html

[flake8]
max-line-length = 99
count = True
statistics = True
show-source = True
max-complexity = 10
