[tox]
envlist = py, pre-commit, docs

[testenv]
deps =
    flake8
    pytest
    responses
commands =
    {envpython} -m pytest --strict-markers {posargs:tests/}

[testenv:pre-commit]
skip_install = true
deps = pre-commit
commands =
    pre-commit run --all-files --show-diff-on-failure

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

[pytest]
markers =
    regenerate_rendered_specs

[flake8]
# The following are ignored since they conflict with black
#
# E123 closing bracket does not match indentation of opening bracket's line
# E241 multiple spaces after ':'
# E226 missing whitespace around arithmetic operator
# W503 line break before binary operator
#
# The following are ignored since we disagree with them
#
# F541 f-string is missing placeholders
ignore = E123, E241, E226, W503, F541
max-line-length = 99
