[tox]
envlist = py{310,311,312,313}-sa{14,20}-pd{17,18,19,110,20,21,22,23,24,25,26,27,28,29,210,211,212}
skipsdist = true
requires = 
    tox>=4.0
    tox-uv>=0.4

[uv]
uv_python_preference = only-managed

[testenv]
allowlist_externals = uv

basepython =
    py310: python3.10
    py311: python3.11
    py312: python3.12
    py313: python3.13

setenv =
    # SQLAlchemy 버전 매핑
    sa14: SQLALCHEMY_VERSION=1.4.*
    sa20: SQLALCHEMY_VERSION=2.0.*

    pd17: PYDANTIC_VERSION=1.7.*
    pd18: PYDANTIC_VERSION=1.8.*
    pd19: PYDANTIC_VERSION=1.9.*
    pd110: PYDANTIC_VERSION=1.10.*
    pd20:  PYDANTIC_VERSION=2.0.*
    pd21:  PYDANTIC_VERSION=2.1.*
    pd22:  PYDANTIC_VERSION=2.2.*
    pd23:  PYDANTIC_VERSION=2.3.*
    pd24:  PYDANTIC_VERSION=2.4.*
    pd25:  PYDANTIC_VERSION=2.5.*
    pd26:  PYDANTIC_VERSION=2.6.*
    pd27:  PYDANTIC_VERSION=2.7.*
    pd28:  PYDANTIC_VERSION=2.8.*
    pd29:  PYDANTIC_VERSION=2.9.*
    pd210: PYDANTIC_VERSION=2.10.*
    pd211: PYDANTIC_VERSION=2.11.*
    pd212: PYDANTIC_VERSION=2.12.*

commands_pre =
    uv venv --python {basepython} --clear

    uv pip install \
        "sqlalchemy=={env:SQLALCHEMY_VERSION}" \
        "pydantic=={env:PYDANTIC_VERSION}" \
        "pytest" \
        "pytest-asyncio" \
        "pytest-cov"

commands = 
    uv run  --python {basepython} python -m pytest \
        --doctest-modules tests \
        --ignore tests/perf

