Update mypy-dev to 1.11.0a2 (#117630)
This commit is contained in:
parent
eacbebce22
commit
4edee94a81
5 changed files with 8 additions and 16 deletions
|
@ -580,8 +580,6 @@ class HomeAssistant:
|
||||||
functools.partial(self.async_create_task, target, eager_start=True)
|
functools.partial(self.async_create_task, target, eager_start=True)
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
if TYPE_CHECKING:
|
|
||||||
target = cast(Callable[[*_Ts], Any], target)
|
|
||||||
self.loop.call_soon_threadsafe(
|
self.loop.call_soon_threadsafe(
|
||||||
functools.partial(self._async_add_hass_job, HassJob(target), *args)
|
functools.partial(self._async_add_hass_job, HassJob(target), *args)
|
||||||
)
|
)
|
||||||
|
@ -648,12 +646,6 @@ class HomeAssistant:
|
||||||
if asyncio.iscoroutine(target):
|
if asyncio.iscoroutine(target):
|
||||||
return self.async_create_task(target, eager_start=eager_start)
|
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)
|
return self._async_add_hass_job(HassJob(target), *args)
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
|
@ -987,12 +979,6 @@ class HomeAssistant:
|
||||||
if asyncio.iscoroutine(target):
|
if asyncio.iscoroutine(target):
|
||||||
return self.async_create_task(target, eager_start=True)
|
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)
|
return self.async_run_hass_job(HassJob(target), *args)
|
||||||
|
|
||||||
def block_till_done(self, wait_background_tasks: bool = False) -> None:
|
def block_till_done(self, wait_background_tasks: bool = False) -> None:
|
||||||
|
|
|
@ -1048,7 +1048,7 @@ async def _handle_entity_call(
|
||||||
result = await task
|
result = await task
|
||||||
|
|
||||||
if asyncio.iscoroutine(result):
|
if asyncio.iscoroutine(result):
|
||||||
_LOGGER.error(
|
_LOGGER.error( # type: ignore[unreachable]
|
||||||
(
|
(
|
||||||
"Service %s for %s incorrectly returns a coroutine object. Await result"
|
"Service %s for %s incorrectly returns a coroutine object. Await result"
|
||||||
" instead in service handler. Report bug to integration author"
|
" instead in service handler. Report bug to integration author"
|
||||||
|
|
1
mypy.ini
1
mypy.ini
|
@ -8,6 +8,7 @@ platform = linux
|
||||||
plugins = pydantic.mypy
|
plugins = pydantic.mypy
|
||||||
show_error_codes = true
|
show_error_codes = true
|
||||||
follow_imports = normal
|
follow_imports = normal
|
||||||
|
enable_incomplete_feature = NewGenericSyntax
|
||||||
local_partial_types = true
|
local_partial_types = true
|
||||||
strict_equality = true
|
strict_equality = true
|
||||||
no_implicit_optional = true
|
no_implicit_optional = true
|
||||||
|
|
|
@ -11,7 +11,7 @@ astroid==3.1.0
|
||||||
coverage==7.5.0
|
coverage==7.5.0
|
||||||
freezegun==1.5.0
|
freezegun==1.5.0
|
||||||
mock-open==1.4.0
|
mock-open==1.4.0
|
||||||
mypy==1.10.0
|
mypy-dev==1.11.0a2
|
||||||
pre-commit==3.7.1
|
pre-commit==3.7.1
|
||||||
pydantic==1.10.15
|
pydantic==1.10.15
|
||||||
pylint==3.1.1
|
pylint==3.1.1
|
||||||
|
|
|
@ -36,6 +36,11 @@ GENERAL_SETTINGS: Final[dict[str, str]] = {
|
||||||
"plugins": "pydantic.mypy",
|
"plugins": "pydantic.mypy",
|
||||||
"show_error_codes": "true",
|
"show_error_codes": "true",
|
||||||
"follow_imports": "normal",
|
"follow_imports": "normal",
|
||||||
|
"enable_incomplete_feature": ",".join( # noqa: FLY002
|
||||||
|
[
|
||||||
|
"NewGenericSyntax",
|
||||||
|
]
|
||||||
|
),
|
||||||
# Enable some checks globally.
|
# Enable some checks globally.
|
||||||
"local_partial_types": "true",
|
"local_partial_types": "true",
|
||||||
"strict_equality": "true",
|
"strict_equality": "true",
|
||||||
|
|
Loading…
Add table
Reference in a new issue