[tox]
envlist = py26,py27,pypy,py32,py33,py34,py35,pypy3,docs,pep8,py2pep8,packaging

[testenv]
passenv = *
deps =
    pretend
    scripttest
    pytest
    coverage
    nameless
    tox
commands =
    {posargs:coverage run -m pytest}
    coverage report -m

[testenv:py26]
basepython = {env:TOXPYTHON:python2.6}

[testenv:py27]
basepython = {env:TOXPYTHON:python2.7}

[testenv:py32]
basepython = {env:TOXPYTHON:python3.2}

[testenv:py33]
basepython = {env:TOXPYTHON:python3.3}

[testenv:py34]
basepython = {env:TOXPYTHON:python3.4}

[testenv:py35]
basepython = {env:TOXPYTHON:python3.5}

[testenv:pypy]
basepython = {env:TOXPYTHON:pypy}
commands =
    {posargs:py.test tests}

[testenv:pypy3]
basepython = {env:TOXPYTHON:pypy3}
commands =
    {posargs:py.test tests}

[testenv:docs]
deps =
    sphinx
    sphinx_rtd_theme
commands =
    sphinx-build -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
    sphinx-build -W -b man -d {envtmpdir}/doctrees docs docs/_build/man
    sphinx-build -W -b doctest -d {envtmpdir}/doctrees docs docs/_build/doctest

[testenv:pep8]
basepython = python3.2
deps =
    flake8
    pep8-naming
commands = flake8 .

[testenv:py2pep8]
basepython = python2.6
deps =
    flake8
    pep8-naming
commands = flake8 .

[testenv:packaging]
deps = check-manifest
commands =
    check-manifest

[flake8]
exclude = .tox,*.egg
select = E,W,F,N

[pytest]
markers =
    unit: this test is a fast running unit test
    functional: this test is a possibly slow running functional test
norecursedirs =
    .git
    .tox
    .ve*
    dist
    build
    venv
addopts =
    -rxEfs
    --strict
    --ignore docs/conf.py
    --ignore setup.py
    --tb short
    -vv
