[tox]
skipsdist = True
envlist = coverage,check,codecov

[testenv]

basepython = python

passenv=
    TOXENV
    CI
    CI_*
    CIRCLECI
    CIRCLE_*
    TRAVIS
    TRAVIS_*
    APPVEYOR
    APPVEYOR_*
    CODECOV_TOKEN

deps =
     -r requirements.txt
     -r dev-requirements.txt
     -e .

commands_pre =
    {envbindir}/pip install castervoice --no-deps


[testenv:doc]

deps =
     -r docs/requirements-docs.txt
commands =
         {envbindir}/pip install --no-deps -e .
         {envbindir}/sphinx-apidoc -o docs/reference -f src src/voca/plugins/vscode.py
         {envbindir}/sphinx-build -E -b html docs dist/docs

[testenv:coverage]

commands =
   {envbindir}/pytest -vv --cov=voca --cov=tests --cov-fail-under=75 {posargs}
   {envbindir}/coverage report -m
   {envbindir}/cuv graph

[testenv:check]

commands =
   ./pycli build
   {envbindir}/twine check dist/voca-*
   {envbindir}/black --check src/


[testenv:test]

commands =
    {envbindir}/pytest -vv {posargs}


[testenv:codecov]
skip_install=True
deps=
    codecov
commands=
    python -c 'import sys; print(sys.version)'
    codecov --required
