[tox]
isolated_build = True
envlist = clean,py38,report

[gh-actions]
python =
  3.8: clean,py38,report

[pytest]
;addopts =
;  --durations=5
;  --flake8
addopts =
  --durations=5
  --cov --cov-append --cov-fail-under=80 --cov-report=
  --flake8
norecursedirs =
  docs

[coverage:paths]
source =
  src
  .tox/py*/lib/python*/site-packages

[coverage:run]
branch = true
parallel = true
source = pyprocessors_afp_entities

[coverage:report]
show_missing = true
precision = 2

[coverage:xml]
output = .coverage.xml

[testenv]
deps = .[test]
commands = pytest --junit-xml={env:TEST_REPORT_DIR:.}/{env:TEST_REPORT_FILE:results.xml}
passenv = *
depends =
  py38: clean
  report: py38

[testenv:report]
deps = coverage
skip_install = true
commands =
    coverage report
    coverage xml

[testenv:clean]
deps = coverage
skip_install = true
commands = coverage erase

[testenv:docs]
changedir=docs
deps = .[docs]
commands = sphinx-build . _build

[flake8]
max-line-length = 100
ignore =
  E203,
  E266,
  E501,
  W503,
per-file-ignores =
  __init__.py: F401
max-complexity = 18
select = B, C, E, F, W, T4, B9
exclude =
  .git,
  .tox,
  __pycache__,
  dist,
