mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
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:
parent
ae8709be21
commit
dcc63a6f2e
@ -1,6 +1,6 @@
|
|||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
rev: v0.9.10
|
rev: v0.10.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args:
|
args:
|
||||||
|
@ -369,7 +369,7 @@ class EnumWithDeprecatedMembers(EnumType):
|
|||||||
"""Enum with deprecated members."""
|
"""Enum with deprecated members."""
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
mcs, # noqa: N804 ruff bug, ruff does not understand this is a metaclass
|
mcs,
|
||||||
cls: str,
|
cls: str,
|
||||||
bases: tuple[type, ...],
|
bases: tuple[type, ...],
|
||||||
classdict: _EnumDict,
|
classdict: _EnumDict,
|
||||||
|
@ -281,7 +281,7 @@ class CachedProperties(type):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
mcs, # noqa: N804 ruff bug, ruff does not understand this is a metaclass
|
mcs,
|
||||||
name: str,
|
name: str,
|
||||||
bases: tuple[type, ...],
|
bases: tuple[type, ...],
|
||||||
namespace: dict[Any, Any],
|
namespace: dict[Any, Any],
|
||||||
|
@ -63,7 +63,7 @@ class FrozenOrThawed(type):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
mcs, # noqa: N804 ruff bug, ruff does not understand this is a metaclass
|
mcs,
|
||||||
name: str,
|
name: str,
|
||||||
bases: tuple[type, ...],
|
bases: tuple[type, ...],
|
||||||
namespace: dict[Any, Any],
|
namespace: dict[Any, Any],
|
||||||
|
@ -700,7 +700,7 @@ exclude_lines = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
required-version = ">=0.9.1"
|
required-version = ">=0.10.0"
|
||||||
|
|
||||||
[tool.ruff.lint]
|
[tool.ruff.lint]
|
||||||
select = [
|
select = [
|
||||||
@ -784,7 +784,6 @@ select = [
|
|||||||
"S317", # suspicious-xml-sax-usage
|
"S317", # suspicious-xml-sax-usage
|
||||||
"S318", # suspicious-xml-mini-dom-usage
|
"S318", # suspicious-xml-mini-dom-usage
|
||||||
"S319", # suspicious-xml-pull-dom-usage
|
"S319", # suspicious-xml-pull-dom-usage
|
||||||
"S320", # suspicious-xmle-tree-usage
|
|
||||||
"S601", # paramiko-call
|
"S601", # paramiko-call
|
||||||
"S602", # subprocess-popen-with-shell-equals-true
|
"S602", # subprocess-popen-with-shell-equals-true
|
||||||
"S604", # call-with-shell-equals-true
|
"S604", # call-with-shell-equals-true
|
||||||
@ -836,6 +835,8 @@ ignore = [
|
|||||||
"TC001", # Move application import {} into a type-checking block
|
"TC001", # Move application import {} into a type-checking block
|
||||||
"TC002", # Move third-party 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
|
"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
|
"TRY003", # Avoid specifying long messages outside the exception class
|
||||||
"TRY400", # Use `logging.exception` instead of `logging.error`
|
"TRY400", # Use `logging.exception` instead of `logging.error`
|
||||||
@ -854,7 +855,9 @@ ignore = [
|
|||||||
"COM819",
|
"COM819",
|
||||||
|
|
||||||
# Disabled because ruff does not understand type of __all__ generated by a function
|
# 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]
|
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
|
||||||
|
2
requirements_test_pre_commit.txt
generated
2
requirements_test_pre_commit.txt
generated
@ -1,5 +1,5 @@
|
|||||||
# Automatically generated from .pre-commit-config.yaml by gen_requirements_all.py, do not edit
|
# Automatically generated from .pre-commit-config.yaml by gen_requirements_all.py, do not edit
|
||||||
|
|
||||||
codespell==2.4.1
|
codespell==2.4.1
|
||||||
ruff==0.9.10
|
ruff==0.10.0
|
||||||
yamllint==1.35.1
|
yamllint==1.35.1
|
||||||
|
2
script/hassfest/docker/Dockerfile
generated
2
script/hassfest/docker/Dockerfile
generated
@ -24,7 +24,7 @@ RUN --mount=from=ghcr.io/astral-sh/uv:0.6.1,source=/uv,target=/bin/uv \
|
|||||||
--no-cache \
|
--no-cache \
|
||||||
-c /usr/src/homeassistant/homeassistant/package_constraints.txt \
|
-c /usr/src/homeassistant/homeassistant/package_constraints.txt \
|
||||||
-r /usr/src/homeassistant/requirements.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
|
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"
|
LABEL "name"="hassfest"
|
||||||
|
@ -591,7 +591,7 @@ async def test_add_delta_content_stream_errors(
|
|||||||
async_get_chat_log(hass, session, mock_conversation_input) as chat_log,
|
async_get_chat_log(hass, session, mock_conversation_input) as chat_log,
|
||||||
):
|
):
|
||||||
# Stream content without LLM API set
|
# 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(
|
async for _tool_result_content in chat_log.async_add_delta_content_stream(
|
||||||
"mock-agent-id",
|
"mock-agent-id",
|
||||||
stream(
|
stream(
|
||||||
@ -613,7 +613,7 @@ async def test_add_delta_content_stream_errors(
|
|||||||
|
|
||||||
# Non assistant role
|
# Non assistant role
|
||||||
for role in "system", "user":
|
for role in "system", "user":
|
||||||
with pytest.raises(ValueError): # noqa: PT012
|
with pytest.raises(ValueError):
|
||||||
async for (
|
async for (
|
||||||
_tool_result_content
|
_tool_result_content
|
||||||
) in chat_log.async_add_delta_content_stream(
|
) in chat_log.async_add_delta_content_stream(
|
||||||
|
@ -1772,7 +1772,7 @@ async def test_async_convert_audio_error(hass: HomeAssistant) -> None:
|
|||||||
async def bad_data_gen():
|
async def bad_data_gen():
|
||||||
yield bytes(0)
|
yield bytes(0)
|
||||||
|
|
||||||
with pytest.raises(RuntimeError): # noqa: PT012
|
with pytest.raises(RuntimeError):
|
||||||
# Simulate a bad WAV file
|
# Simulate a bad WAV file
|
||||||
async for _chunk in tts._async_convert_audio(
|
async for _chunk in tts._async_convert_audio(
|
||||||
hass, "wav", bad_data_gen(), "mp3"
|
hass, "wav", bad_data_gen(), "mp3"
|
||||||
|
@ -156,7 +156,7 @@ async def test_get_tts_audio_connection_lost(
|
|||||||
MockAsyncTcpClient([None]),
|
MockAsyncTcpClient([None]),
|
||||||
):
|
):
|
||||||
stream.async_set_message("Hello world")
|
stream.async_set_message("Hello world")
|
||||||
with pytest.raises(HomeAssistantError): # noqa: PT012
|
with pytest.raises(HomeAssistantError):
|
||||||
async for _chunk in stream.async_stream_result():
|
async for _chunk in stream.async_stream_result():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user