Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions homeassistant/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,15 @@


DEBUGGER_INTEGRATIONS = {"debugpy"}

# Core integrations are unconditionally loaded
CORE_INTEGRATIONS = {"homeassistant", "persistent_notification"}
LOGGING_INTEGRATIONS = {

# 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
Expand Down Expand Up @@ -214,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.
Expand Down
1 change: 0 additions & 1 deletion homeassistant/components/http/manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_circular_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
DEBUGGER_INTEGRATIONS,
DEFAULT_INTEGRATIONS,
FRONTEND_INTEGRATIONS,
LOGGING_INTEGRATIONS,
LOGGING_AND_HTTP_DEPS_INTEGRATIONS,
RECORDER_INTEGRATIONS,
STAGE_1_INTEGRATIONS,
)
Expand All @@ -23,7 +23,7 @@
{
*DEBUGGER_INTEGRATIONS,
*CORE_INTEGRATIONS,
*LOGGING_INTEGRATIONS,
*LOGGING_AND_HTTP_DEPS_INTEGRATIONS,
*FRONTEND_INTEGRATIONS,
*RECORDER_INTEGRATIONS,
*STAGE_1_INTEGRATIONS,
Expand Down
9 changes: 4 additions & 5 deletions tests/test_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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(
Expand All @@ -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


Expand Down