1
mirror of https://github.com/home-assistant/core synced 2024-07-30 21:18:57 +02:00
ha-core/tox.ini
Ville Skyttä 27f3c0a302
Skip install on tox pylint (#39260)
We're not operating on the installed package anyway, and necessary
dependencies are handled with tox deps.

As a nice bonus side effect, doing this sidesteps breakage caused by
pip's (up to 20.2.2 at least) behavior of prepending site-packages to
sys.path in certain cases, which in turn results in failures e.g. if a
version of typing that is incompatible with the (now overridden)
stdlib is installed there. And that combined with also pip's behavior
of installing a default build system consisting of setuptools and
wheel under the hood when it sees our pyproject.toml without a
build-system defined would provoke the breakage before we have a
chance to uninstall typing. (There are ways around this too, but
skipping the install makes the issue moot at least with our current
dependency set.)
2020-08-27 16:57:58 +02:00

44 lines
1.2 KiB
INI

[tox]
envlist = py36, py37, py38, lint, pylint, typing, cov
skip_missing_interpreters = True
[testenv]
basepython = {env:PYTHON3_PATH:python3}
commands =
pytest --timeout=9 --durations=10 -n auto --dist=loadfile -qq -o console_output_style=count -p no:sugar {posargs}
{toxinidir}/script/check_dirty
deps =
-r{toxinidir}/requirements_test_all.txt
[testenv:cov]
commands =
pytest --timeout=9 --durations=10 -n auto --dist=loadfile -qq -o console_output_style=count -p no:sugar --cov --cov-report= {posargs}
{toxinidir}/script/check_dirty
deps =
-r{toxinidir}/requirements_test_all.txt
[testenv:pylint]
skip_install = True
ignore_errors = True
deps =
-r{toxinidir}/requirements_all.txt
-r{toxinidir}/requirements_test.txt
commands =
pylint {env:PYLINT_ARGS:} {posargs} homeassistant
[testenv:lint]
deps =
-r{toxinidir}/requirements_test.txt
commands =
python -m script.gen_requirements_all validate
python -m script.hassfest --action validate
pre-commit run codespell {posargs: --all-files}
pre-commit run flake8 {posargs: --all-files}
pre-commit run bandit {posargs: --all-files}
[testenv:typing]
deps =
-r{toxinidir}/requirements_test.txt
commands =
pre-commit run mypy {posargs: --all-files}