Not to Tox (#76582)
parent
3738135e0b
commit
4ea9926497
|
@ -9,7 +9,6 @@ docs
|
|||
.vscode
|
||||
|
||||
# Test related files
|
||||
.tox
|
||||
tests
|
||||
|
||||
# Other virtualization methods
|
||||
|
|
|
@ -58,7 +58,6 @@ pip-log.txt
|
|||
|
||||
# Unit test / coverage reports
|
||||
.coverage
|
||||
.tox
|
||||
coverage.xml
|
||||
nosetests.xml
|
||||
htmlcov/
|
||||
|
|
|
@ -8,4 +8,4 @@ cd "$(dirname "$0")/.."
|
|||
|
||||
echo "Installing development dependencies..."
|
||||
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 '================================================='
|
||||
if [ -z "$files" ] ; then
|
||||
echo "No python file changed. Rather use: tox -e lint\n"
|
||||
echo "No python file changed.\n"
|
||||
exit
|
||||
fi
|
||||
printf "%s\n" $files
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#!/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
|
||||
from collections import namedtuple
|
||||
|
@ -214,7 +214,7 @@ async def main():
|
|||
|
||||
print("=============================")
|
||||
if not test_files:
|
||||
print("No test files identified, ideally you should run tox")
|
||||
print("No test files identified")
|
||||
return
|
||||
|
||||
code, _ = await async_exec(
|
||||
|
@ -223,7 +223,7 @@ async def main():
|
|||
print("=============================")
|
||||
|
||||
if code == 0:
|
||||
printc(PASS, "Yay! This will most likely pass tox")
|
||||
printc(PASS, "Yay! This will most likely pass CI")
|
||||
else:
|
||||
printc(FAIL, "Tests not passing")
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
url = https://www.home-assistant.io/
|
||||
|
||||
[flake8]
|
||||
exclude = .venv,.git,.tox,docs,venv,bin,lib,deps,build
|
||||
exclude = .venv,.git,docs,venv,bin,lib,deps,build
|
||||
max-complexity = 25
|
||||
doctests = True
|
||||
# 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