From ff50033bc4f1da4be0a174ac622ba4f0b8ca18cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85ke=20Strandberg?= Date: Wed, 30 Oct 2024 14:08:26 +0000 Subject: [PATCH] Update development environment --- .devcontainer.json | 10 ++++++++-- .pre-commit-config.yaml | 4 ++-- requirements.txt | 2 +- scripts/develop | 1 + scripts/setup | 5 ++++- tests/conftest.py | 2 +- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.devcontainer.json b/.devcontainer.json index b8aac2f..b3826f4 100644 --- a/.devcontainer.json +++ b/.devcontainer.json @@ -2,7 +2,9 @@ "name": "astrandb/dev-viva", "image": "mcr.microsoft.com/devcontainers/python:1-3.12", "postCreateCommand": "scripts/setup", - "appPort": ["9124:8123"], + "appPort": [ + "9124:8123" + ], "portsAttributes": { "8123": { "label": "Home Assistant internal", @@ -41,7 +43,11 @@ "files.trimTrailingWhitespace": false }, "i18nJsonEditor.forceKeyUPPERCASE": false, - "i18nJsonEditor.supportedFolders": ["translations", "i18n"] + "i18nJsonEditor.supportedFolders": [ + "translations", + "i18n" + ], + "terminal.integrated.defaultProfile.linux": "zsh" } } }, diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8d8aac4..b429835 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.1 + rev: v0.7.1 hooks: - id: ruff args: @@ -8,7 +8,7 @@ repos: - id: ruff-format files: ^((homeassistant|custom_components|pylint|script|tests)/.+)?[^/]+\.py$ - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v5.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer diff --git a/requirements.txt b/requirements.txt index 5e6ed0d..e942b84 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ colorlog==6.8.2 homeassistant pip>=21.0,<24.1 -ruff==0.4.1 +ruff==0.7.1 pre-commit==3.7.1 bumpver==2023.1129 urllib3>=1.26.5,<2 diff --git a/scripts/develop b/scripts/develop index ea3c228..4d11716 100755 --- a/scripts/develop +++ b/scripts/develop @@ -15,6 +15,7 @@ logger: default: info logs: homeassistant.components.viva: debug +isal: " >> config/configuration.yaml fi if ! grep -R "debugpy:" config/configuration.yaml >> /dev/null;then diff --git a/scripts/setup b/scripts/setup index 68a65c0..5af3156 100755 --- a/scripts/setup +++ b/scripts/setup @@ -3,6 +3,9 @@ set -e cd "$(dirname "$0")/.." - +sudo apt-get update +sudo apt-get install -y --no-install-recommends \ + libpcap-dev \ + libturbojpeg0 python3 -m pip install --requirement requirements.txt pre-commit install diff --git a/tests/conftest.py b/tests/conftest.py index 375e73e..dabee4e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,7 +10,7 @@ @pytest.fixture(autouse=True) def auto_enable_custom_integrations(enable_custom_integrations): """Enable custom integrations defined in the test dir.""" - yield + return @pytest.fixture(name="bypass_get_data")