Files
hassapi-home-assistant/tox.ini
2021-09-18 15:11:50 +01:00

73 lines
1.7 KiB
INI

[tox]
isolated_build = true
minversion = 3.22.0
envlist =
pytest
flake8
format-check
mypy
[testenv]
basepython = python3
deps =
pytest: coverage
pytest: pytest
flake8: flake8 >= 3.8.0, <4
flake8: flake8-docstrings >= 1.5.0, <2
flake8: pep8-naming >= 0.10.0, <1
flake8: flake8-colors >= 0.1.6, <1
flake8: pydocstyle == 5.0.2
mypy: mypy == 0.812
commands =
pytest: pytest --verbose
mypy: mypy --no-incremental src/hassapi --config-file mypy.ini
setenv =
HASS_URL=X
HASS_TOKEN=X
[testenv:flake8]
skip_install = true
commands =
flake8 --max-line-length 99 src/hassapi setup.py
[testenv:format]
basepython = python3
description = format source code
deps = black == 19.10b0
isort[pyproject] == 4.3.21
seed-isort-config >= 1.2.0
extras =
skip_install = true
commands =
- seed-isort-config --application-directories src,tests
black src tests setup.py
isort -rc src tests setup.py
[testenv:format-check]
basepython = python3
description = check that the source code is well formatted
deps = {[testenv:format]deps}
skip_install = {[testenv:format]skip_install}
extras = {[testenv:format]extras}
commands =
seed-isort-config --application-directories src,tests
black --diff --check src tests setup.py
isort --diff -rc --check-only src tests setup.py
[isort]
not_skip = __init__.py
multi_line_output = 3
include_trailing_comma = True
force_grid_wrap = 0
line_length = 99
known_first_party = hassapi
known_third_party = pytest,requests,setuptools
[covrage:run]
source =
src/hassapi
[coverage:report]
exclude_lines =
pragma: no cover