mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Update mypy-dev to 1.11.0a2 (#117630)
This commit is contained in:
parent
eacbebce22
commit
4edee94a81
@ -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:
|
||||
|
@ -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"
|
||||
|
1
mypy.ini
1
mypy.ini
@ -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
|
||||
|
@ -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
|
||||
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user