[tox]
envlist = check, docs, {py3}{,-coverage}

[gh-actions]
python =
    3.10: check, py310
    3.11: py311
    3.12: py312

[testenv]
basepython =
    pypy3: pypy3
    py38: python3.8
    py39: python3.9
    py310: python3.10
    py311: python3.11
    py312: python3.12
    {check,docs}: python3
setenv =
    PYTHONUNBUFFERED = yes
    PYTEST_EXTRA_ARGS = -s
    coverage: PYTEST_EXTRA_ARGS = --cov=src/Chrfinder.py --cov-report xml:.tox/coverage.xml --cov-report term
passenv =
    *
extras =
    test
commands =
    pytest {env:PYTEST_MARKERS:} {env:PYTEST_EXTRA_ARGS:} {posargs:-vv}
    coverage: genbadge coverage -i .tox/coverage.xml -o assets/coverage-badge.svg
usedevelop = true

[testenv:docs]
description = build HTML docs
setenv =
    READTHEDOCS_PROJECT = Chrfinder
    READTHEDOCS_VERSION = latest
extras =
    doc
commands =
    sphinx-build -d "{toxworkdir}/docs_doctree" docs/source "docs/docs_out" --color -vW -b html
