tox.ini 2.25 KB
Newer Older
1
[tox]
2
envlist = py35, py36, py37, py38, lint, pylint, typing, cov
3 4 5 6
skip_missing_interpreters = True

[testenv]
setenv =
7
    PYTHONPATH = {toxinidir}:{toxinidir}/homeassistant
8 9 10
; both temper-python and XBee modules have utf8 in their README files
; which get read in from setup.py. If we don't force our locale to a
; utf8 one, tox's env is reset. And the install of these 2 packages
11 12 13 14 15
; fail.
whitelist_externals = /usr/bin/env
install_command = /usr/bin/env LANG=C.UTF-8 pip install {opts} {packages}
commands =
     pytest --timeout=9 --duration=10 {posargs}
16
     {toxinidir}/script/check_dirty
17 18 19 20 21 22 23 24 25 26 27
deps =
     -r{toxinidir}/requirements_test_all.txt
     -c{toxinidir}/homeassistant/package_constraints.txt

[testenv:cov]
basepython = {env:PYTHON3_PATH:python3}
setenv =
    PYTHONPATH = {toxinidir}:{toxinidir}/homeassistant
; both temper-python and XBee modules have utf8 in their README files
; which get read in from setup.py. If we don't force our locale to a
; utf8 one, tox's env is reset. And the install of these 2 packages
28
; fail.
Paulus Schoutsen's avatar
Paulus Schoutsen committed
29 30
whitelist_externals = /usr/bin/env
install_command = /usr/bin/env LANG=C.UTF-8 pip install {opts} {packages}
31
commands =
32
     pytest --timeout=9 --duration=10 --cov --cov-report= {posargs}
33
     {toxinidir}/script/check_dirty
34
deps =
35
     -r{toxinidir}/requirements_test_all.txt
36
     -c{toxinidir}/homeassistant/package_constraints.txt
37

38
[testenv:pylint]
39
basepython = {env:PYTHON3_PATH:python3}
40
ignore_errors = True
41 42 43
deps =
     -r{toxinidir}/requirements_all.txt
     -r{toxinidir}/requirements_test.txt
44
     -c{toxinidir}/homeassistant/package_constraints.txt
45
commands =
46
     pylint {posargs} homeassistant
47

48
[testenv:lint]
49
basepython = {env:PYTHON3_PATH:python3}
50
deps =
51
     -r{toxinidir}/requirements_test.txt
52
commands =
53
         python script/gen_requirements_all.py validate
54 55
         flake8 {posargs}
         pydocstyle {posargs:homeassistant tests}
56 57

[testenv:typing]
58
basepython = {env:PYTHON3_PATH:python3}
59
whitelist_externals=/bin/bash
60 61
deps =
     -r{toxinidir}/requirements_test.txt
62
commands =
63
         /bin/bash -c 'mypy homeassistant/*.py homeassistant/{auth,util}/ homeassistant/helpers/{__init__,aiohttp_client,area_registry,condition,deprecation,dispatcher,entity_values,entityfilter,icon,intent,json,location,signal,state,sun,temperature,translation,typing}.py'