Bump ruff to 0.10.0 (#140541)

* Bump ruff to 0.10.0

* Bump ruff to 0.10.0

* Bump ruff to 0.10.0

* Bump ruff to 0.10.0

* Update pyproject.toml

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>

* Fix

---------

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
This commit is contained in:
Joost Lekkerkerker
2025-03-14 13:32:50 +01:00
committed by GitHub
parent ae8709be21
commit dcc63a6f2e
10 changed files with 16 additions and 13 deletions

View File

@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.10
rev: v0.10.0
hooks:
- id: ruff
args:

View File

@ -369,7 +369,7 @@ class EnumWithDeprecatedMembers(EnumType):
"""Enum with deprecated members."""
def __new__(
mcs, # noqa: N804 ruff bug, ruff does not understand this is a metaclass
mcs,
cls: str,
bases: tuple[type, ...],
classdict: _EnumDict,

View File

@ -281,7 +281,7 @@ class CachedProperties(type):
"""
def __new__(
mcs, # noqa: N804 ruff bug, ruff does not understand this is a metaclass
mcs,
name: str,
bases: tuple[type, ...],
namespace: dict[Any, Any],

View File

@ -63,7 +63,7 @@ class FrozenOrThawed(type):
)
def __new__(
mcs, # noqa: N804 ruff bug, ruff does not understand this is a metaclass
mcs,
name: str,
bases: tuple[type, ...],
namespace: dict[Any, Any],

View File

@ -700,7 +700,7 @@ exclude_lines = [
]
[tool.ruff]
required-version = ">=0.9.1"
required-version = ">=0.10.0"
[tool.ruff.lint]
select = [
@ -784,7 +784,6 @@ select = [
"S317", # suspicious-xml-sax-usage
"S318", # suspicious-xml-mini-dom-usage
"S319", # suspicious-xml-pull-dom-usage
"S320", # suspicious-xmle-tree-usage
"S601", # paramiko-call
"S602", # subprocess-popen-with-shell-equals-true
"S604", # call-with-shell-equals-true
@ -836,6 +835,8 @@ ignore = [
"TC001", # Move application import {} into a type-checking block
"TC002", # Move third-party import {} into a type-checking block
"TC003", # Move standard library import {} into a type-checking block
# Quotes for typing.cast generally not necessary, only for performance critical paths
"TC006", # Add quotes to type expression in typing.cast()
"TRY003", # Avoid specifying long messages outside the exception class
"TRY400", # Use `logging.exception` instead of `logging.error`
@ -854,7 +855,9 @@ ignore = [
"COM819",
# Disabled because ruff does not understand type of __all__ generated by a function
"PLE0605"
"PLE0605",
"PLC1802", # disabled temporarily on ruff 0.10.0 update
]
[tool.ruff.lint.flake8-import-conventions.extend-aliases]

View File

@ -1,5 +1,5 @@
# Automatically generated from .pre-commit-config.yaml by gen_requirements_all.py, do not edit
codespell==2.4.1
ruff==0.9.10
ruff==0.10.0
yamllint==1.35.1

View File

@ -24,7 +24,7 @@ RUN --mount=from=ghcr.io/astral-sh/uv:0.6.1,source=/uv,target=/bin/uv \
--no-cache \
-c /usr/src/homeassistant/homeassistant/package_constraints.txt \
-r /usr/src/homeassistant/requirements.txt \
stdlib-list==0.10.0 pipdeptree==2.25.1 tqdm==4.67.1 ruff==0.9.10 \
stdlib-list==0.10.0 pipdeptree==2.25.1 tqdm==4.67.1 ruff==0.10.0 \
PyTurboJPEG==1.7.5 go2rtc-client==0.1.2 ha-ffmpeg==3.2.2 hassil==2.2.3 home-assistant-intents==2025.3.5 mutagen==1.47.0 pymicro-vad==1.0.1 pyspeex-noise==1.0.2
LABEL "name"="hassfest"

View File

@ -591,7 +591,7 @@ async def test_add_delta_content_stream_errors(
async_get_chat_log(hass, session, mock_conversation_input) as chat_log,
):
# Stream content without LLM API set
with pytest.raises(ValueError): # noqa: PT012
with pytest.raises(ValueError):
async for _tool_result_content in chat_log.async_add_delta_content_stream(
"mock-agent-id",
stream(
@ -613,7 +613,7 @@ async def test_add_delta_content_stream_errors(
# Non assistant role
for role in "system", "user":
with pytest.raises(ValueError): # noqa: PT012
with pytest.raises(ValueError):
async for (
_tool_result_content
) in chat_log.async_add_delta_content_stream(

View File

@ -1772,7 +1772,7 @@ async def test_async_convert_audio_error(hass: HomeAssistant) -> None:
async def bad_data_gen():
yield bytes(0)
with pytest.raises(RuntimeError): # noqa: PT012
with pytest.raises(RuntimeError):
# Simulate a bad WAV file
async for _chunk in tts._async_convert_audio(
hass, "wav", bad_data_gen(), "mp3"

View File

@ -156,7 +156,7 @@ async def test_get_tts_audio_connection_lost(
MockAsyncTcpClient([None]),
):
stream.async_set_message("Hello world")
with pytest.raises(HomeAssistantError): # noqa: PT012
with pytest.raises(HomeAssistantError):
async for _chunk in stream.async_stream_result():
pass