[tox]
requires =
    tox>=4.19
env_list =
    unit-py3{9-13}
    integration-py3{9-13}-sphinx{5-9}
    lint
    format

[testenv]
deps =
    ../core
{% for dep in deps %}
    ../{{ dep.dir_name }}
{% endfor %}
    .

[testenv:lint]
description = run type checker
labels = static
deps =
    {[testenv]deps}
    mypy
commands =
    python3 -m mypy src --junit-xml test-reports/{env_name}.xml

[testenv:format]
description = check code formatting
labels = static
deps =
    {[testenv]deps}
    black
commands =
    black --check src

[testenv:unit-py3{9-13}]
description = run unit tests
labels = unit
deps =
    {[testenv]deps}
    pytest
commands =
    pytest tests/unit --junitxml=test-reports/{env_name}.xml

[testenv:integration-py3{9-13}-sphinx{5-9}]
description = run integration tests
labels = integration
deps =
    {[testenv]deps}
    sphinx5: sphinx>=5.0,<=6.0
    sphinx6: sphinx>=6.0,<=7.0
    sphinx7: sphinx>=7.0,<=8.0
    sphinx8: sphinx>=8.0,<=9.0
    sphinx9: sphinx>=9.0,<=10.0
    pytest
commands =
    pytest tests/integration --junitxml=test-reports/{env_name}.xml
