mirror of
https://github.com/home-assistant/core.git
synced 2026-09-16 05:29:11 +01:00
Ban voluptuous imports in favour of probatio (#182120)
This commit is contained in:
@@ -848,6 +848,7 @@ mark-parentheses = false
|
||||
"async_timeout".msg = "use asyncio.timeout instead"
|
||||
"pytz".msg = "use zoneinfo instead"
|
||||
"tests".msg = "You should not import tests"
|
||||
"voluptuous".msg = "use probatio instead"
|
||||
"__future__.annotations".msg = "It should not be needed because Home Assistant requires Python 3.14+"
|
||||
|
||||
[tool.ruff.lint.isort]
|
||||
|
||||
@@ -9,3 +9,4 @@ forced-separate = [
|
||||
[lint.flake8-tidy-imports.banned-api]
|
||||
"async_timeout".msg = "use asyncio.timeout instead"
|
||||
"pytz".msg = "use zoneinfo instead"
|
||||
"voluptuous".msg = "use probatio instead"
|
||||
|
||||
@@ -14,8 +14,8 @@ import mcp.client.session
|
||||
import mcp.client.sse
|
||||
import mcp.client.streamable_http
|
||||
from mcp.shared.exceptions import McpError
|
||||
import probatio
|
||||
import pytest
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.conversation import DOMAIN as CONVERSATION_DOMAIN
|
||||
from homeassistant.components.homeassistant.exposed_entities import async_expose_entity
|
||||
@@ -87,7 +87,7 @@ class _StubTool(llm.Tool):
|
||||
|
||||
name = "test_tool"
|
||||
|
||||
def __init__(self, parameters: vol.Schema) -> None:
|
||||
def __init__(self, parameters: probatio.Schema) -> None:
|
||||
"""Initialize the stub tool."""
|
||||
self.parameters = parameters
|
||||
|
||||
@@ -638,12 +638,14 @@ async def test_mcp_tools_list(
|
||||
("parameters", "expected_required"),
|
||||
[
|
||||
pytest.param(
|
||||
vol.Schema({vol.Required("name"): str, vol.Optional("area"): str}),
|
||||
probatio.Schema(
|
||||
{probatio.Required("name"): str, probatio.Optional("area"): str}
|
||||
),
|
||||
["name"],
|
||||
id="required-and-optional",
|
||||
),
|
||||
pytest.param(
|
||||
vol.Schema({vol.Optional("area"): str}),
|
||||
probatio.Schema({probatio.Optional("area"): str}),
|
||||
None,
|
||||
id="optional-only",
|
||||
),
|
||||
@@ -655,7 +657,7 @@ async def test_mcp_tools_list_required_parameters(
|
||||
mcp_url: str,
|
||||
mcp_client: MCPClientFactory,
|
||||
hass_supervisor_access_token: str,
|
||||
parameters: vol.Schema,
|
||||
parameters: probatio.Schema,
|
||||
expected_required: list[str] | None,
|
||||
) -> None:
|
||||
"""Test the tools list advertises the required tool parameters."""
|
||||
|
||||
@@ -16,6 +16,7 @@ extend-ignore = [
|
||||
[lint.flake8-tidy-imports.banned-api]
|
||||
"async_timeout".msg = "use asyncio.timeout instead"
|
||||
"pytz".msg = "use zoneinfo instead"
|
||||
"voluptuous".msg = "use probatio instead"
|
||||
"syrupy.SnapshotAssertion".msg = "use syrupy.assertion.SnapshotAssertion instead"
|
||||
|
||||
[lint.isort]
|
||||
|
||||
Reference in New Issue
Block a user