From 65540a3e0bca4e7b3a45674dbbc9d0d189017fa8 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Wed, 8 Oct 2025 13:24:54 +0200 Subject: [PATCH] Update mypy dev to 1.19.0a4 (#153995) --- .github/workflows/ci.yaml | 2 +- homeassistant/components/homekit/accessories.py | 6 +++--- homeassistant/components/homekit/doorbell.py | 2 +- homeassistant/components/homekit/type_air_purifiers.py | 2 +- homeassistant/components/homekit/type_cameras.py | 2 +- homeassistant/components/homekit/type_covers.py | 2 +- homeassistant/components/homekit/type_humidifiers.py | 2 +- homeassistant/components/homekit/type_triggers.py | 2 +- homeassistant/components/mcp_server/server.py | 8 ++++---- requirements_test.txt | 4 +++- 10 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 81a04bfb4c6..61f626fe22c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -741,7 +741,7 @@ jobs: - name: Generate partial mypy restore key id: generate-mypy-key run: | - mypy_version=$(cat requirements_test.txt | grep mypy | cut -d '=' -f 3) + mypy_version=$(cat requirements_test.txt | grep 'mypy.*=' | cut -d '=' -f 3) echo "version=$mypy_version" >> $GITHUB_OUTPUT echo "key=mypy-${{ env.MYPY_CACHE_VERSION }}-$mypy_version-${{ env.HA_SHORT_VERSION }}-$(date -u '+%Y-%m-%dT%H:%M:%s')" >> $GITHUB_OUTPUT diff --git a/homeassistant/components/homekit/accessories.py b/homeassistant/components/homekit/accessories.py index 681ebcbbef7..b9840fb2b68 100644 --- a/homeassistant/components/homekit/accessories.py +++ b/homeassistant/components/homekit/accessories.py @@ -456,7 +456,7 @@ class HomeAccessory(Accessory): # type: ignore[misc] return self._available @ha_callback - @pyhap_callback # type: ignore[misc] + @pyhap_callback # type: ignore[untyped-decorator] def run(self) -> None: """Handle accessory driver started event.""" if state := self.hass.states.get(self.entity_id): @@ -725,7 +725,7 @@ class HomeDriver(AccessoryDriver): # type: ignore[misc] self._entry_title = entry_title self.iid_storage = iid_storage - @pyhap_callback # type: ignore[misc] + @pyhap_callback # type: ignore[untyped-decorator] def pair( self, client_username_bytes: bytes, client_public: str, client_permissions: int ) -> bool: @@ -735,7 +735,7 @@ class HomeDriver(AccessoryDriver): # type: ignore[misc] async_dismiss_setup_message(self.hass, self.entry_id) return cast(bool, success) - @pyhap_callback # type: ignore[misc] + @pyhap_callback # type: ignore[untyped-decorator] def unpair(self, client_uuid: UUID) -> None: """Override super function to show setup message if unpaired.""" super().unpair(client_uuid) diff --git a/homeassistant/components/homekit/doorbell.py b/homeassistant/components/homekit/doorbell.py index 45bbb2ea0ca..9857cf83b36 100644 --- a/homeassistant/components/homekit/doorbell.py +++ b/homeassistant/components/homekit/doorbell.py @@ -71,7 +71,7 @@ class HomeDoorbellAccessory(HomeAccessory): self.async_update_doorbell_state(None, state) @ha_callback - @pyhap_callback # type: ignore[misc] + @pyhap_callback # type: ignore[untyped-decorator] def run(self) -> None: """Handle doorbell event.""" if self._char_doorbell_detected: diff --git a/homeassistant/components/homekit/type_air_purifiers.py b/homeassistant/components/homekit/type_air_purifiers.py index feb75f4a856..62e07d3a25b 100644 --- a/homeassistant/components/homekit/type_air_purifiers.py +++ b/homeassistant/components/homekit/type_air_purifiers.py @@ -219,7 +219,7 @@ class AirPurifier(Fan): return preset_mode.lower() != "auto" @callback - @pyhap_callback # type: ignore[misc] + @pyhap_callback # type: ignore[untyped-decorator] def run(self) -> None: """Handle accessory driver started event. diff --git a/homeassistant/components/homekit/type_cameras.py b/homeassistant/components/homekit/type_cameras.py index 0fb2c2e7922..cb5de026501 100644 --- a/homeassistant/components/homekit/type_cameras.py +++ b/homeassistant/components/homekit/type_cameras.py @@ -229,7 +229,7 @@ class Camera(HomeDoorbellAccessory, PyhapCamera): # type: ignore[misc] ) self._async_update_motion_state(None, state) - @pyhap_callback # type: ignore[misc] + @pyhap_callback # type: ignore[untyped-decorator] @callback def run(self) -> None: """Handle accessory driver started event. diff --git a/homeassistant/components/homekit/type_covers.py b/homeassistant/components/homekit/type_covers.py index 651033682cf..13b17d6f3dd 100644 --- a/homeassistant/components/homekit/type_covers.py +++ b/homeassistant/components/homekit/type_covers.py @@ -127,7 +127,7 @@ class GarageDoorOpener(HomeAccessory): self.async_update_state(state) @callback - @pyhap_callback # type: ignore[misc] + @pyhap_callback # type: ignore[untyped-decorator] def run(self) -> None: """Handle accessory driver started event. diff --git a/homeassistant/components/homekit/type_humidifiers.py b/homeassistant/components/homekit/type_humidifiers.py index a57a5e00974..2cdd031cbfa 100644 --- a/homeassistant/components/homekit/type_humidifiers.py +++ b/homeassistant/components/homekit/type_humidifiers.py @@ -178,7 +178,7 @@ class HumidifierDehumidifier(HomeAccessory): self._async_update_current_humidity(humidity_state) @callback - @pyhap_callback # type: ignore[misc] + @pyhap_callback # type: ignore[untyped-decorator] def run(self) -> None: """Handle accessory driver started event. diff --git a/homeassistant/components/homekit/type_triggers.py b/homeassistant/components/homekit/type_triggers.py index 44db65d7b0b..86b2019e97e 100644 --- a/homeassistant/components/homekit/type_triggers.py +++ b/homeassistant/components/homekit/type_triggers.py @@ -108,7 +108,7 @@ class DeviceTriggerAccessory(HomeAccessory): _LOGGER.log, ) - @pyhap_callback # type: ignore[misc] + @pyhap_callback # type: ignore[untyped-decorator] @callback def run(self) -> None: """Run the accessory.""" diff --git a/homeassistant/components/mcp_server/server.py b/homeassistant/components/mcp_server/server.py index 85bcd407fef..fe25c5baa0d 100644 --- a/homeassistant/components/mcp_server/server.py +++ b/homeassistant/components/mcp_server/server.py @@ -59,7 +59,7 @@ async def create_server( # Backwards compatibility with old MCP Server config return await llm.async_get_api(hass, llm_api_id, llm_context) - @server.list_prompts() # type: ignore[no-untyped-call, misc] + @server.list_prompts() # type: ignore[no-untyped-call,untyped-decorator] async def handle_list_prompts() -> list[types.Prompt]: llm_api = await get_api_instance() return [ @@ -69,7 +69,7 @@ async def create_server( ) ] - @server.get_prompt() # type: ignore[no-untyped-call, misc] + @server.get_prompt() # type: ignore[no-untyped-call,untyped-decorator] async def handle_get_prompt( name: str, arguments: dict[str, str] | None ) -> types.GetPromptResult: @@ -90,13 +90,13 @@ async def create_server( ], ) - @server.list_tools() # type: ignore[no-untyped-call, misc] + @server.list_tools() # type: ignore[no-untyped-call,untyped-decorator] async def list_tools() -> list[types.Tool]: """List available time tools.""" llm_api = await get_api_instance() return [_format_tool(tool, llm_api.custom_serializer) for tool in llm_api.tools] - @server.call_tool() # type: ignore[misc] + @server.call_tool() # type: ignore[untyped-decorator] async def call_tool(name: str, arguments: dict) -> Sequence[types.TextContent]: """Handle calling tools.""" llm_api = await get_api_instance() diff --git a/requirements_test.txt b/requirements_test.txt index a7edadc0112..6b5965879ce 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -11,9 +11,11 @@ astroid==3.3.11 coverage==7.10.6 freezegun==1.5.2 go2rtc-client==0.2.1 +# librt is an internal mypy dependency +librt==0.2.1 license-expression==30.4.3 mock-open==1.4.0 -mypy-dev==1.19.0a2 +mypy-dev==1.19.0a4 pre-commit==4.2.0 pydantic==2.12.0 pylint==3.3.8