mirror of https://github.com/home-assistant/core
Not to Tox (#76582)
This commit is contained in:
parent
3738135e0b
commit
4ea9926497
|
@ -9,7 +9,6 @@ docs
|
||||||
.vscode
|
.vscode
|
||||||
|
|
||||||
# Test related files
|
# Test related files
|
||||||
.tox
|
|
||||||
tests
|
tests
|
||||||
|
|
||||||
# Other virtualization methods
|
# Other virtualization methods
|
||||||
|
|
|
@ -58,7 +58,6 @@ pip-log.txt
|
||||||
|
|
||||||
# Unit test / coverage reports
|
# Unit test / coverage reports
|
||||||
.coverage
|
.coverage
|
||||||
.tox
|
|
||||||
coverage.xml
|
coverage.xml
|
||||||
nosetests.xml
|
nosetests.xml
|
||||||
htmlcov/
|
htmlcov/
|
||||||
|
|
|
@ -8,4 +8,4 @@ cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
echo "Installing development dependencies..."
|
echo "Installing development dependencies..."
|
||||||
python3 -m pip install wheel --constraint homeassistant/package_constraints.txt
|
python3 -m pip install wheel --constraint homeassistant/package_constraints.txt
|
||||||
python3 -m pip install tox tox-pip-version colorlog pre-commit $(grep mypy requirements_test.txt) $(grep stdlib-list requirements_test.txt) $(grep tqdm requirements_test.txt) $(grep pipdeptree requirements_test.txt) $(grep awesomeversion requirements.txt) --constraint homeassistant/package_constraints.txt --use-deprecated=legacy-resolver
|
python3 -m pip install colorlog pre-commit $(grep mypy requirements_test.txt) $(grep stdlib-list requirements_test.txt) $(grep tqdm requirements_test.txt) $(grep pipdeptree requirements_test.txt) $(grep awesomeversion requirements.txt) --constraint homeassistant/package_constraints.txt --use-deprecated=legacy-resolver
|
||||||
|
|
|
@ -8,7 +8,7 @@ echo '================================================='
|
||||||
echo '= FILES CHANGED ='
|
echo '= FILES CHANGED ='
|
||||||
echo '================================================='
|
echo '================================================='
|
||||||
if [ -z "$files" ] ; then
|
if [ -z "$files" ] ; then
|
||||||
echo "No python file changed. Rather use: tox -e lint\n"
|
echo "No python file changed.\n"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
printf "%s\n" $files
|
printf "%s\n" $files
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""
|
"""
|
||||||
Lazy 'tox' to quickly check if branch is up to PR standards.
|
Quickly check if branch is up to PR standards.
|
||||||
|
|
||||||
This is NOT a tox replacement, only a quick check during development.
|
This is NOT a full CI/linting replacement, only a quick check during development.
|
||||||
"""
|
"""
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
@ -214,7 +214,7 @@ async def main():
|
||||||
|
|
||||||
print("=============================")
|
print("=============================")
|
||||||
if not test_files:
|
if not test_files:
|
||||||
print("No test files identified, ideally you should run tox")
|
print("No test files identified")
|
||||||
return
|
return
|
||||||
|
|
||||||
code, _ = await async_exec(
|
code, _ = await async_exec(
|
||||||
|
@ -223,7 +223,7 @@ async def main():
|
||||||
print("=============================")
|
print("=============================")
|
||||||
|
|
||||||
if code == 0:
|
if code == 0:
|
||||||
printc(PASS, "Yay! This will most likely pass tox")
|
printc(PASS, "Yay! This will most likely pass CI")
|
||||||
else:
|
else:
|
||||||
printc(FAIL, "Tests not passing")
|
printc(FAIL, "Tests not passing")
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
url = https://www.home-assistant.io/
|
url = https://www.home-assistant.io/
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
exclude = .venv,.git,.tox,docs,venv,bin,lib,deps,build
|
exclude = .venv,.git,docs,venv,bin,lib,deps,build
|
||||||
max-complexity = 25
|
max-complexity = 25
|
||||||
doctests = True
|
doctests = True
|
||||||
# To work with Black
|
# To work with Black
|
||||||
|
|
48
tox.ini
48
tox.ini
|
@ -1,48 +0,0 @@
|
||||||
[tox]
|
|
||||||
envlist = py39, lint, pylint, typing, cov
|
|
||||||
skip_missing_interpreters = True
|
|
||||||
ignore_basepython_conflict = True
|
|
||||||
isolated_build = True
|
|
||||||
|
|
||||||
[testenv]
|
|
||||||
basepython = {env:PYTHON3_PATH:python3}
|
|
||||||
# pip version duplicated in homeassistant/package_constraints.txt
|
|
||||||
pip_version = pip>=21.0,<22.4
|
|
||||||
install_command = python -m pip install --use-deprecated legacy-resolver {opts} {packages}
|
|
||||||
commands =
|
|
||||||
{envpython} -X dev -m 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 =
|
|
||||||
{envpython} -X dev -m 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_all.txt
|
|
||||||
commands =
|
|
||||||
mypy homeassistant
|
|
Loading…
Reference in New Issue