Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump ruff to 0.6.1 #124250

Merged
merged 3 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.7
rev: v0.6.1
hooks:
- id: ruff
args:
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/environment_canada/config_flow.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/environment_canada/coordinator.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
2 changes: 1 addition & 1 deletion requirements_test_pre_commit.txt
Original file line number Diff line number Diff line change
@@ -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.1
yamllint==1.35.1
4 changes: 2 additions & 2 deletions tests/components/environment_canada/test_config_flow.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"),
],
)
Expand Down
4 changes: 2 additions & 2 deletions tests/components/lg_netcast/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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,
Expand Down