From 9ba6707de394e370fd9e98c1c7e09c0c497020ce Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:51:03 +0100 Subject: [PATCH 1/3] Update mypy-dev to 1.14.0a2 --- requirements_test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_test.txt b/requirements_test.txt index c879f0c662167..241fff89ac3d4 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -12,7 +12,7 @@ coverage==7.6.1 freezegun==1.5.1 license-expression==30.4.0 mock-open==1.4.0 -mypy-dev==1.13.0a1 +mypy-dev==1.14.0a2 pre-commit==4.0.0 pydantic==1.10.18 pylint==3.3.1 From 5b81ba145f1759b8e0eabf897fe35c9c76842ef9 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Fri, 1 Nov 2024 12:34:31 +0100 Subject: [PATCH 2/3] Enable report-deprecated-as-error --- mypy.ini | 1 + script/hassfest/mypy_config.py | 1 + 2 files changed, 2 insertions(+) diff --git a/mypy.ini b/mypy.ini index 1b98877759425..c851e586246ee 100644 --- a/mypy.ini +++ b/mypy.ini @@ -11,6 +11,7 @@ follow_imports = normal local_partial_types = true strict_equality = true no_implicit_optional = true +report_deprecated_as_error = true warn_incomplete_stub = true warn_redundant_casts = true warn_unused_configs = true diff --git a/script/hassfest/mypy_config.py b/script/hassfest/mypy_config.py index de42c964ddf72..25fe875e43788 100644 --- a/script/hassfest/mypy_config.py +++ b/script/hassfest/mypy_config.py @@ -43,6 +43,7 @@ "local_partial_types": "true", "strict_equality": "true", "no_implicit_optional": "true", + "report_deprecated_as_error": "true", "warn_incomplete_stub": "true", "warn_redundant_casts": "true", "warn_unused_configs": "true", From 2fde921dbc166b77e4547563d7f3a2970f488ca9 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Thu, 24 Oct 2024 10:53:45 +0200 Subject: [PATCH 3/3] Fix --- homeassistant/components/energy/data.py | 2 +- homeassistant/components/image_processing/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/energy/data.py b/homeassistant/components/energy/data.py index 9c5a9fbacd164..ff86177cf4120 100644 --- a/homeassistant/components/energy/data.py +++ b/homeassistant/components/energy/data.py @@ -331,7 +331,7 @@ async def async_update(self, update: EnergyPreferencesUpdate) -> None: "device_consumption", ): if key in update: - data[key] = update[key] # type: ignore[literal-required] + data[key] = update[key] self.data = data self._store.async_delay_save(lambda: data, 60) diff --git a/homeassistant/components/image_processing/__init__.py b/homeassistant/components/image_processing/__init__.py index 2c1d0f9304c9b..0ac8d39813bfd 100644 --- a/homeassistant/components/image_processing/__init__.py +++ b/homeassistant/components/image_processing/__init__.py @@ -223,7 +223,7 @@ def state(self) -> str | int | None: confidence = f_co for attr in (ATTR_NAME, ATTR_MOTION): if attr in face: - state = face[attr] # type: ignore[literal-required] + state = face[attr] break return state