home-assistant: improve checkInputs package selection (#111921)

and migrate unnecessary packages out of propagatedBuildInputs. This
shrinks the whole package by ~65%.

/nix/store/wdhqcxhp45p287zknw3r0cv7pxgp6r14-homeassistant-2021.2.0	 696.7M
/nix/store/1v20wdqfn4v1nf3v2jmlkx89q18n8fzx-homeassistant-2021.2.0	 250.8M
This commit is contained in:
Martin Weinelt 2021-02-04 17:36:21 +01:00 committed by GitHub
parent 07cc794f57
commit 1054c03d96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,22 +96,43 @@ in with py.pkgs; buildPythonApplication rec {
''; '';
propagatedBuildInputs = [ propagatedBuildInputs = [
# From setup.py # Only packages required in setup.py + hass-frontend
aiohttp astral async-timeout attrs bcrypt certifi ciso8601 httpx jinja2 aiohttp
pyjwt cryptography pip python-slugify pytz pyyaml requests ruamel_yaml astral
setuptools voluptuous voluptuous-serialize yarl async-timeout
# From default_config. dhcp, frontend, http, image, mobile_app and attrs
# recorder components as well as the auth.mfa_modules.totp module bcrypt
aiohttp-cors aiohue defusedxml distro emoji hass-frontend pynacl pillow pyotp certifi
pyqrcode scapy sqlalchemy python-openzwave-mqtt ciso8601
cryptography
hass-frontend
httpx
jinja2
pip
pyjwt
python-slugify
pytz
pyyaml
requests
ruamel_yaml
voluptuous
voluptuous-serialize
yarl
] ++ componentBuildInputs ++ extraBuildInputs; ] ++ componentBuildInputs ++ extraBuildInputs;
# upstream only tests on Linux, so do we. # upstream only tests on Linux, so do we.
doCheck = stdenv.isLinux; doCheck = stdenv.isLinux;
checkInputs = [ checkInputs = [
asynctest pytestCheckHook pytest-aiohttp pytest_xdist requests-mock hass-nabucasa netdisco pydispatcher # test infrastructure
]; asynctest
pytest-aiohttp
pytest-xdist
pytestCheckHook
requests-mock
# component dependencies
pyotp
] ++ lib.concatMap (component: getPackages component py.pkgs) componentTests;
# We cannot test all components, since they'd introduce lots of dependencies, some of which are unpackaged, # We cannot test all components, since they'd introduce lots of dependencies, some of which are unpackaged,
# but we should test very common stuff, like what's in `default_config`. # but we should test very common stuff, like what's in `default_config`.
@ -131,6 +152,7 @@ in with py.pkgs; buildPythonApplication rec {
"history" "history"
"homeassistant" "homeassistant"
"http" "http"
"hue"
"input_boolean" "input_boolean"
"input_datetime" "input_datetime"
"input_text" "input_text"
@ -154,6 +176,7 @@ in with py.pkgs; buildPythonApplication rec {
"websocket_api" "websocket_api"
"zeroconf" "zeroconf"
"zone" "zone"
"zwave"
]; ];
pytestFlagsArray = [ pytestFlagsArray = [