diff --git a/homeassistant/auth/auth_store.py b/homeassistant/auth/auth_store.py index a64c14454a6..b9acc90d5c2 100644 --- a/homeassistant/auth/auth_store.py +++ b/homeassistant/auth/auth_store.py @@ -547,7 +547,7 @@ class AuthStore: def _set_defaults(self) -> None: """Set default values for auth store.""" - self._users = OrderedDict() # type: Dict[str, models.User] + self._users = OrderedDict() groups = OrderedDict() # type: Dict[str, models.Group] admin_group = _system_admin_group() diff --git a/homeassistant/config_entries.py b/homeassistant/config_entries.py index bfd8c0f2df7..f39f30e0f11 100644 --- a/homeassistant/config_entries.py +++ b/homeassistant/config_entries.py @@ -257,7 +257,8 @@ class ConfigEntry: self.title, self.domain) return False # Handler may be a partial - while isinstance(handler, functools.partial): + # type ignore: https://github.com/python/typeshed/pull/3077 + while isinstance(handler, functools.partial): # type: ignore handler = handler.func if self.version == handler.VERSION: diff --git a/homeassistant/core.py b/homeassistant/core.py index ef15a4b11a0..00400c2088a 100644 --- a/homeassistant/core.py +++ b/homeassistant/core.py @@ -270,8 +270,9 @@ class HomeAssistant: # Check for partials to properly determine if coroutine function check_target = target - while isinstance(check_target, functools.partial): - check_target = check_target.func + # type ignores: https://github.com/python/typeshed/pull/3077 + while isinstance(check_target, functools.partial): # type: ignore + check_target = check_target.func # type: ignore if asyncio.iscoroutine(check_target): task = self.loop.create_task(target) # type: ignore @@ -946,8 +947,9 @@ class Service: self.func = func self.schema = schema # Properly detect wrapped functions - while isinstance(func, functools.partial): - func = func.func + # type ignores: https://github.com/python/typeshed/pull/3077 + while isinstance(func, functools.partial): # type: ignore + func = func.func # type: ignore self.is_callback = is_callback(func) self.is_coroutinefunction = asyncio.iscoroutinefunction(func) diff --git a/homeassistant/scripts/__init__.py b/homeassistant/scripts/__init__.py index 961ce5a9d13..b0e7917a806 100644 --- a/homeassistant/scripts/__init__.py +++ b/homeassistant/scripts/__init__.py @@ -57,7 +57,7 @@ def run(args: List) -> int: print('Aborting script, could not install dependency', req) return 1 - return script.run(args[1:]) # type: ignore + return script.run(args[1:]) def extract_config_dir(args=None) -> str: diff --git a/homeassistant/util/async_.py b/homeassistant/util/async_.py index a4ad0e98a2e..e3ad8459be0 100644 --- a/homeassistant/util/async_.py +++ b/homeassistant/util/async_.py @@ -9,7 +9,7 @@ from asyncio.futures import Future import asyncio from asyncio import ensure_future from typing import Any, Union, Coroutine, Callable, Generator, TypeVar, \ - Awaitable + Awaitable, Optional _LOGGER = logging.getLogger(__name__) @@ -92,11 +92,11 @@ def _chain_future( raise TypeError('A future is required for destination argument') # pylint: disable=protected-access if isinstance(source, Future): - source_loop = source._loop # type: ignore + source_loop = source._loop # type: Optional[AbstractEventLoop] else: source_loop = None if isinstance(destination, Future): - dest_loop = destination._loop # type: ignore + dest_loop = destination._loop # type: Optional[AbstractEventLoop] else: dest_loop = None diff --git a/homeassistant/util/logging.py b/homeassistant/util/logging.py index a821c9b6fb8..19a6e6f8caa 100644 --- a/homeassistant/util/logging.py +++ b/homeassistant/util/logging.py @@ -141,8 +141,9 @@ def catch_log_exception( # Check for partials to properly determine if coroutine function check_func = func - while isinstance(check_func, partial): - check_func = check_func.func + # type ignores: https://github.com/python/typeshed/pull/3077 + while isinstance(check_func, partial): # type: ignore + check_func = check_func.func # type: ignore wrapper_func = None if asyncio.iscoroutinefunction(check_func): diff --git a/requirements_test.txt b/requirements_test.txt index 7de1ad9ab1d..78b990e294b 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -7,7 +7,7 @@ coveralls==1.2.0 flake8-docstrings==1.3.0 flake8==3.7.7 mock-open==1.3.1 -mypy==0.701 +mypy==0.710 pydocstyle==3.0.0 pylint==2.3.1 pytest-aiohttp==0.3.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 96d13c97e9b..6e02a78bb57 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -8,7 +8,7 @@ coveralls==1.2.0 flake8-docstrings==1.3.0 flake8==3.7.7 mock-open==1.3.1 -mypy==0.701 +mypy==0.710 pydocstyle==3.0.0 pylint==2.3.1 pytest-aiohttp==0.3.0