# The flake8 and pep8 sections just contain configuration for corresponding tools.
# Checkers are not run implicitly.
[pycodestyle]
count = 1
exclude = *.egg*,.env,.git,.hg,.tox,_*,build*,dist*,venv*,mock.py,eventlet/green/http/*
ignore = E261,E402,E731,E741,W503
max-line-length = 123
show-source = 1
statistics = 1

[tox]
minversion=2.5
envlist =
    ipv6
    pep8
    py38-openssl
    py39-dnspython1
    pypy3-epolls
    py{38,39,310,311,312,313}-{selects,poll,epolls,asyncio}
skipsdist = True

[testenv:ipv6]
basepython = python
setenv =
    {[testenv]setenv}
    eventlet_test_ipv6 = 1
deps =
    coverage
    pytest
    pytest-cov
usedevelop = True
commands =
    pip install -e .
    pytest --verbose {env:tox_cover_args} -k "ipv6" tests/
    coverage xml -i

[testenv:pep8]
basepython = python3
setenv =
    {[testenv]setenv}
deps =
    pycodestyle==2.1.0
usedevelop = False
commands =
    pycodestyle benchmarks/ eventlet/ tests/

[testenv:lint]
basepython = python3
setenv =
    {[testenv]setenv}
deps =
    ruff==0.1.13
commands =
    ruff eventlet/ tests/

[testenv]
passenv =
    CI
    EVENTLET_DB_TEST_AUTH
setenv =
    PYTHONDONTWRITEBYTECODE = 1
    selects: EVENTLET_HUB = selects
    poll: EVENTLET_HUB = poll
    epolls: EVENTLET_HUB = epolls
    asyncio: EVENTLET_HUB = asyncio
    kqueue: EVENTLET_HUB = kqueue
    tox_cover_args = --cov=eventlet
deps =
    coverage
    pytest
    pytest-cov
    py38-openssl: pyopenssl==22.1.0
    pypy3: psycopg2cffi-compat==1.1
    py{38,39}-{selects,poll,epolls}: pyzmq==21.0.2
    py{38,39,310,311}: mysqlclient==2.0.3
    py{38,39}: psycopg2-binary==2.8.4
    py{310,311}: psycopg2-binary==2.9.5
    py{310,311}: pyzmq==25.0.0
    dnspython1: dnspython<2
    asyncio: aiohttp
usedevelop = True
commands =
    pip install -e .
    pytest --verbose {env:tox_cover_args} {posargs:tests/}
    coverage xml -i

[testenv:docs]
allowlist_externals = rm
deps =
  -r{toxinidir}/doc/requirements.txt
commands =
  pip install -e .
  rm -fr doc/build
  sphinx-build -b html doc/source doc/build/html
