[tox]
parallel_show_output = true
envlist=
    coveralls, pylint, flake8, pydocstyle, pydantic-v1, pydantic-v2, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, pypy3.9, pypy3.10

[testenv]
deps=
    pytest
    pytest-asyncio
    httpx
    fastapi
    flask
    aiohttp
    numpy
    scipy
    boto3
    mypy_boto3_s3
    pydantic-settings
    werkzeug
extras=
    yaml
commands = pytest
python_files = test_*_py3*.py
setenv =
    COVERAGE_RCFILE = pyproject.toml

[testenv:.pkg]
passenv = DEPENDENCY_INJECTOR_*

[testenv:pydantic-{v1,v2}]
description = run tests with different pydantic versions
base_python = python3.12
deps =
    v1: pydantic<2
    v2: pydantic-settings
    pytest
    pytest-asyncio
    typing_extensions
    httpx
    fastapi
    flask
    aiohttp
    numpy
    scipy
    boto3
    mypy_boto3_s3
    werkzeug
commands = pytest -m pydantic

[testenv:coveralls]
passenv = GITHUB_*, COVERALLS_*, DEPENDENCY_INJECTOR_*
basepython=python3.12  # TODO: Upgrade to version 3.13 is blocked by coveralls 4.0.1 not supporting Python 3.13
deps=
    {[testenv]deps}
    cython>=3,<4
    coverage>=7
    coveralls>=4
commands=
    coverage erase
    coverage run -m pytest
    coverage report
    coveralls

[testenv:pypy3.9]
deps=
    pytest
    pytest-asyncio
    httpx
    flask
    pydantic-settings
    werkzeug
    fastapi
    boto3
    mypy_boto3_s3
extras=
    yaml
commands = pytest


[testenv:pylint]
deps=
    pylint
    flask
    werkzeug
commands=
    - pylint -f colorized src/dependency_injector

[testenv:flake8]
deps=
    flake8
commands=
    flake8 src/dependency_injector/
    flake8 examples/

[testenv:pydocstyle]
deps=
    pydocstyle
commands=
    pydocstyle src/dependency_injector/
    pydocstyle examples/

[testenv:mypy]
deps=
    typing_extensions
    pydantic-settings
    mypy
commands=
    mypy tests/typing