home-assistant: reduce dependencies (#462455)

This commit is contained in:
dotlambda
2025-11-22 05:24:27 +00:00
committed by GitHub
3 changed files with 143 additions and 42 deletions
@@ -2,6 +2,7 @@
lib,
buildHomeAssistantComponent,
fetchFromGitHub,
home-assistant,
pytestCheckHook,
pytest-cov-stub,
pytest-homeassistant-custom-component,
@@ -30,7 +31,8 @@ buildHomeAssistantComponent rec {
pytest-homeassistant-custom-component
pytest-cov-stub
pytestCheckHook
];
]
++ home-assistant.getPackages "camera" home-assistant.python.pkgs;
#skip phases with nothing to do
dontConfigure = true;
+22 -26
View File
@@ -376,7 +376,6 @@ python.pkgs.buildPythonApplication rec {
dependencies = with python.pkgs; [
# Only packages required in pyproject.toml
aiodns
aiofiles
aiohasupervisor
aiohttp
aiohttp-asyncmdnsresolver
@@ -396,28 +395,20 @@ python.pkgs.buildPythonApplication rec {
cronsim
cryptography
fnv-hash-fast
ha-ffmpeg
hass-nabucasa
hassil
home-assistant-bluetooth
home-assistant-intents
httpx
ifaddr
jinja2
lru-dict
mutagen
numpy
orjson
packaging
pillow
propcache
psutil-home-assistant
pyjwt
pymicro-vad
pyopenssl
pyspeex-noise
python-slugify
pyturbojpeg
pyyaml
requests
securetar
@@ -444,31 +435,36 @@ python.pkgs.buildPythonApplication rec {
# upstream only tests on Linux, so do we.
doCheck = stdenv.hostPlatform.isLinux;
requirementsTest = with python.pkgs; [
# test infrastructure (selectively from requirement_test.txt)
freezegun
pytest-asyncio
pytest-aiohttp
pytest-freezer
pytest-socket
pytest-timeout
pytest-unordered
pytest-xdist
pytestCheckHook
requests-mock
respx
syrupy
];
nativeCheckInputs =
with python.pkgs;
[
# test infrastructure (selectively from requirement_test.txt)
freezegun
pytest-asyncio
pytest-aiohttp
pytest-freezer
pytest-socket
pytest-timeout
pytest-unordered
pytest-xdist
pytestCheckHook
requests-mock
respx
syrupy
requirementsTest
++ (with python.pkgs; [
# Used in tests/non_packaged_scripts/test_alexa_locales.py
beautifulsoup4
# Used in tests/scripts/test_check_config.py
colorlog
]
])
++ lib.concatMap (component: getPackages component python.pkgs) [
# some components are needed even if tests in tests/components are disabled
"default_config"
"assist_pipeline"
"frontend"
"hue"
"mobile_app"
];
pytestFlags = [
+118 -15
View File
@@ -8,46 +8,149 @@ let
# some components' tests have additional dependencies
extraCheckInputs = with home-assistant.python.pkgs; {
axis = getComponentDeps "deconz";
homeassistant_connect_zbt2 = getComponentDeps "zha";
abode = getComponentDeps "camera";
agent_dvr = getComponentDeps "camera";
air_quality = getComponentDeps "camera" ++ getComponentDeps "conversation";
alexa = getComponentDeps "cloud" ++ getComponentDeps "frontend" ++ getComponentDeps "stream";
android_ip_webcam = getComponentDeps "camera";
assist_pipeline = getComponentDeps "frontend";
automation = getComponentDeps "frontend" ++ getComponentDeps "mobile_app";
axis = getComponentDeps "camera" ++ getComponentDeps "deconz";
blink = getComponentDeps "camera";
bthome = getComponentDeps "frontend";
buienradar = getComponentDeps "camera";
camera = getComponentDeps "conversation" ++ getComponentDeps "stream";
canary = getComponentDeps "camera";
climate = getComponentDeps "conversation";
color_extractor = getComponentDeps "camera" ++ getComponentDeps "conversation";
deconz = getComponentDeps "frontend";
demo = getComponentDeps "camera";
device_tracker = getComponentDeps "conversation";
dialogflow = getComponentDeps "assist_pipeline" ++ getComponentDeps "camera";
dlib_face_detect = getComponentDeps "image_processing";
dlib_face_identify = getComponentDeps "image_processing";
doorbird = getComponentDeps "camera";
dremel_3d_printer = getComponentDeps "camera";
elevenlabs = getComponentDeps "tts";
elkm1 = getComponentDeps "frontend";
emulated_hue = getComponentDeps "conversation" ++ [
defusedxml
];
emulated_kasa = getComponentDeps "camera" ++ getComponentDeps "conversation";
environment_canada = getComponentDeps "camera";
esphome = getComponentDeps "camera";
fan = getComponentDeps "conversation";
foscam = getComponentDeps "camera";
freebox = getComponentDeps "camera";
fully_kiosk = getComponentDeps "camera";
gardena_bluetooth = getComponentDeps "husqvarna_automower_ble";
geofency = getComponentDeps "assist_pipeline" ++ getComponentDeps "camera";
google_assistant = getComponentDeps "conversation";
google_assistant_sdk = getComponentDeps "conversation" ++ getComponentDeps "frontend";
google_cloud = getComponentDeps "tts";
google_drive = getComponentDeps "frontend";
google_generative_ai_conversation = getComponentDeps "ai_task";
google_translate = getComponentDeps "tts";
govee_ble = [
ibeacon-ble
];
hassio = getComponentDeps "homeassistant_yellow";
gpslogger = getComponentDeps "assist_pipeline" ++ getComponentDeps "camera";
group = getComponentDeps "camera" ++ getComponentDeps "conversation";
hassio = getComponentDeps "frontend" ++ getComponentDeps "homeassistant_yellow";
homeassistant = getComponentDeps "camera" ++ getComponentDeps "conversation";
homeassistant_connect_zbt2 = getComponentDeps "zha";
homeassistant_hardware = getComponentDeps "otbr" ++ getComponentDeps "zha";
homeassistant_sky_connect = getComponentDeps "zha";
homeassistant_yellow = getComponentDeps "zha";
homekit = getComponentDeps "conversation" ++ getComponentDeps "frontend";
homekit_controller = getComponentDeps "camera";
http = getComponentDeps "cloud" ++ getComponentDeps "frontend";
humidifier = getComponentDeps "conversation";
hyperion = getComponentDeps "camera";
ifttt = getComponentDeps "assist_pipeline" ++ getComponentDeps "camera";
image_processing = getComponentDeps "conversation";
intent = getComponentDeps "conversation";
light = getComponentDeps "conversation";
local_file = getComponentDeps "camera";
locative = getComponentDeps "assist_pipeline" ++ getComponentDeps "camera";
logbook = getComponentDeps "alexa";
lovelace = [
pychromecast
];
onboarding = [
lutron_caseta = getComponentDeps "frontend";
mailgun = getComponentDeps "assist_pipeline" ++ getComponentDeps "camera";
marytts = getComponentDeps "tts";
media_player = getComponentDeps "camera" ++ getComponentDeps "conversation";
microsoft = getComponentDeps "tts";
microsoft_face_detect = getComponentDeps "conversation";
microsoft_face_identify = getComponentDeps "conversation";
mjpeg = getComponentDeps "camera";
mobile_app = getComponentDeps "frontend";
motioneye = getComponentDeps "camera";
mqtt = getComponentDeps "camera";
nest = getComponentDeps "camera" ++ [
av
];
number = getComponentDeps "conversation";
octoprint = getComponentDeps "camera";
ollama = getComponentDeps "ai_task";
onboarding = getComponentDeps "tts" ++ [
pymetno
radios
rpi-bad-power
];
onvif = getComponentDeps "camera";
open_router = getComponentDeps "ai_task";
openai_conversation = getComponentDeps "camera";
openalpr_cloud = getComponentDeps "camera" ++ getComponentDeps "conversation";
prosegur = getComponentDeps "camera";
prusalink = getComponentDeps "camera";
push = getComponentDeps "camera";
raspberry_pi = [
rpi-bad-power
];
shelly = [
pyswitchbot
reolink = getComponentDeps "stream";
ring = getComponentDeps "camera";
roku = getComponentDeps "camera";
rss_feed_template = [
defusedxml
];
script = getComponentDeps "frontend" ++ getComponentDeps "mobile_app";
sensor = getComponentDeps "camera" ++ getComponentDeps "conversation";
shelly = getComponentDeps "frontend" ++ getComponentDeps "switchbot";
sighthound = getComponentDeps "conversation" ++ getComponentDeps "image_processing";
skybell = getComponentDeps "camera";
sleep_as_android = getComponentDeps "assist_pipeline" ++ getComponentDeps "camera";
songpal = [
isal
];
swiss_public_transport = getComponentDeps "cookidoo";
switch = getComponentDeps "camera" ++ getComponentDeps "conversation";
switch_as_x = getComponentDeps "camera" ++ getComponentDeps "conversation";
synology_dsm = getComponentDeps "camera";
system_log = [
isal
];
tasmota = getComponentDeps "camera";
todo = getComponentDeps "conversation";
traccar = getComponentDeps "assist_pipeline" ++ getComponentDeps "camera";
trafikverket_camera = getComponentDeps "camera";
tts = getComponentDeps "conversation";
tuya = getComponentDeps "camera";
twilio = getComponentDeps "assist_pipeline" ++ getComponentDeps "camera";
unifiprotect = getComponentDeps "camera";
universal = getComponentDeps "camera" ++ getComponentDeps "conversation";
uvc = getComponentDeps "camera";
voicerss = getComponentDeps "tts";
weather = getComponentDeps "conversation";
websocket_api = getComponentDeps "camera" ++ getComponentDeps "conversation";
xiaomi_miio = [
arrow
];
zeroconf = [
aioshelly
];
zha = [
pydeconz
];
yandextts = getComponentDeps "tts";
zeroconf = getComponentDeps "shelly";
zha = getComponentDeps "deconz" ++ getComponentDeps "frontend";
zwave_js = getComponentDeps "frontend";
};
extraDisabledTestPaths = {
@@ -129,12 +232,12 @@ lib.listToAttrs (
dontInstall = true;
nativeCheckInputs =
old.nativeCheckInputs
old.requirementsTest
++ home-assistant.getPackages component home-assistant.python.pkgs
++ extraCheckInputs.${component} or [ ];
disabledTests = old.disabledTests or [ ] ++ extraDisabledTests.${component} or [ ];
disabledTestPaths = old.disabledTestPaths or [ ] ++ extraDisabledTestPaths.${component} or [ ];
disabledTests = extraDisabledTests.${component} or [ ];
disabledTestPaths = extraDisabledTestPaths.${component} or [ ];
# components are more often racy than the core
dontUsePytestXdist = true;