[tox]
envlist =
  py36
  py37
  py38
  py39
  pypy3
  black
  flake8
  isort
  mypy
  pylint

[testenv]
deps =
  pytest
  pytest-xdist
  setuptools_scm
commands =
  pytest -n auto {posargs}

[testenv:docs]
deps = sphinx
commands = sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" --color -W {posargs}

[testenv:black]
deps =
  black
commands = black --line-length 100 --check --diff pymediainfo tests

[testenv:flake8]
deps = flake8
commands = flake8 --max-line-length 100 pymediainfo tests

[testenv:isort]
deps = isort
commands = isort --check pymediainfo tests

[testenv:pylint]
# TODO: remove constraint when this is fixed: https://github.com/PyCQA/pylint/issues/3882
basepython = python3.8
deps =
  pylint
  pytest
commands = pylint pymediainfo/ tests/test_pymediainfo.py

[testenv:mypy]
deps =
  mypy
  pytest
commands =
  mypy --strict pymediainfo
  mypy tests
