From c634d8439ebe565fb179f177af404d403e119782 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 6 Jun 2024 11:33:33 -0500 Subject: [PATCH 1/5] Remove isal from after_dependencies in http fixes #118996 --- homeassistant/components/http/manifest.json | 1 - 1 file changed, 1 deletion(-) diff --git a/homeassistant/components/http/manifest.json b/homeassistant/components/http/manifest.json index b48a188cf47bfb..fb804251edc035 100644 --- a/homeassistant/components/http/manifest.json +++ b/homeassistant/components/http/manifest.json @@ -1,7 +1,6 @@ { "domain": "http", "name": "HTTP", - "after_dependencies": ["isal"], "codeowners": ["@home-assistant/core"], "documentation": "https://www.home-assistant.io/integrations/http", "integration_type": "system", From c88805e52edd4cd75209585467fa6119892a397c Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 6 Jun 2024 11:38:23 -0500 Subject: [PATCH 2/5] adjust --- homeassistant/bootstrap.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/bootstrap.py b/homeassistant/bootstrap.py index 391c6ebfa453f1..bf4112c34acdc5 100644 --- a/homeassistant/bootstrap.py +++ b/homeassistant/bootstrap.py @@ -134,7 +134,9 @@ DEBUGGER_INTEGRATIONS = {"debugpy"} -CORE_INTEGRATIONS = {"homeassistant", "persistent_notification"} +# isal is loaded right away before `http` to ensure if its +# enabled, that `isal` is up to date. +CORE_INTEGRATIONS = {"homeassistant", "isal", "persistent_notification"} LOGGING_INTEGRATIONS = { # Set log levels "logger", From 3659b17d59bc74636b429d526df1552b7aac7805 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 6 Jun 2024 12:00:40 -0500 Subject: [PATCH 3/5] fix,comment --- homeassistant/bootstrap.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/homeassistant/bootstrap.py b/homeassistant/bootstrap.py index bf4112c34acdc5..74196cdc625697 100644 --- a/homeassistant/bootstrap.py +++ b/homeassistant/bootstrap.py @@ -134,10 +134,15 @@ DEBUGGER_INTEGRATIONS = {"debugpy"} -# isal is loaded right away before `http` to ensure if its -# enabled, that `isal` is up to date. -CORE_INTEGRATIONS = {"homeassistant", "isal", "persistent_notification"} -LOGGING_INTEGRATIONS = { + +# Core integrations are unconditionally loaded +CORE_INTEGRATIONS = {"homeassistant", "persistent_notification"} + +# Integrations that are loaded right after the core is set up +LOGGING_AND_HTTP_DEPS_INTEGRATIONS = { + # isal is loaded right away before `http` to ensure if its + # enabled, that `isal` is up to date. + "isal", # Set log levels "logger", # Error logging @@ -216,8 +221,8 @@ } SETUP_ORDER = ( - # Load logging as soon as possible - ("logging", LOGGING_INTEGRATIONS), + # Load logging and http deps as soon as possible + ("logging, http deps", LOGGING_AND_HTTP_DEPS_INTEGRATIONS), # Setup frontend and recorder ("frontend, recorder", {*FRONTEND_INTEGRATIONS, *RECORDER_INTEGRATIONS}), # Start up debuggers. Start these first in case they want to wait. From 3a1a96fe3515ddbbd12207fa6a76f21e2c5aa68e Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 6 Jun 2024 20:05:56 -0500 Subject: [PATCH 4/5] fix test --- tests/test_circular_imports.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_circular_imports.py b/tests/test_circular_imports.py index 79f0fd9caf71da..dfdee65b2b0a05 100644 --- a/tests/test_circular_imports.py +++ b/tests/test_circular_imports.py @@ -10,7 +10,7 @@ DEBUGGER_INTEGRATIONS, DEFAULT_INTEGRATIONS, FRONTEND_INTEGRATIONS, - LOGGING_INTEGRATIONS, + LOGGING_AND_HTTP_DEPS_INTEGRATIONS, RECORDER_INTEGRATIONS, STAGE_1_INTEGRATIONS, ) @@ -23,7 +23,7 @@ { *DEBUGGER_INTEGRATIONS, *CORE_INTEGRATIONS, - *LOGGING_INTEGRATIONS, + *LOGGING_AND_HTTP_DEPS_INTEGRATIONS, *FRONTEND_INTEGRATIONS, *RECORDER_INTEGRATIONS, *STAGE_1_INTEGRATIONS, From ac7ca3becffe6d260bcb6ce823dc26de747dfc0c Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 6 Jun 2024 20:47:02 -0500 Subject: [PATCH 5/5] fix req test --- tests/test_requirements.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/test_requirements.py b/tests/test_requirements.py index 2b2415e22a8292..73f3f54c3c4861 100644 --- a/tests/test_requirements.py +++ b/tests/test_requirements.py @@ -591,7 +591,7 @@ async def test_discovery_requirements_mqtt(hass: HomeAssistant) -> None: ) as mock_process: await async_get_integration_with_requirements(hass, "mqtt_comp") - assert len(mock_process.mock_calls) == 2 + assert len(mock_process.mock_calls) == 1 assert mock_process.mock_calls[0][1][1] == mqtt.requirements @@ -608,13 +608,12 @@ async def test_discovery_requirements_ssdp(hass: HomeAssistant) -> None: ) as mock_process: await async_get_integration_with_requirements(hass, "ssdp_comp") - assert len(mock_process.mock_calls) == 4 + assert len(mock_process.mock_calls) == 3 assert mock_process.mock_calls[0][1][1] == ssdp.requirements assert { mock_process.mock_calls[1][1][0], mock_process.mock_calls[2][1][0], - mock_process.mock_calls[3][1][0], - } == {"network", "recorder", "isal"} + } == {"network", "recorder"} @pytest.mark.parametrize( @@ -638,7 +637,7 @@ async def test_discovery_requirements_zeroconf( ) as mock_process: await async_get_integration_with_requirements(hass, "comp") - assert len(mock_process.mock_calls) == 4 + assert len(mock_process.mock_calls) == 3 assert mock_process.mock_calls[0][1][1] == zeroconf.requirements