[tox]
envlist = security,flake8,pylint,docs,py36,py37,py38,py39,pypy3

[testenv]
usedevelop = True
deps =
    -r{toxinidir}/tests/requirements.txt
commands = py.test --cov=parsel --cov-report=xml {posargs:docs parsel tests}

[testenv:security]
deps =
    bandit
commands =
    bandit -r -c .bandit.yml {posargs:parsel}

[testenv:flake8]
deps =
    {[testenv]deps}
    pytest-flake8
commands =
    pytest --flake8

[testenv:pylint]
deps =
    {[testenv]deps}
    pylint
commands =
    pylint docs parsel setup.py tests

[docs]
changedir = docs
deps = -rdocs/requirements.txt

[testenv:docs]
changedir = {[docs]changedir}
deps = {[docs]deps}
# No -W in LaTeX, because ReadTheDocs does not use it either, and there are
# image conversion warnings that cannot be addressed in ReadTheDocs
commands =
    sphinx-build -W -b html . {envtmpdir}/html
    sphinx-build -b latex . {envtmpdir}/html
    sphinx-build -W -b epub . {envtmpdir}/html

[tox]
envlist = security,flake8,pylint,docs,py36,py37,py38,py39,pypy3

[testenv]
usedevelop = True
deps =
    -r{toxinidir}/tests/requirements.txt
commands = py.test --cov=parsel --cov-report=xml {posargs:docs parsel tests}

[testenv:security]
deps =
    bandit
commands =
    bandit -r -c .bandit.yml {posargs:parsel}

[testenv:flake8]
deps =
    {[testenv]deps}
    pytest-flake8
commands =
    pytest --flake8

[testenv:pylint]
deps =
    {[testenv]deps}
    pylint
commands =
    pylint docs parsel setup.py tests

[docs]
changedir = docs
deps = -rdocs/requirements.txt

[testenv:docs]
changedir = {[docs]changedir}
deps = {[docs]deps}
# No -W in LaTeX, because ReadTheDocs does not use it either, and there are
# image conversion warnings that cannot be addressed in ReadTheDocs
commands =
    sphinx-build -W -b html . {envtmpdir}/html
    sphinx-build -b latex . {envtmpdir}/latex
    sphinx-build -W -b epub . {envtmpdir}/epub

Fix documentation build output folders
Fix documentation build output folders
