[tox]
envlist =
    black,flake8,import-order,mypy,manifest,
    py{39,310,311,312,313,py3}

[gh-actions]
python =
    3.9: py39
    3.10: py310
    3.11: py311
    3.12: py312
    3.13: py313
    pypy-3: pypy3

[testenv]
conda_channels = conda-forge
passenv = *
setenv =
    PYTHONPATH = {toxinidir}
    MULTIDICT_NO_EXTENSIONS = 1 ; Related to https://github.com/aio-libs/multidict
    YARL_NO_EXTENSIONS = 1      ; Related to https://github.com/aio-libs/yarl
    GQL_TESTS_TIMEOUT_FACTOR = 10
install_command = python -m pip install --ignore-installed {opts} {packages}
whitelist_externals =
    python
deps = -e.[test]
; Prevent installing issues: https://github.com/ContinuumIO/anaconda-issues/issues/542
commands =
    pip install -U setuptools
    ; run "tox -- tests -s" to show output for debugging
    py{39,310,311,312,313,py3}: pytest {posargs:tests}
    py{312}: pytest {posargs:tests --cov-report=term-missing --cov=gql}

[testenv:black]
basepython = python
deps = -e.[dev]
commands =
    black --check gql tests

[testenv:flake8]
basepython = python
deps = -e.[dev]
commands =
    flake8 gql tests

[testenv:import-order]
basepython = python
deps = -e.[dev]
commands =
    isort --check-only --diff gql tests

[testenv:mypy]
basepython = python
deps = -e.[dev]
commands =
    mypy gql tests

[testenv:docs]
basepython = python
deps = -e.[dev]
commands =
    sphinx-build -b html -nEW docs docs/_build/html

[testenv:manifest]
basepython = python
deps = -e.[dev]
commands =
    check-manifest -v
