Install requirements for integrations in packages before importing them. (#25005)

* Process requirements for integrations in packages before loading

* trigger buld
pull/25039/head
Joakim Sørensen 2019-07-07 21:04:30 +02:00 committed by Paulus Schoutsen
parent 0595fc3097
commit df4caf41d0
1 changed files with 8 additions and 0 deletions

View File

@ -30,6 +30,7 @@ from homeassistant.exceptions import HomeAssistantError
from homeassistant.loader import (
Integration, async_get_integration, IntegrationNotFound
)
from homeassistant.requirements import async_process_requirements
from homeassistant.util.yaml import load_yaml, SECRET_YAML
from homeassistant.util.package import is_docker_env
import homeassistant.helpers.config_validation as cv
@ -593,6 +594,13 @@ async def merge_packages_config(hass: HomeAssistant, config: Dict,
_log_pkg_error(pack_name, comp_name, config, "does not exist")
continue
if (not hass.config.skip_pip and integration.requirements and
not await async_process_requirements(
hass, integration.domain, integration.requirements)):
_log_pkg_error(pack_name, comp_name, config,
"unable to install all requirements")
continue
try:
component = integration.get_component()
except ImportError: