From 4ea992649709bef7654447bf7eace7e91245fe48 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 23 Nov 2022 14:40:37 +0100 Subject: [PATCH] Not to Tox (#76582) --- .dockerignore | 1 - .gitignore | 1 - script/bootstrap | 2 +- script/lint | 2 +- script/{lazytox.py => lint_and_test.py} | 8 ++--- setup.cfg | 2 +- tox.ini | 48 ------------------------- 7 files changed, 7 insertions(+), 57 deletions(-) rename script/{lazytox.py => lint_and_test.py} (96%) delete mode 100644 tox.ini diff --git a/.dockerignore b/.dockerignore index 8144367ede1..7fde7f33fa5 100644 --- a/.dockerignore +++ b/.dockerignore @@ -9,7 +9,6 @@ docs .vscode # Test related files -.tox tests # Other virtualization methods diff --git a/.gitignore b/.gitignore index d6f7198fcd4..2e3df400c76 100644 --- a/.gitignore +++ b/.gitignore @@ -58,7 +58,6 @@ pip-log.txt # Unit test / coverage reports .coverage -.tox coverage.xml nosetests.xml htmlcov/ diff --git a/script/bootstrap b/script/bootstrap index 5040a322b62..68f02961d27 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -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 diff --git a/script/lint b/script/lint index e4bf74cf602..378c8c68d39 100755 --- a/script/lint +++ b/script/lint @@ -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 diff --git a/script/lazytox.py b/script/lint_and_test.py similarity index 96% rename from script/lazytox.py rename to script/lint_and_test.py index 1f2f4cf02b0..97108e1c630 100755 --- a/script/lazytox.py +++ b/script/lint_and_test.py @@ -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") diff --git a/setup.cfg b/setup.cfg index b1a2172f8f1..709b9e4286a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 diff --git a/tox.ini b/tox.ini deleted file mode 100644 index cbc98968177..00000000000 --- a/tox.ini +++ /dev/null @@ -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