[tox]
skipsdist = true
envlist =  py{38,39}, lint, typing
skip_missing_interpreters = True
cs_exclude_words = hass,unvalid

[gh-actions]
python =
  3.8: clean, py38, lint, typing
  3.9: clean, py39, lint, typing

[testenv]
passenv = TOXENV CI
whitelist_externals =
    true
setenv =
    LANG=en_US.UTF-8
    PYTHONPATH = {toxinidir}/localtuya-homeassistant
deps =
    -r{toxinidir}/requirements_test.txt
commands =
    true # TODO: Run tests later
    #pytest -n auto --log-level=debug -v --timeout=30 --durations=10 {posargs}

[testenv:lint]
ignore_errors = True
deps =
    {[testenv]deps}
commands =
    codespell -q 4 -L {[tox]cs_exclude_words} --skip="*.pyc,*.pyi,*~,*.json" custom_components
    flake8 custom_components
    black --fast --check .
    pydocstyle -v custom_components
    pylint custom_components/localtuya --rcfile=pylint.rc

[testenv:typing]
commands =
    mypy --ignore-missing-imports --follow-imports=skip custom_components
