[tox]
envlist = {py36,py37,py38,py39,pypy3}-{test, perf}, cvrg, pep8, doc
isolated_build = True
#recreate=true

[testenv]
deps =
    pytest
    pytest-benchmark
commands =
    test: pytest {posargs} test/func
    perf: pytest {posargs} test/perf
setenv =
    test: DEBUG=1
    perf: DEBUG=0

[testenv:cvrg]
deps =
    pytest
    pytest-cov
setenv =
    DECIMALFP_FORCE_PYTHON_IMPL=True
commands =
    pytest --cov=decimalfp --cov-report term-missing test/func

[testenv:pep8]
deps =
    flake8
    flake8-import-order
    flake8-blind-except
    flake8-builtins
    flake8-docstrings
    flake8-logging-format
    pep8-naming
commands =
    flake8 src/ test/

[flake8]
exclude =
    src/*.egg-info
    .eggs/
    .tox/
    conf.py
    conftest.py
    setup.py
ignore = D107,D211,D400,D403,E251,E265,E266,E402,E731,W504
per-file-ignores =
    test_*.py:D101,D103
show-source = true
enable-extensions=G
import-order-style = appnexus
application-package-names = decimalfp
max-complexity = 13

[testenv:doc]
whitelist_externals = make
deps =
    sphinx
    sphinxcontrib-napoleon
    sphinx_py3doc_enhanced_theme
commands =
    make -C doc clean
    make -C doc html
