[tox]
envlist = lint, type, py36, py37, py38, py39, py310, py311, pypy3
skip_missing_interpreters = true

[testenv]
whitelist_externals = git
deps =
    -rtest-requirements.txt
passenv =
    TERM

# to always force recreation and avoid unexpected side effects
recreate = True

commands =
    git submodule sync -q
    git submodule update --init
    python -m tests {posargs}

[testenv:type]
description = run type check on code base
skip_install = true
recreate = false
deps =
    mypy==0.950
    types-atomicwrites
    types-regex
    rich
commands =
    mypy

[testenv:lint]
description = run linters on code base
skip_install = true
recreate = false
deps =
    pre-commit
commands =
    pre-commit run --all-files --show-diff-on-failure
