[tox]
envlist = py, flake8, mypy
skipsdist = True
toxworkdir={env:TOX_WORK_DIR:.tox}

[testenv]
deps =
  -e .[dev]
setenv = HOME = {envtmpdir}
commands =
  mitmdump --version
  pytest --timeout 60 -vv --cov-report xml \
    --continue-on-collection-errors \
    --cov=mitmproxy --cov=release \
    --full-cov=mitmproxy/ \
    {posargs}

[testenv:flake8]
deps =
  flake8>=3.8.4,<4
  flake8-tidy-imports>=4.2.0,<5
commands =
  flake8 --jobs 8 mitmproxy examples test release {posargs}

[testenv:filename_matching]
deps =
commands =
  python ./test/filename_matching.py

[testenv:mypy]
deps =
  mypy==0.910
  types-certifi==2020.4.0
  types-Flask==1.1.3
  types-Werkzeug==1.0.5
  types-requests==2.25.6
  types-cryptography==3.3.5
  types-pyOpenSSL==20.0.6

commands =
  mypy {posargs}
  
[testenv:individual_coverage]
commands =
  python ./test/individual_coverage.py {posargs}

[testenv:wheeltest]
recreate = True
deps =
commands =
  pip install {posargs}
  mitmproxy --version
  mitmdump --version
  mitmweb --version
