# Tox (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.

# configuration values consumed by other tools.
[flake8]
exclude = test, build, .tox

[coverage:run]
branch = True
source = monotable

[tox]
envlist = cover, inspect, docs

[testenv:cover]
usedevelop = True
passenv = CI TRAVIS TRAVIS_*
deps =
    pytest-cov
    coverage
    pytest
    codecov
commands =
    pytest --cov=monotable --cov-report term test/
    codecov -X gcov

[testenv:inspect]
deps =
    flake8
    pep8-naming
    mypy
    typing
    check-manifest
    twine
# "any command with a leading - will ignore the exit code."
commands =
    flake8 --exit-zero --max-complexity=10
    - mypy monotable --strict
    - mypy test/test_examples.py --strict
    check-manifest
    twine check {toxworkdir}/dist/*

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

# Tox (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.

# configuration values consumed by other tools.
[flake8]
exclude = test, build, .tox

[coverage:run]
branch = True
source = monotable

[tox]
envlist = cover, inspect, docs

[testenv:cover]
usedevelop = True
passenv = CI TRAVIS TRAVIS_*
deps =
    coverage
    pytest
    codecov
commands =
    coverage run -m pytest --strict test
    codecov -X gcov

[testenv:inspect]
deps =
    flake8
    pep8-naming
    mypy
    typing
    check-manifest
    twine
# "any command with a leading - will ignore the exit code."
commands =
    flake8 --exit-zero --max-complexity=10
    - mypy monotable --strict
    - mypy test/test_examples.py --strict
    check-manifest
    twine check {toxworkdir}/dist/*

[testenv:docs]
changedir = doc
deps = -rdoc/requirements.txt
commands=
    sphinx-build -b doctest -d {envtmpdir}/doctrees . {envtmpdir}/doctest
    sphinx-build -b html -d {envtmpdir}/doctrees . {envtmpdir}/html

Remove pytest-cov, Pin Sphinx versions to what RTD is using.
Remove pytest-cov, Pin Sphinx versions to what RTD is using.
