Update mypy-dev to 1.11.0a2 (#117630)

This commit is contained in:
Marc Mueller 2024-05-17 13:32:20 +02:00 committed by GitHub
parent eacbebce22
commit 4edee94a81
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 8 additions and 16 deletions

View File

@ -580,8 +580,6 @@ class HomeAssistant:
functools.partial(self.async_create_task, target, eager_start=True)
)
return
if TYPE_CHECKING:
target = cast(Callable[[*_Ts], Any], target)
self.loop.call_soon_threadsafe(
functools.partial(self._async_add_hass_job, HassJob(target), *args)
)
@ -648,12 +646,6 @@ class HomeAssistant:
if asyncio.iscoroutine(target):
return self.async_create_task(target, eager_start=eager_start)
# This code path is performance sensitive and uses
# if TYPE_CHECKING to avoid the overhead of constructing
# the type used for the cast. For history see:
# https://github.com/home-assistant/core/pull/71960
if TYPE_CHECKING:
target = cast(Callable[[*_Ts], Coroutine[Any, Any, _R] | _R], target)
return self._async_add_hass_job(HassJob(target), *args)
@overload
@ -987,12 +979,6 @@ class HomeAssistant:
if asyncio.iscoroutine(target):
return self.async_create_task(target, eager_start=True)
# This code path is performance sensitive and uses
# if TYPE_CHECKING to avoid the overhead of constructing
# the type used for the cast. For history see:
# https://github.com/home-assistant/core/pull/71960
if TYPE_CHECKING:
target = cast(Callable[[*_Ts], Coroutine[Any, Any, _R] | _R], target)
return self.async_run_hass_job(HassJob(target), *args)
def block_till_done(self, wait_background_tasks: bool = False) -> None:

View File

@ -1048,7 +1048,7 @@ async def _handle_entity_call(
result = await task
if asyncio.iscoroutine(result):
_LOGGER.error(
_LOGGER.error( # type: ignore[unreachable]
(
"Service %s for %s incorrectly returns a coroutine object. Await result"
" instead in service handler. Report bug to integration author"

View File

@ -8,6 +8,7 @@ platform = linux
plugins = pydantic.mypy
show_error_codes = true
follow_imports = normal
enable_incomplete_feature = NewGenericSyntax
local_partial_types = true
strict_equality = true
no_implicit_optional = true

View File

@ -11,7 +11,7 @@ astroid==3.1.0
coverage==7.5.0
freezegun==1.5.0
mock-open==1.4.0
mypy==1.10.0
mypy-dev==1.11.0a2
pre-commit==3.7.1
pydantic==1.10.15
pylint==3.1.1

View File

@ -36,6 +36,11 @@ GENERAL_SETTINGS: Final[dict[str, str]] = {
"plugins": "pydantic.mypy",
"show_error_codes": "true",
"follow_imports": "normal",
"enable_incomplete_feature": ",".join( # noqa: FLY002
[
"NewGenericSyntax",
]
),
# Enable some checks globally.
"local_partial_types": "true",
"strict_equality": "true",