[tox]
envlist = py312-check

[gh-actions]
python = 3.12: py312-check

[testenv:py312-check]
description = Run static checkers.
skip_install = true
allowlist_externals = uv
passenv = PYTHONPATH
setenv = 
    PYTHONPATH = {toxinidir}/src
commands_pre =
    uv sync --no-active --dev
commands =
    # check licenses didn't change
    uv run --no-active python -m tools.check_license --mode check

    # generate PySide files
    uv run --no-active python -m tools.generate_pyside_files

    # linting with ruff
    uv run --no-active ruff check src tests
    uv run --no-active ruff format --diff src tests

    # type checking with mypy
    uv run --no-active mypy src tests

    # tests with pytest and unittest
    uv run --no-active pytest tests {posargs}
    uv run --no-active python -m unittest discover --start-directory tests