Merge pull request #30064 from home-assistant/rc

0.103.2
This commit is contained in:
Paulus Schoutsen 2019-12-19 08:03:47 +01:00 committed by GitHub
commit 50714fbedf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 8 deletions

View file

@ -1,7 +1,7 @@
"""Constants used by Home Assistant components."""
MAJOR_VERSION = 0
MINOR_VERSION = 103
PATCH_VERSION = "1"
PATCH_VERSION = "2"
__short_version__ = "{}.{}".format(MAJOR_VERSION, MINOR_VERSION)
__version__ = "{}.{}".format(__short_version__, PATCH_VERSION)
REQUIRED_PYTHON_VER = (3, 6, 1)

View file

@ -3,7 +3,7 @@ import asyncio
from pathlib import Path
import logging
import os
from typing import Any, Dict, List, Optional
from typing import Any, Dict, List, Optional, Set
from homeassistant.exceptions import HomeAssistantError
import homeassistant.util.package as pkg_util
@ -28,16 +28,19 @@ class RequirementsNotFound(HomeAssistantError):
async def async_get_integration_with_requirements(
hass: HomeAssistant, domain: str
hass: HomeAssistant, domain: str, done: Set[str] = None
) -> Integration:
"""Get an integration with installed requirements.
This can raise IntegrationNotFound if manifest or integration
is invalid, RequirementNotFound if there was some type of
failure to install requirements.
Does not handle circular dependencies.
"""
if done is None:
done = {domain}
else:
done.add(domain)
integration = await async_get_integration(hass, domain)
if hass.config.skip_pip:
@ -48,11 +51,18 @@ async def async_get_integration_with_requirements(
hass, integration.domain, integration.requirements
)
deps = integration.dependencies + (integration.after_dependencies or [])
deps_to_check = [
dep
for dep in integration.dependencies + (integration.after_dependencies or [])
if dep not in done
]
if deps:
if deps_to_check:
await asyncio.gather(
*[async_get_integration_with_requirements(hass, dep) for dep in deps]
*[
async_get_integration_with_requirements(hass, dep, done)
for dep in deps_to_check
]
)
return integration