Fix import issues related to onboarding views (#141919)
* Fix import issues related to onboarding views * Add ha-intents and numpy to pyproject.toml * Add more requirements to pyproject.toml * Add more requirements to pyproject.tomlpull/142003/head
parent
c4f0d9d2fa
commit
b9a0d553ab
|
@ -31,7 +31,7 @@ from homeassistant.helpers import area_registry as ar
|
|||
from homeassistant.helpers.backup import async_get_manager as async_get_backup_manager
|
||||
from homeassistant.helpers.system_info import async_get_system_info
|
||||
from homeassistant.helpers.translation import async_get_translations
|
||||
from homeassistant.setup import async_setup_component
|
||||
from homeassistant.setup import SetupPhases, async_pause_setup, async_setup_component
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from . import OnboardingData, OnboardingStorage, OnboardingStoreData
|
||||
|
@ -60,7 +60,7 @@ async def async_setup(
|
|||
hass.http.register_view(BackupInfoView(data))
|
||||
hass.http.register_view(RestoreBackupView(data))
|
||||
hass.http.register_view(UploadBackupView(data))
|
||||
setup_cloud_views(hass, data)
|
||||
await setup_cloud_views(hass, data)
|
||||
|
||||
|
||||
class _BaseOnboardingView(HomeAssistantView):
|
||||
|
@ -428,9 +428,19 @@ class UploadBackupView(_NoAuthBaseOnboardingView, backup_http.UploadBackupView):
|
|||
return await self._post(request)
|
||||
|
||||
|
||||
def setup_cloud_views(hass: HomeAssistant, data: OnboardingStoreData) -> None:
|
||||
async def setup_cloud_views(hass: HomeAssistant, data: OnboardingStoreData) -> None:
|
||||
"""Set up the cloud views."""
|
||||
|
||||
with async_pause_setup(hass, SetupPhases.WAIT_IMPORT_PACKAGES):
|
||||
# Import the cloud integration in an executor to avoid blocking the
|
||||
# event loop.
|
||||
def import_cloud() -> None:
|
||||
"""Import the cloud integration."""
|
||||
# pylint: disable-next=import-outside-toplevel
|
||||
from homeassistant.components.cloud import http_api # noqa: F401
|
||||
|
||||
await hass.async_add_import_executor_job(import_cloud)
|
||||
|
||||
# The cloud integration is imported locally to avoid cloud being imported by
|
||||
# bootstrap.py and to avoid circular imports.
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ ifaddr==0.2.0
|
|||
Jinja2==3.1.6
|
||||
lru-dict==1.3.0
|
||||
mutagen==1.47.0
|
||||
numpy==2.2.2
|
||||
orjson==3.10.16
|
||||
packaging>=23.1
|
||||
paho-mqtt==2.1.0
|
||||
|
|
|
@ -45,16 +45,41 @@ dependencies = [
|
|||
"ciso8601==2.3.2",
|
||||
"cronsim==2.6",
|
||||
"fnv-hash-fast==1.4.0",
|
||||
# ha-ffmpeg is indirectly imported from onboarding via the import chain
|
||||
# onboarding->cloud->assist_pipeline->tts->ffmpeg. Onboarding needs
|
||||
# to be setup in stage 0, but we don't want to also promote cloud with all its
|
||||
# dependencies to stage 0.
|
||||
"ha-ffmpeg==3.2.2",
|
||||
# hass-nabucasa is imported by helpers which don't depend on the cloud
|
||||
# integration
|
||||
"hass-nabucasa==0.94.0",
|
||||
# hassil is indirectly imported from onboarding via the import chain
|
||||
# onboarding->cloud->assist_pipeline->conversation->hassil. Onboarding needs
|
||||
# to be setup in stage 0, but we don't want to also promote cloud with all its
|
||||
# dependencies to stage 0.
|
||||
"hassil==2.2.3",
|
||||
# When bumping httpx, please check the version pins of
|
||||
# httpcore, anyio, and h11 in gen_requirements_all
|
||||
"httpx==0.28.1",
|
||||
"home-assistant-bluetooth==1.13.1",
|
||||
# home_assistant_intents is indirectly imported from onboarding via the import chain
|
||||
# onboarding->cloud->assist_pipeline->conversation->home_assistant_intents. Onboarding needs
|
||||
# to be setup in stage 0, but we don't want to also promote cloud with all its
|
||||
# dependencies to stage 0.
|
||||
"home-assistant-intents==2025.3.28",
|
||||
"ifaddr==0.2.0",
|
||||
"Jinja2==3.1.6",
|
||||
"lru-dict==1.3.0",
|
||||
# mutagen is indirectly imported from onboarding via the import chain
|
||||
# onboarding->cloud->assist_pipeline->tts->mutagen. Onboarding needs
|
||||
# to be setup in stage 0, but we don't want to also promote cloud with all its
|
||||
# dependencies to stage 0.
|
||||
"mutagen==1.47.0",
|
||||
# numpy is indirectly imported from onboarding via the import chain
|
||||
# onboarding->cloud->alexa->camera->stream->numpy. Onboarding needs
|
||||
# to be setup in stage 0, but we don't want to also promote cloud with all its
|
||||
# dependencies to stage 0.
|
||||
"numpy==2.2.2",
|
||||
"PyJWT==2.10.1",
|
||||
# PyJWT has loose dependency. We want the latest one.
|
||||
"cryptography==44.0.1",
|
||||
|
@ -64,7 +89,22 @@ dependencies = [
|
|||
"orjson==3.10.16",
|
||||
"packaging>=23.1",
|
||||
"psutil-home-assistant==0.0.1",
|
||||
# pymicro_vad is indirectly imported from onboarding via the import chain
|
||||
# onboarding->cloud->assist_pipeline->pymicro_vad. Onboarding needs
|
||||
# to be setup in stage 0, but we don't want to also promote cloud with all its
|
||||
# dependencies to stage 0.
|
||||
"pymicro-vad==1.0.1",
|
||||
# pyspeex-noise is indirectly imported from onboarding via the import chain
|
||||
# onboarding->cloud->assist_pipeline->pyspeex_noise. Onboarding needs
|
||||
# to be setup in stage 0, but we don't want to also promote cloud with all its
|
||||
# dependencies to stage 0.
|
||||
"pyspeex-noise==1.0.2",
|
||||
"python-slugify==8.0.4",
|
||||
# PyTurboJPEG is indirectly imported from onboarding via the import chain
|
||||
# onboarding->cloud->camera->pyturbojpeg. Onboarding needs
|
||||
# to be setup in stage 0, but we don't want to also promote cloud with all its
|
||||
# dependencies to stage 0.
|
||||
"PyTurboJPEG==1.7.5",
|
||||
"PyYAML==6.0.2",
|
||||
"requests==2.32.3",
|
||||
"securetar==2025.2.1",
|
||||
|
|
|
@ -22,12 +22,17 @@ certifi>=2021.5.30
|
|||
ciso8601==2.3.2
|
||||
cronsim==2.6
|
||||
fnv-hash-fast==1.4.0
|
||||
ha-ffmpeg==3.2.2
|
||||
hass-nabucasa==0.94.0
|
||||
hassil==2.2.3
|
||||
httpx==0.28.1
|
||||
home-assistant-bluetooth==1.13.1
|
||||
home-assistant-intents==2025.3.28
|
||||
ifaddr==0.2.0
|
||||
Jinja2==3.1.6
|
||||
lru-dict==1.3.0
|
||||
mutagen==1.47.0
|
||||
numpy==2.2.2
|
||||
PyJWT==2.10.1
|
||||
cryptography==44.0.1
|
||||
Pillow==11.1.0
|
||||
|
@ -36,7 +41,10 @@ pyOpenSSL==25.0.0
|
|||
orjson==3.10.16
|
||||
packaging>=23.1
|
||||
psutil-home-assistant==0.0.1
|
||||
pymicro-vad==1.0.1
|
||||
pyspeex-noise==1.0.2
|
||||
python-slugify==8.0.4
|
||||
PyTurboJPEG==1.7.5
|
||||
PyYAML==6.0.2
|
||||
requests==2.32.3
|
||||
securetar==2025.2.1
|
||||
|
|
Loading…
Reference in New Issue