load cleanups (#23112)

* load cleanups

* Remove unused methods

* Allow importing requirements at the top of a file

* Fix test

* Lint

* Install reqs ASAP when loading platforms
This commit is contained in:
Paulus Schoutsen
2019-04-15 16:45:46 -07:00
committed by GitHub
parent 4d080f8b17
commit 6a2da9f9a5
8 changed files with 64 additions and 146 deletions

View File

@@ -29,8 +29,6 @@ if TYPE_CHECKING:
CALLABLE_T = TypeVar('CALLABLE_T', bound=Callable) # noqa pylint: disable=invalid-name
PREPARED = False
DEPENDENCY_BLACKLIST = {'config'}
_LOGGER = logging.getLogger(__name__)
@@ -170,6 +168,7 @@ async def async_get_integration(hass: 'HomeAssistant', domain: str)\
return integration
except ImportError:
# Import error if "custom_components" doesn't exist
pass
from homeassistant import components
@@ -376,9 +375,6 @@ async def _async_component_dependencies(hass, # type: HomeAssistant
"""
integration = await async_get_integration(hass, domain)
if integration is None:
raise IntegrationNotFound(domain)
loading.add(domain)
for dependency_domain in integration.dependencies: