From f907ac4d2308e03db2e1e61a2761dc559e861b2b Mon Sep 17 00:00:00 2001 From: autinerd <27780930+autinerd@users.noreply.github.com> Date: Thu, 15 Aug 2024 18:20:59 +0200 Subject: [PATCH 1/2] Bump ruff to 0.6.0 --- .pre-commit-config.yaml | 2 +- homeassistant/components/environment_canada/config_flow.py | 4 ++-- homeassistant/components/environment_canada/coordinator.py | 4 ++-- pyproject.toml | 2 +- requirements_test_pre_commit.txt | 2 +- tests/components/environment_canada/test_config_flow.py | 4 ++-- tests/components/lg_netcast/__init__.py | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f057931e2a830d..4c3ce7fe104b06 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.5.7 + rev: v0.6.0 hooks: - id: ruff args: diff --git a/homeassistant/components/environment_canada/config_flow.py b/homeassistant/components/environment_canada/config_flow.py index a351bb0ef06643..79b37c64c1bc97 100644 --- a/homeassistant/components/environment_canada/config_flow.py +++ b/homeassistant/components/environment_canada/config_flow.py @@ -1,7 +1,7 @@ """Config flow for Environment Canada integration.""" import logging -import xml.etree.ElementTree as et +import xml.etree.ElementTree as ET import aiohttp from env_canada import ECWeather, ec_exc @@ -52,7 +52,7 @@ async def async_step_user(self, user_input=None): if user_input is not None: try: info = await validate_input(user_input) - except (et.ParseError, vol.MultipleInvalid, ec_exc.UnknownStationId): + except (ET.ParseError, vol.MultipleInvalid, ec_exc.UnknownStationId): errors["base"] = "bad_station_id" except aiohttp.ClientConnectionError: errors["base"] = "cannot_connect" diff --git a/homeassistant/components/environment_canada/coordinator.py b/homeassistant/components/environment_canada/coordinator.py index e17c360e3fb732..8e77b309c787d3 100644 --- a/homeassistant/components/environment_canada/coordinator.py +++ b/homeassistant/components/environment_canada/coordinator.py @@ -1,7 +1,7 @@ """Coordinator for the Environment Canada (EC) component.""" import logging -import xml.etree.ElementTree as et +import xml.etree.ElementTree as ET from env_canada import ec_exc @@ -27,6 +27,6 @@ async def _async_update_data(self): """Fetch data from EC.""" try: await self.ec_data.update() - except (et.ParseError, ec_exc.UnknownStationId) as ex: + except (ET.ParseError, ec_exc.UnknownStationId) as ex: raise UpdateFailed(f"Error fetching {self.name} data: {ex}") from ex return self.ec_data diff --git a/pyproject.toml b/pyproject.toml index 5f6324bbac5bfc..028f8939e1448e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -687,7 +687,7 @@ exclude_lines = [ ] [tool.ruff] -required-version = ">=0.5.3" +required-version = ">=0.6.0" [tool.ruff.lint] select = [ diff --git a/requirements_test_pre_commit.txt b/requirements_test_pre_commit.txt index ba54a19da3ee0b..091f872d511dd4 100644 --- a/requirements_test_pre_commit.txt +++ b/requirements_test_pre_commit.txt @@ -1,5 +1,5 @@ # Automatically generated from .pre-commit-config.yaml by gen_requirements_all.py, do not edit codespell==2.3.0 -ruff==0.5.7 +ruff==0.6.0 yamllint==1.35.1 diff --git a/tests/components/environment_canada/test_config_flow.py b/tests/components/environment_canada/test_config_flow.py index f2c35ab429533b..d61966e8da1f06 100644 --- a/tests/components/environment_canada/test_config_flow.py +++ b/tests/components/environment_canada/test_config_flow.py @@ -1,7 +1,7 @@ """Test the Environment Canada (EC) config flow.""" from unittest.mock import AsyncMock, MagicMock, Mock, patch -import xml.etree.ElementTree as et +import xml.etree.ElementTree as ET import aiohttp import pytest @@ -94,7 +94,7 @@ async def test_create_same_entry_twice(hass: HomeAssistant) -> None: (aiohttp.ClientResponseError(Mock(), (), status=404), "bad_station_id"), (aiohttp.ClientResponseError(Mock(), (), status=400), "error_response"), (aiohttp.ClientConnectionError, "cannot_connect"), - (et.ParseError, "bad_station_id"), + (ET.ParseError, "bad_station_id"), (ValueError, "unknown"), ], ) diff --git a/tests/components/lg_netcast/__init__.py b/tests/components/lg_netcast/__init__.py index ce3e09aeb6556a..931ccad106a8b5 100644 --- a/tests/components/lg_netcast/__init__.py +++ b/tests/components/lg_netcast/__init__.py @@ -1,7 +1,7 @@ """Tests for LG Netcast TV.""" from unittest.mock import patch -from xml.etree import ElementTree +from xml.etree import ElementTree as ET from pylgnetcast import AccessTokenError, LgNetCastClient, SessionIdError import requests @@ -56,7 +56,7 @@ def _get_fake_query_device_info(): if always_404: return None if invalid_details: - raise ElementTree.ParseError("Mocked Parsed Error") + raise ET.ParseError("Mocked Parsed Error") return { "uuid": UNIQUE_ID if not no_unique_id else None, "model_name": MODEL_NAME, From c30517638567d863bb44725c2b19e23b9d043fe4 Mon Sep 17 00:00:00 2001 From: autinerd <27780930+autinerd@users.noreply.github.com> Date: Mon, 19 Aug 2024 20:08:16 +0200 Subject: [PATCH 2/2] Bump ruff to 0.6.1 --- .pre-commit-config.yaml | 2 +- pyproject.toml | 2 +- requirements_test_pre_commit.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4c3ce7fe104b06..f29fd92a880ccd 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.6.0 + rev: v0.6.1 hooks: - id: ruff args: diff --git a/pyproject.toml b/pyproject.toml index 028f8939e1448e..5f6324bbac5bfc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -687,7 +687,7 @@ exclude_lines = [ ] [tool.ruff] -required-version = ">=0.6.0" +required-version = ">=0.5.3" [tool.ruff.lint] select = [ diff --git a/requirements_test_pre_commit.txt b/requirements_test_pre_commit.txt index 091f872d511dd4..6bd2fbbc145bba 100644 --- a/requirements_test_pre_commit.txt +++ b/requirements_test_pre_commit.txt @@ -1,5 +1,5 @@ # Automatically generated from .pre-commit-config.yaml by gen_requirements_all.py, do not edit codespell==2.3.0 -ruff==0.6.0 +ruff==0.6.1 yamllint==1.35.1