[tox]
envlist = py27, py33, py34, py35, py36, pypy, lint, packaging, docs

[testenv]
deps= -r{toxinidir}/test_requirements.txt
commands=
    coverage run -m py.test {posargs} {toxinidir}/test/
    coverage report

[testenv:pypy]
# temporarily disable coverage testing on PyPy due to performance problems
commands= py.test {posargs} {toxinidir}/test/

[testenv:py27-twistedMaster]
# This is a validation test that confirms that Twisted's test cases haven't
# broken.
deps =
    # [tls,http2] syntax doesn't work here so we enumerate all dependencies.
    git+https://github.com/twisted/twisted
    pyopenssl
    service_identity
    idna
    priority
    sphinx
commands = python -m twisted.trial --reporter=text twisted

[testenv:lint]
basepython=python3.4
deps = flake8==3.3.0
commands = flake8 --max-complexity 10 h2 test

[testenv:docs]
basepython=python3.5
deps = sphinx==1.4.9
changedir = {toxinidir}/docs
whitelist_externals = rm
commands =
    rm -rf build
    sphinx-build -nW -b html -d build/doctrees source build/html

[testenv:graphs]
basepython=python2.7
deps = graphviz==0.6
commands =
    python visualizer/visualize.py -i docs/source/_static

[testenv:packaging]
basepython=python2.7
deps =
    check-manifest==0.35
    readme_renderer==17.2
commands =
    check-manifest
    python setup.py check --metadata --restructuredtext --strict
