# Tox (http://codespeak.net/~hpk/tox/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.

[tox]
envlist =
    # === Common ===
    {py2.7,py3.5,py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12}-common

    # === Gevent ===
    {py2.7,py3.6,py3.8,py3.10,py3.11}-gevent

    # === Integrations ===
    # General format is {pythonversion}-{integrationname}-v{frameworkversion}
    # 1 blank line between different integrations
    # Each framework version should only be mentioned once. I.e:
    #   {py3.7,py3.10}-django-v{3.2}
    #   {py3.10}-django-v{4.0}
    # instead of:
    #   {py3.7}-django-v{3.2}
    #   {py3.7,py3.10}-django-v{3.2,4.0}
    #
    # At a minimum, we should test against at least the lowest
    # and the latest supported version of a framework.

    # AIOHTTP
    {py3.7}-aiohttp-v{3.4}
    {py3.7,py3.9,py3.11}-aiohttp-v{3.8}
    {py3.8,py3.11}-aiohttp-latest

    # Ariadne
    {py3.8,py3.11}-ariadne-v{0.20}
    {py3.8,py3.11,py3.12}-ariadne-latest

    # Arq
    {py3.7,py3.11}-arq-v{0.23}
    {py3.7,py3.11,py3.12}-arq-latest

    # Asgi
    {py3.7,py3.11,py3.12}-asgi

    # asyncpg
    {py3.7,py3.10}-asyncpg-v{0.23}
    {py3.8,py3.11,py3.12}-asyncpg-latest

    # AWS Lambda
    # The aws_lambda tests deploy to the real AWS and have their own
    # matrix of Python versions to run the test lambda function in.
    # see `lambda_runtime` fixture in tests/integrations/aws_lambda.py
    {py3.9}-aws_lambda

    # Beam
    {py3.7}-beam-v{2.12}
    {py3.8,py3.11}-beam-latest

    # Boto3
    {py2.7,py3.6,py3.7}-boto3-v{1.12}
    {py3.7,py3.11,py3.12}-boto3-v{1.21}
    {py3.7,py3.11,py3.12}-boto3-v{1.29}
    {py3.7,py3.11,py3.12}-boto3-latest

    # Bottle
    {py2.7,py3.5,py3.9}-bottle-v{0.12}
    {py3.5,py3.11,py3.12}-bottle-latest

    # Celery
    {py2.7}-celery-v{3}
    {py2.7,py3.5,py3.8}-celery-v{4}
    {py3.6,py3.8}-celery-v{5.0}
    {py3.7,py3.10}-celery-v{5.1,5.2}
    {py3.8,py3.11}-celery-v{5.3}
    {py3.8,py3.11}-celery-latest

    # Chalice
    {py3.6,py3.9}-chalice-v{1.16}
    {py3.7,py3.10}-chalice-latest

    # Clickhouse Driver
    {py3.8,py3.11}-clickhouse_driver-v{0.2.0}
    {py3.8,py3.11,py3.12}-clickhouse_driver-latest

    # Cloud Resource Context
    {py3.6,py3.11,py3.12}-cloud_resource_context

    # Django
    # - Django 1.x
    {py2.7,py3.5}-django-v{1.8}
    {py2.7,py3.5,py3.7}-django-v{1.11}
    # - Django 2.x
    {py3.5,py3.7}-django-v{2.0}
    {py3.5,py3.9}-django-v{2.2}
    # - Django 3.x
    {py3.6,py3.9}-django-v{3.0}
    {py3.6,py3.11}-django-v{3.2}
    # - Django 4.x
    {py3.8,py3.11,py3.12}-django-v{4.0,4.1,4.2}
    # - Django 5.x
    {py3.10,py3.11,py3.12}-django-v{5.0}
    {py3.10,py3.11,py3.12}-django-latest

    # Falcon
    {py2.7,py3.5,py3.7}-falcon-v{1,1.4,2}
    {py3.5,py3.6,py3.11,py3.12}-falcon-v{3}
    {py3.7,py3.11,py3.12}-falcon-latest

    # FastAPI
    {py3.7,py3.10}-fastapi-v{0.79}
    {py3.8,py3.11,py3.12}-fastapi-latest

    # Flask
    {py2.7,py3.5}-flask-v{0,0.11}
    {py2.7,py3.5,py3.8}-flask-v{1}
    {py3.8,py3.11,py3.12}-flask-v{2}
    {py3.10,py3.11,py3.12}-flask-v{3}
    {py3.10,py3.11,py3.12}-flask-latest

    # GCP
    {py3.7}-gcp

    # GQL
    {py3.7,py3.11}-gql-v{3.4}
    {py3.7,py3.11}-gql-latest

    # Graphene
    {py3.7,py3.11}-graphene-v{3.3}
    {py3.7,py3.11,py3.12}-graphene-latest

    # gRPC
    {py3.7,py3.10}-grpc-v{1.21,1.30,1.40}
    {py3.7,py3.11}-grpc-v{1.50}
    {py3.8,py3.11,py3.12}-grpc-latest

    # HTTPX
    {py3.6,py3.9}-httpx-v{0.16,0.18}
    {py3.6,py3.10}-httpx-v{0.20,0.22}
    {py3.7,py3.11,py3.12}-httpx-v{0.23,0.24}
    {py3.9,py3.11,py3.12}-httpx-v{0.25}
    {py3.9,py3.11,py3.12}-httpx-latest

    # Huey
    {py2.7,py3.5,py3.11,py3.12}-huey-v{2.0}
    {py3.5,py3.11,py3.12}-huey-latest

    # Loguru
    {py3.5,py3.11,py3.12}-loguru-v{0.5}
    {py3.5,py3.11,py3.12}-loguru-latest

    # OpenAI
    {py3.9,py3.11,py3.12}-openai-v1
    {py3.9,py3.11,py3.12}-openai-latest
    {py3.9,py3.11,py3.12}-openai-notiktoken

    # OpenTelemetry (OTel)
    {py3.7,py3.9,py3.11,py3.12}-opentelemetry

    # pure_eval
    {py3.5,py3.11,py3.12}-pure_eval

    # PyMongo (Mongo DB)
    {py2.7,py3.6}-pymongo-v{3.1}
    {py2.7,py3.6,py3.9}-pymongo-v{3.12}
    {py3.6,py3.11}-pymongo-v{4.0}
    {py3.7,py3.11,py3.12}-pymongo-v{4.3,4.6}
    {py3.7,py3.11,py3.12}-pymongo-latest

    # Pyramid
    {py2.7,py3.5,py3.11}-pyramid-v{1.6}
    {py2.7,py3.5,py3.11,py3.12}-pyramid-v{1.10}
    {py3.6,py3.11,py3.12}-pyramid-v{2.0}
    {py3.6,py3.11,py3.12}-pyramid-latest

    # Quart
    {py3.7,py3.11}-quart-v{0.16}
    {py3.8,py3.11,py3.12}-quart-v{0.19}
    {py3.8,py3.11,py3.12}-quart-latest

    # Redis
    {py2.7,py3.7,py3.8}-redis-v{3}
    {py3.7,py3.8,py3.11}-redis-v{4}
    {py3.7,py3.11,py3.12}-redis-v{5}
    {py3.7,py3.11,py3.12}-redis-latest

    # Redis Cluster
    {py2.7,py3.7,py3.8}-rediscluster-v{1,2}
    # no -latest, not developed anymore

    # Requests
    {py2.7,py3.8,py3.11,py3.12}-requests

    # RQ (Redis Queue)
    {py2.7,py3.5,py3.6}-rq-v{0.6}
    {py2.7,py3.5,py3.9}-rq-v{0.13,1.0}
    {py3.5,py3.11}-rq-v{1.5,1.10}
    {py3.7,py3.11,py3.12}-rq-v{1.15}
    {py3.7,py3.11,py3.12}-rq-latest

    # Sanic
    {py3.5,py3.7}-sanic-v{0.8}
    {py3.6,py3.8}-sanic-v{20}
    {py3.7,py3.11}-sanic-v{22}
    {py3.7,py3.11}-sanic-v{23}
    {py3.8,py3.11}-sanic-latest

    # Starlette
    {py3.7,py3.10}-starlette-v{0.19}
    {py3.7,py3.11}-starlette-v{0.20,0.24,0.28}
    {py3.8,py3.11,py3.12}-starlette-v{0.32}
    {py3.8,py3.11,py3.12}-starlette-latest

    # Starlite
    {py3.8,py3.11}-starlite-v{1.48,1.51}
    # 1.51.14 is the last starlite version; the project continues as litestar

    # SQL Alchemy
    {py2.7,py3.7,py3.9}-sqlalchemy-v{1.2,1.4}
    {py3.7,py3.11}-sqlalchemy-v{2.0}
    {py3.7,py3.11,py3.12}-sqlalchemy-latest

    # Strawberry
    {py3.8,py3.11}-strawberry-v{0.209}
    {py3.8,py3.11,py3.12}-strawberry-latest

    # Tornado
    {py3.7,py3.9}-tornado-v{5}
    {py3.8,py3.11,py3.12}-tornado-v{6}
    {py3.8,py3.11,py3.12}-tornado-latest

    # Trytond
    {py3.5,py3.6}-trytond-v{4}
    {py3.6,py3.8}-trytond-v{5}
    {py3.6,py3.11}-trytond-v{6}
    {py3.8,py3.11,py3.12}-trytond-v{7}
    {py3.8,py3.11,py3.12}-trytond-latest

[testenv]
deps =
    # if you change test-requirements.txt and your change is not being reflected
    # in what's installed by tox (when running tox locally), try running tox
    # with the -r flag
    -r test-requirements.txt

    linters: -r linter-requirements.txt
    linters: werkzeug<2.3.0

    # === Common ===
    py3.8-common: hypothesis
    {py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12}-common: pytest-asyncio<=0.21.1
    # See https://github.com/pytest-dev/pytest/issues/9621
    # and https://github.com/pytest-dev/pytest-forked/issues/67
    # for justification of the upper bound on pytest
    {py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12}-common: pytest<7.0.0

    # === Gevent ===
    {py2.7,py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12}-gevent: gevent>=22.10.0, <22.11.0
    # See https://github.com/pytest-dev/pytest/issues/9621
    # and https://github.com/pytest-dev/pytest-forked/issues/67
    # for justification of the upper bound on pytest
    {py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12}-gevent: pytest<7.0.0

    # === Integrations ===

    # AIOHTTP
    aiohttp-v3.4: aiohttp~=3.4.0
    aiohttp-v3.8: aiohttp~=3.8.0
    aiohttp-latest: aiohttp
    aiohttp: pytest-aiohttp
    aiohttp-v3.8: pytest-asyncio<=0.21.1
    aiohttp-latest: pytest-asyncio<=0.21.1

    # Ariadne
    ariadne-v0.20: ariadne~=0.20.0
    ariadne-latest: ariadne
    ariadne: fastapi
    ariadne: flask
    ariadne: httpx

    # Arq
    arq-v0.23: arq~=0.23.0
    arq-v0.23: pydantic<2
    arq-latest: arq
    arq: fakeredis>=2.2.0,<2.8
    arq: pytest-asyncio<=0.21.1
    arq: async-timeout

    # Asgi
    asgi: pytest-asyncio<=0.21.1
    asgi: async-asgi-testclient

    # Asyncpg
    asyncpg-v0.23: asyncpg~=0.23.0
    asyncpg-latest: asyncpg
    asyncpg: pytest-asyncio<=0.21.1

    # AWS Lambda
    aws_lambda: boto3

    # Beam
    beam-v2.12: apache-beam~=2.12.0
    beam-latest: apache-beam

    # Boto3
    boto3-v1.12: boto3~=1.12.0
    boto3-v1.21: boto3~=1.21.0
    boto3-v1.29: boto3~=1.29.0
    boto3-latest: boto3

    # Bottle
    bottle: Werkzeug<2.1.0
    bottle-v0.12: bottle~=0.12.0
    bottle-latest: bottle

    # Celery
    celery: redis
    celery-v3: Celery~=3.0
    celery-v4: Celery~=4.0
    celery-v5.0: Celery~=5.0.0
    celery-v5.1: Celery~=5.1.0
    celery-v5.2: Celery~=5.2.0
    celery-v5.3: Celery~=5.3.0
    celery-latest: Celery

    {py3.5}-celery: newrelic<6.0.0
    {py3.7}-celery: importlib-metadata<5.0
    {py2.7,py3.6,py3.7,py3.8,py3.9,py3.10,py3.11}-celery: newrelic

    # Chalice
    chalice-v1.16: chalice~=1.16.0
    chalice-latest: chalice
    chalice: pytest-chalice==0.0.5

    {py3.7}-chalice: botocore~=1.31
    {py3.8}-chalice: botocore~=1.31

    # Clickhouse Driver
    clickhouse_driver-v0.2.0: clickhouse_driver~=0.2.0
    clickhouse_driver-latest: clickhouse_driver

    # Django
    django: psycopg2-binary
    django-v{1.11,2.0,2.1,2.2,3.0,3.1,3.2}: djangorestframework>=3.0.0,<4.0.0
    django-v{2.0,2.2,3.0,3.2,4.0,4.1,4.2,5.0}: channels[daphne]
    django-v{1.8,1.11,2.0,2.2,3.0,3.2}: Werkzeug<2.1.0
    django-v{1.8,1.11,2.0}: pytest-django<4.0
    django-v{2.2,3.0,3.2,4.0,4.1,4.2,5.0}: pytest-django
    django-v{4.0,4.1,4.2,5.0}: djangorestframework
    django-v{4.0,4.1,4.2,5.0}: pytest-asyncio<=0.21.1
    django-v{4.0,4.1,4.2,5.0}: Werkzeug
    django-latest: djangorestframework
    django-latest: pytest-asyncio<=0.21.1
    django-latest: pytest-django
    django-latest: Werkzeug
    django-latest: channels[daphne]

    django-v1.8: Django~=1.8.0
    django-v1.11: Django~=1.11.0
    django-v2.0: Django~=2.0.0
    django-v2.2: Django~=2.2.0
    django-v3.0: Django~=3.0.0
    django-v3.2: Django~=3.2.0
    django-v4.0: Django~=4.0.0
    django-v4.1: Django~=4.1.0
    django-v4.2: Django~=4.2.0
    django-v5.0: Django~=5.0.0
    django-latest: Django

    # Falcon
    falcon-v1.4: falcon~=1.4.0
    falcon-v1: falcon~=1.0
    falcon-v2: falcon~=2.0
    falcon-v3: falcon~=3.0
    falcon-latest: falcon

    # FastAPI
    fastapi: httpx
    # (this is a dependency of httpx)
    fastapi: anyio<4.0.0
    fastapi: pytest-asyncio<=0.21.1
    fastapi: python-multipart
    fastapi: requests
    fastapi-v{0.79}: fastapi~=0.79.0
    fastapi-latest: fastapi

    # Flask
    flask: flask-login
    flask-v{0.11,0,1,2.0}: Werkzeug<2.1.0
    flask-v{0.11,0,1,2.0}: markupsafe<2.1.0
    flask-v{3}: Werkzeug
    flask-v0.11: Flask~=0.11.0
    flask-v0: Flask~=0.11
    flask-v1: Flask~=1.0
    flask-v2: Flask~=2.0
    flask-v3: Flask~=3.0
    flask-latest: Flask

    # GQL
    gql-v{3.4}: gql[all]~=3.4.0
    gql-latest: gql[all]

    # Graphene
    graphene: blinker
    graphene: fastapi
    graphene: flask
    graphene: httpx
    graphene-v{3.3}: graphene~=3.3.0
    graphene-latest: graphene

    # gRPC
    grpc: protobuf
    grpc: mypy-protobuf
    grpc: types-protobuf
    grpc: pytest-asyncio<=0.21.1
    grpc-v1.21: grpcio-tools~=1.21.0
    grpc-v1.30: grpcio-tools~=1.30.0
    grpc-v1.40: grpcio-tools~=1.40.0
    grpc-v1.50: grpcio-tools~=1.50.0
    grpc-latest: grpcio-tools

    # HTTPX
    httpx-v0.16: pytest-httpx==0.10.0
    httpx-v0.18: pytest-httpx==0.12.0
    httpx-v0.20: pytest-httpx==0.14.0
    httpx-v0.22: pytest-httpx==0.19.0
    httpx-v0.23: pytest-httpx==0.21.0
    httpx-v0.24: pytest-httpx==0.22.0
    httpx-v0.25: pytest-httpx==0.25.0
    httpx: pytest-httpx
    # anyio is a dep of httpx
    httpx: anyio<4.0.0
    httpx-v0.16: httpx~=0.16.0
    httpx-v0.18: httpx~=0.18.0
    httpx-v0.20: httpx~=0.20.0
    httpx-v0.22: httpx~=0.22.0
    httpx-v0.23: httpx~=0.23.0
    httpx-v0.24: httpx~=0.24.0
    httpx-v0.25: httpx~=0.25.0
    httpx-latest: httpx

    # Huey
    huey-v2.0: huey~=2.0.0
    huey-latest: huey

    # Loguru
    loguru-v0.5: loguru~=0.5.0
    loguru-latest: loguru

    # OpenAI
    openai-v1: openai~=1.0.0
    openai-v1: tiktoken~=0.6.0
    openai-latest: openai
    openai-latest: tiktoken~=0.6.0
    openai-notiktoken: openai

    # OpenTelemetry (OTel)
    opentelemetry: opentelemetry-distro

    # pure_eval
    pure_eval: pure_eval

    # PyMongo (MongoDB)
    pymongo: mockupdb
    pymongo-v3.1: pymongo~=3.1.0
    pymongo-v3.13: pymongo~=3.13.0
    pymongo-v4.0: pymongo~=4.0.0
    pymongo-v4.3: pymongo~=4.3.0
    pymongo-v4.6: pymongo~=4.6.0
    pymongo-latest: pymongo

    # Pyramid
    pyramid: Werkzeug<2.1.0
    pyramid-v1.6: pyramid~=1.6.0
    pyramid-v1.10: pyramid~=1.10.0
    pyramid-v2.0: pyramid~=2.0.0
    pyramid-latest: pyramid

    # Quart
    quart: quart-auth
    quart: pytest-asyncio<=0.21.1
    quart-v0.16: blinker<1.6
    quart-v0.16: jinja2<3.1.0
    quart-v0.16: Werkzeug<2.1.0
    quart-v0.16: hypercorn<0.15.0
    quart-v0.16: quart~=0.16.0
    quart-v0.19: Werkzeug>=3.0.0
    quart-v0.19: quart~=0.19.0
    quart-latest: quart

    # Redis
    redis: fakeredis!=1.7.4
    {py3.7,py3.8,py3.9,py3.10,py3.11}-redis: pytest-asyncio<=0.21.1
    redis-v3: redis~=3.0
    redis-v4: redis~=4.0
    redis-v5: redis~=5.0
    redis-latest: redis

    # Redis Cluster
    rediscluster-v1: redis-py-cluster~=1.0
    rediscluster-v2: redis-py-cluster~=2.0

    # Requests
    requests: requests>=2.0

    # RQ (Redis Queue)
    # https://github.com/jamesls/fakeredis/issues/245
    rq-v{0.6}: fakeredis<1.0
    rq-v{0.6}: redis<3.2.2
    rq-v{0.13,1.0,1.5,1.10}: fakeredis>=1.0,<1.7.4
    rq-v{1.15}: fakeredis
    rq-latest: fakeredis
    rq-v0.6: rq~=0.6.0
    rq-v0.13: rq~=0.13.0
    rq-v1.0: rq~=1.0.0
    rq-v1.5: rq~=1.5.0
    rq-v1.10: rq~=1.10.0
    rq-v1.15: rq~=1.15.0
    rq-latest: rq

    # Sanic
    sanic: websockets<11.0
    sanic: aiohttp
    sanic-v{22,23}: sanic_testing
    sanic-latest: sanic_testing
    {py3.5,py3.6}-sanic: aiocontextvars==0.2.1
    {py3.5}-sanic: ujson<4
    sanic-v0.8: sanic~=0.8.0
    sanic-v20: sanic~=20.0
    sanic-v22: sanic~=22.0
    sanic-v23: sanic~=23.0
    sanic-latest: sanic

    # Starlette
    starlette: pytest-asyncio<=0.21.1
    starlette: python-multipart
    starlette: requests
    starlette: httpx
    # (this is a dependency of httpx)
    starlette: anyio<4.0.0
    starlette: jinja2
    starlette-v0.19: starlette~=0.19.0
    starlette-v0.20: starlette~=0.20.0
    starlette-v0.24: starlette~=0.24.0
    starlette-v0.28: starlette~=0.28.0
    starlette-v0.32: starlette~=0.32.0
    starlette-latest: starlette

    # Starlite
    starlite: pytest-asyncio<=0.21.1
    starlite: python-multipart
    starlite: requests
    starlite: cryptography
    starlite: pydantic<2.0.0
    starlite-v{1.48}: starlite~=1.48.0
    starlite-v{1.51}: starlite~=1.51.0

    # SQLAlchemy
    sqlalchemy-v1.2: sqlalchemy~=1.2.0
    sqlalchemy-v1.4: sqlalchemy~=1.4.0
    sqlalchemy-v2.0: sqlalchemy~=2.0.0
    sqlalchemy-latest: sqlalchemy

    # Strawberry
    strawberry: fastapi
    strawberry: flask
    strawberry: httpx
    strawberry-v0.209: strawberry-graphql[fastapi,flask]~=0.209.0
    strawberry-latest: strawberry-graphql[fastapi,flask]

    # Tornado
    tornado-v5: tornado~=5.0
    tornado-v6: tornado~=6.0
    tornado-latest: tornado

    # Trytond
    trytond-v4: trytond~=4.0
    trytond-v5: trytond~=5.0
    trytond-v6: trytond~=6.0
    trytond-v7: trytond~=7.0
    trytond-latest: trytond

    trytond-v{4}: werkzeug<1.0
    trytond-v{5,6,7}: werkzeug<2.0
    trytond-latest: werkzeug<2.0

setenv =
    PYTHONDONTWRITEBYTECODE=1
    OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
    common: TESTPATH=tests
    gevent: TESTPATH=tests
    aiohttp: TESTPATH=tests/integrations/aiohttp
    ariadne: TESTPATH=tests/integrations/ariadne
    arq: TESTPATH=tests/integrations/arq
    asgi: TESTPATH=tests/integrations/asgi
    asyncpg: TESTPATH=tests/integrations/asyncpg
    aws_lambda: TESTPATH=tests/integrations/aws_lambda
    beam: TESTPATH=tests/integrations/beam
    boto3: TESTPATH=tests/integrations/boto3
    bottle: TESTPATH=tests/integrations/bottle
    celery: TESTPATH=tests/integrations/celery
    chalice: TESTPATH=tests/integrations/chalice
    clickhouse_driver: TESTPATH=tests/integrations/clickhouse_driver
    cloud_resource_context: TESTPATH=tests/integrations/cloud_resource_context
    django: TESTPATH=tests/integrations/django
    falcon: TESTPATH=tests/integrations/falcon
    fastapi:  TESTPATH=tests/integrations/fastapi
    flask: TESTPATH=tests/integrations/flask
    gcp: TESTPATH=tests/integrations/gcp
    gql: TESTPATH=tests/integrations/gql
    graphene: TESTPATH=tests/integrations/graphene
    httpx: TESTPATH=tests/integrations/httpx
    huey: TESTPATH=tests/integrations/huey
    loguru: TESTPATH=tests/integrations/loguru
    openai: TESTPATH=tests/integrations/openai
    opentelemetry: TESTPATH=tests/integrations/opentelemetry
    pure_eval: TESTPATH=tests/integrations/pure_eval
    pymongo: TESTPATH=tests/integrations/pymongo
    pyramid: TESTPATH=tests/integrations/pyramid
    quart: TESTPATH=tests/integrations/quart
    redis: TESTPATH=tests/integrations/redis
    rediscluster: TESTPATH=tests/integrations/rediscluster
    requests: TESTPATH=tests/integrations/requests
    rq: TESTPATH=tests/integrations/rq
    sanic: TESTPATH=tests/integrations/sanic
    starlette: TESTPATH=tests/integrations/starlette
    starlite: TESTPATH=tests/integrations/starlite
    sqlalchemy: TESTPATH=tests/integrations/sqlalchemy
    strawberry: TESTPATH=tests/integrations/strawberry
    tornado: TESTPATH=tests/integrations/tornado
    trytond: TESTPATH=tests/integrations/trytond
    socket: TESTPATH=tests/integrations/socket
    grpc: TESTPATH=tests/integrations/grpc

    COVERAGE_FILE=.coverage-{envname}
passenv =
    SENTRY_PYTHON_TEST_AWS_ACCESS_KEY_ID
    SENTRY_PYTHON_TEST_AWS_SECRET_ACCESS_KEY
    SENTRY_PYTHON_TEST_POSTGRES_USER
    SENTRY_PYTHON_TEST_POSTGRES_PASSWORD
    SENTRY_PYTHON_TEST_POSTGRES_NAME
    SENTRY_PYTHON_TEST_POSTGRES_HOST
usedevelop = True
extras =
    bottle: bottle
    falcon: falcon
    flask: flask
    pymongo: pymongo

basepython =
    py2.7: python2.7
    py3.5: python3.5
    py3.6: python3.6
    py3.7: python3.7
    py3.8: python3.8
    py3.9: python3.9
    py3.10: python3.10
    py3.11: python3.11
    py3.12: python3.12

    # Python version is pinned here because flake8 actually behaves differently
    # depending on which version is used. You can patch this out to point to
    # some random Python 3 binary, but then you get guaranteed mismatches with
    # CI. Other tools such as mypy and black have options that pin the Python
    # version.
    linters: python3.12

commands =
    {py3.7,py3.8}-boto3: pip install urllib3<2.0.0

    ; https://github.com/pytest-dev/pytest/issues/5532
    {py3.5,py3.6,py3.7,py3.8,py3.9}-flask-v{0.11,0.12}: pip install pytest<5
    {py3.6,py3.7,py3.8,py3.9}-flask-v{0.11}: pip install Werkzeug<2
    ; https://github.com/pallets/flask/issues/4455
    {py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{0.11,0.12,1.0,1.1}: pip install "itsdangerous>=0.24,<2.0" "markupsafe<2.0.0" "jinja2<3.1.1"
    ; https://github.com/more-itertools/more-itertools/issues/578
    py3.5-flask-v{0.11,0.12}: pip install more-itertools<8.11.0

    ; use old pytest for old Python versions:
    {py2.7,py3.5}: pip install pytest-forked==1.1.3

    ; Running `py.test` as an executable suffers from an import error
    ; when loading tests in scenarios. In particular, django fails to
    ; load the settings from the test module.
    {py2.7}: python -m pytest --ignore-glob='*py3.py' -rsx -s --durations=5 -vvv {env:TESTPATH} {posargs}
    {py3.5,py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12}: python -m pytest -rsx -s --durations=5 -vvv {env:TESTPATH} {posargs}

[testenv:linters]
commands =
    flake8 tests sentry_sdk
    black --check tests sentry_sdk
    mypy sentry_sdk
