From db7d0eb9b90de547de54a4a56d900dc5c1483fd1 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 3 Mar 2020 13:57:09 -0800 Subject: [PATCH] Remove hassfest blacklisted rest (#32441) * Remove blacklisted deps from hassfest deps * Whitelist all internal integrations --- .../dwd_weather_warnings/manifest.json | 1 + .../components/emulated_hue/manifest.json | 1 + script/hassfest/dependencies.py | 62 ++++++++++++------- 3 files changed, 41 insertions(+), 23 deletions(-) diff --git a/homeassistant/components/dwd_weather_warnings/manifest.json b/homeassistant/components/dwd_weather_warnings/manifest.json index 19dcf2860d74..0a9f972c84ee 100644 --- a/homeassistant/components/dwd_weather_warnings/manifest.json +++ b/homeassistant/components/dwd_weather_warnings/manifest.json @@ -4,5 +4,6 @@ "documentation": "https://www.home-assistant.io/integrations/dwd_weather_warnings", "requirements": [], "dependencies": [], + "after_dependencies": ["rest"], "codeowners": [] } diff --git a/homeassistant/components/emulated_hue/manifest.json b/homeassistant/components/emulated_hue/manifest.json index c3c0302dbc30..37848e6f3060 100644 --- a/homeassistant/components/emulated_hue/manifest.json +++ b/homeassistant/components/emulated_hue/manifest.json @@ -4,6 +4,7 @@ "documentation": "https://www.home-assistant.io/integrations/emulated_hue", "requirements": ["aiohttp_cors==0.7.0"], "dependencies": [], + "after_dependencies": ["http"], "codeowners": [], "quality_scale": "internal" } diff --git a/script/hassfest/dependencies.py b/script/hassfest/dependencies.py index c909b6216a93..934400533e1f 100644 --- a/script/hassfest/dependencies.py +++ b/script/hassfest/dependencies.py @@ -65,7 +65,7 @@ class ImportCollector(ast.NodeVisitor): # self.hass.components.hue.async_create() # Name(id=self) - # .Attribute(attr=hass) + # .Attribute(attr=hass) or .Attribute(attr=_hass) # .Attribute(attr=hue) # .Attribute(attr=async_create) if ( @@ -78,7 +78,7 @@ class ImportCollector(ast.NodeVisitor): ) or ( isinstance(node.value.value, ast.Attribute) - and node.value.value.attr == "hass" + and node.value.value.attr in ("hass", "_hass") ) ) ): @@ -89,20 +89,47 @@ class ImportCollector(ast.NodeVisitor): ALLOWED_USED_COMPONENTS = { - # This component will always be set up - "persistent_notification", - # These allow to register things without being set up - "conversation", - "frontend", - "hassio", - "system_health", - "websocket_api", + # Internal integrations + "alert", "automation", + "conversation", "device_automation", - "zone", + "frontend", + "group", + "hassio", "homeassistant", - "system_log", + "input_boolean", + "input_datetime", + "input_number", + "input_select", + "input_text", + "persistent_notification", "person", + "script", + "shopping_list", + "sun", + "system_health", + "system_log", + "timer", + "webhook", + "websocket_api", + "zone", + # Entity integrations with platforms + "alarm_control_panel", + "binary_sensor", + "climate", + "cover", + "device_tracker", + "fan", + "image_processing", + "light", + "lock", + "media_player", + "scene", + "sensor", + "switch", + "vacuum", + "water_heater", # Other "mjpeg", # base class, has no reqs or component to load. "stream", # Stream cannot install on all systems, can be imported without reqs. @@ -121,18 +148,7 @@ IGNORE_VIOLATIONS = { # This should become a helper method that integrations can submit data to ("websocket_api", "lovelace"), ("websocket_api", "shopping_list"), - # Expose HA to external systems - "homekit", - "alexa", - "google_assistant", - "emulated_hue", - "prometheus", - "conversation", "logbook", - "mobile_app", - # These should be extracted to external package - "pvoutput", - "dwd_weather_warnings", }