From 4e657970187ed370138ee02a849be9a1da7ab710 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 6 Feb 2021 04:47:04 +0100 Subject: [PATCH 01/14] home-assistant: enable a lot more component tests We can now track a list of components, that should be integrated into our testsuite run. Their dependencies will automatically be included into the checkInputs by reusing the dependency lookup infrastructure we already have, which is what makes this feasible. --- pkgs/servers/home-assistant/default.nix | 125 ++++++++++++++++++++++-- 1 file changed, 116 insertions(+), 9 deletions(-) diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 8931bf65b5cd..81c3fb9025e1 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -127,6 +127,8 @@ in with py.pkgs; buildPythonApplication rec { yarl ] ++ componentBuildInputs ++ extraBuildInputs; + makeWrapperArgs = lib.optional skipPip "--add-flags --skip-pip"; + # upstream only tests on Linux, so do we. doCheck = stdenv.isLinux; @@ -139,49 +141,151 @@ in with py.pkgs; buildPythonApplication rec { requests-mock # component dependencies pyotp + respx ] ++ 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, - # but we should test very common stuff, like what's in `default_config`. - # https://github.com/home-assistant/core/commits/dev/homeassistant/components/default_config/manifest.json + # We can reasonably test components that don't communicate with any network + # services. Before adding new components to this list make sure we have all + # its dependencies packaged and listed in ./component-packages.nix. componentTests = [ + "alert" "api" + "auth" "automation" + "bayesian" + "binary_sensor" + "caldav" + "calendar" + "camera" + "climate" + "cloud" + "command_line" "config" "configurator" + "conversation" "counter" + "cover" "default_config" "demo" + "derivative" + "device_automation" + "device_sun_light_trigger" + "device_tracker" "dhcp" "discovery" + "emulated_hue" + "esphome" + "fan" + "ffmpeg" + "file" + "filesize" + "filter" + "flux" + "folder" + "folder_watcher" + "fritzbox" + "fritzbox_callmonitor" "frontend" + "generic" + "generic_thermostat" + "geo_json_events" + "geo_location" "group" + "hddtemp" "history" + "history_stats" "homeassistant" + "html5" "http" "hue" + "ifttt" + "image" + "image_processing" + "influxdb" "input_boolean" "input_datetime" "input_text" "input_number" "input_select" + "intent" + "intent_script" + "ipp" + "light" + "local_file" + "local_ip" + "lock" "logbook" + "logentries" "logger" + "lovelace" + "manual" + "manual_mqtt" + "media_player" "media_source" + "met" "mobile_app" + "modbus" + "moon" + "mqtt" + "mqtt_eventstream" + "mqtt_json" + "mqtt_room" + "mqtt_statestream" + "notify" + "number" + "ozw" + "panel_custom" + "panel_iframe" + "persistent_notification" "person" + "prometheus" + "proximity" + "push" + "python_script" + "random" + "recorder" + "rest" + "rest_command" + "rmvtransport" + "rss_feed_template" + "safe_mode" "scene" "script" + "search" "shell_command" + "shopping_list" + "simulated" + "sensor" + "smtp" + "sql" "ssdp" + "stream" "sun" + "switch" "system_health" "system_log" "tag" + "tasmota" + "tcp" + "template" + "threshold" + "time_date" "timer" + "tod" + "tts" + "universal" + "updater" + "upnp" + "uptime" + "vacuum" + "weather" "webhook" "websocket_api" + "wled" + "workday" + "worldclock" "zeroconf" + "zha" "zone" "zwave" ]; @@ -191,13 +295,18 @@ in with py.pkgs; buildPythonApplication rec { "-n 2" # assign tests grouped by file to workers "--dist loadfile" - # don't bulk test all components - "--ignore tests/components" - # pyotp since v2.4.0 complains about the short mock keys, hass pins v2.3.0 - "--ignore tests/auth/mfa_modules/test_notify.py" + # tests are located in tests/ "tests" + # dynamically add packages required for component tests ] ++ map (component: "tests/components/" + component) componentTests; + disabledTestPaths = [ + # don't bulk test all components + "tests/components" + # pyotp since v2.4.0 complains about the short mock keys, hass pins v2.3.0 + "tests/auth/mfa_modules/test_notify.py" + ]; + disabledTests = [ # AssertionError: assert 1 == 0 "test_merge" @@ -213,8 +322,6 @@ in with py.pkgs; buildPythonApplication rec { mkdir /build/media ''; - makeWrapperArgs = lib.optional skipPip "--add-flags --skip-pip"; - passthru = { inherit (py.pkgs) hass-frontend; tests = { From 598bc98ba105e111af3b6a3b415f914fa64d88d4 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 2 Mar 2021 17:56:33 +0100 Subject: [PATCH 02/14] home-assistant: rerun tests failing with RuntimeError The flakyness in home-assistant stems from premature event loop closing, due to race conditions throughout the test suite. > RuntimeError: Event loop is closed They also happen during upstreams testsuite runs, but they silently ignore them, so I don't expect a fix for them in the near future. Alleviate our pains by rerunning tests that fail in this particular way. --- pkgs/servers/home-assistant/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 81c3fb9025e1..f7e0face11a2 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -136,6 +136,7 @@ in with py.pkgs; buildPythonApplication rec { # test infrastructure asynctest pytest-aiohttp + pytest-rerunfailures pytest-xdist pytestCheckHook requests-mock @@ -292,7 +293,10 @@ in with py.pkgs; buildPythonApplication rec { pytestFlagsArray = [ # limit amout of runners to reduce race conditions - "-n 2" + "-n auto" + # retry racy tests that end in "RuntimeError: Event loop is closed" + "--reruns 3" + "--only-rerun RuntimeError" # assign tests grouped by file to workers "--dist loadfile" # tests are located in tests/ From 11d964f6666814bcc3e94d0b829ee4a525c8b282 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 3 Mar 2021 22:21:01 +0100 Subject: [PATCH 03/14] home-assistant: 2021.2.3 -> 2021.3.0 --- .../home-assistant/component-packages.nix | 29 ++++++++++++------- pkgs/servers/home-assistant/default.nix | 26 ++++++++++++----- pkgs/servers/home-assistant/frontend.nix | 4 +-- 3 files changed, 39 insertions(+), 20 deletions(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 042246db04b1..e9788f699545 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -2,7 +2,7 @@ # Do not edit! { - version = "2021.2.3"; + version = "2021.3.0"; components = { "abode" = ps: with ps; [ abodepy ]; "accuweather" = ps: with ps; [ accuweather ]; @@ -12,6 +12,7 @@ "adguard" = ps: with ps; [ adguardhome ]; "ads" = ps: with ps; [ pyads ]; "advantage_air" = ps: with ps; [ advantage-air ]; + "aemet" = ps: with ps; [ ]; # missing inputs: AEMET-OpenData "aftership" = ps: with ps; [ pyaftership ]; "agent_dvr" = ps: with ps; [ agent-py ]; "air_quality" = ps: with ps; [ ]; @@ -120,13 +121,13 @@ "clickatell" = ps: with ps; [ ]; "clicksend" = ps: with ps; [ ]; "clicksend_tts" = ps: with ps; [ ]; + "climacell" = ps: with ps; [ ]; # missing inputs: pyclimacell "climate" = ps: with ps; [ ]; "cloud" = ps: with ps; [ aiohttp-cors hass-nabucasa ]; "cloudflare" = ps: with ps; [ pycfdns ]; "cmus" = ps: with ps; [ ]; # missing inputs: pycmus "co2signal" = ps: with ps; [ ]; # missing inputs: co2signal "coinbase" = ps: with ps; [ ]; # missing inputs: coinbase - "coinmarketcap" = ps: with ps; [ coinmarketcap ]; "color_extractor" = ps: with ps; [ ]; # missing inputs: colorthief "comed_hourly_pricing" = ps: with ps; [ ]; "comfoconnect" = ps: with ps; [ ]; # missing inputs: pycomfoconnect @@ -142,7 +143,6 @@ "cover" = ps: with ps; [ ]; "cppm_tracker" = ps: with ps; [ ]; # missing inputs: clearpasspy "cpuspeed" = ps: with ps; [ py-cpuinfo ]; - "crimereports" = ps: with ps; [ ]; # missing inputs: crimereports "cups" = ps: with ps; [ pycups ]; "currencylayer" = ps: with ps; [ ]; "daikin" = ps: with ps; [ pydaikin ]; @@ -154,7 +154,7 @@ "deconz" = ps: with ps; [ ]; # missing inputs: pydeconz "decora" = ps: with ps; [ bluepy ]; # missing inputs: decora "decora_wifi" = ps: with ps; [ ]; # missing inputs: decora_wifi - "default_config" = ps: with ps; [ pynacl aiohttp-cors defusedxml distro emoji hass-nabucasa netdisco pillow scapy sqlalchemy zeroconf ]; + "default_config" = ps: with ps; [ pynacl aiohttp-cors async-upnp-client defusedxml distro emoji hass-nabucasa netdisco pillow scapy sqlalchemy zeroconf ]; "delijn" = ps: with ps; [ ]; # missing inputs: pydelijn "deluge" = ps: with ps; [ deluge-client ]; "demo" = ps: with ps; [ aiohttp-cors ]; @@ -238,6 +238,7 @@ "everlights" = ps: with ps; [ pyeverlights ]; "evohome" = ps: with ps; [ ]; # missing inputs: evohome-async "ezviz" = ps: with ps; [ ]; # missing inputs: pyezviz + "faa_delays" = ps: with ps; [ faadelays ]; "facebook" = ps: with ps; [ ]; "facebox" = ps: with ps; [ ]; "fail2ban" = ps: with ps; [ ]; @@ -276,7 +277,7 @@ "foscam" = ps: with ps; [ ]; # missing inputs: libpyfoscam "foursquare" = ps: with ps; [ aiohttp-cors ]; "free_mobile" = ps: with ps; [ ]; # missing inputs: freesms - "freebox" = ps: with ps; [ aiohttp-cors netdisco zeroconf ]; # missing inputs: aiofreepybox + "freebox" = ps: with ps; [ aiohttp-cors netdisco zeroconf ]; # missing inputs: freebox-api "freedns" = ps: with ps; [ ]; "fritz" = ps: with ps; [ fritzconnection ]; "fritzbox" = ps: with ps; [ pyfritzhome ]; @@ -421,6 +422,7 @@ "keyboard_remote" = ps: with ps; [ aionotify evdev ]; "kira" = ps: with ps; [ pykira ]; "kiwi" = ps: with ps; [ ]; # missing inputs: kiwiki-client + "kmtronic" = ps: with ps; [ pykmtronic ]; "knx" = ps: with ps; [ xknx ]; "kodi" = ps: with ps; [ ]; # missing inputs: pykodi "konnected" = ps: with ps; [ aiohttp-cors ]; # missing inputs: konnected @@ -446,6 +448,7 @@ "linux_battery" = ps: with ps; [ batinfo ]; "lirc" = ps: with ps; [ ]; # missing inputs: python-lirc "litejet" = ps: with ps; [ ]; # missing inputs: pylitejet + "litterrobot" = ps: with ps; [ ]; # missing inputs: pylitterbot "llamalab_automate" = ps: with ps; [ ]; "local_file" = ps: with ps; [ ]; "local_ip" = ps: with ps; [ ]; @@ -466,6 +469,7 @@ "lutron_caseta" = ps: with ps; [ ]; # missing inputs: aiolip pylutron-caseta "lw12wifi" = ps: with ps; [ ]; # missing inputs: lw12 "lyft" = ps: with ps; [ ]; # missing inputs: lyft_rides + "lyric" = ps: with ps; [ aiohttp-cors aiolyric ]; "magicseaweed" = ps: with ps; [ ]; # missing inputs: magicseaweed "mailbox" = ps: with ps; [ aiohttp-cors ]; "mailgun" = ps: with ps; [ aiohttp-cors ]; # missing inputs: pymailgunner @@ -476,6 +480,7 @@ "mastodon" = ps: with ps; [ ]; # missing inputs: Mastodon.py "matrix" = ps: with ps; [ matrix-client ]; "maxcube" = ps: with ps; [ ]; # missing inputs: maxcube-api + "mazda" = ps: with ps; [ pymazda ]; "mcp23017" = ps: with ps; [ ]; # missing inputs: RPi.GPIO adafruit-circuitpython-mcp230xx "media_extractor" = ps: with ps; [ aiohttp-cors youtube-dl-light ]; "media_player" = ps: with ps; [ aiohttp-cors ]; @@ -519,7 +524,9 @@ "mqtt_room" = ps: with ps; [ aiohttp-cors paho-mqtt ]; "mqtt_statestream" = ps: with ps; [ aiohttp-cors paho-mqtt ]; "msteams" = ps: with ps; [ pymsteams ]; + "mullvad" = ps: with ps; [ mullvad-api ]; "mvglive" = ps: with ps; [ PyMVGLive ]; + "my" = ps: with ps; [ aiohttp-cors pillow ]; "mychevy" = ps: with ps; [ ]; # missing inputs: mychevy "mycroft" = ps: with ps; [ ]; # missing inputs: mycroftapi "myq" = ps: with ps; [ pymyq ]; @@ -560,7 +567,6 @@ "nsw_fuel_station" = ps: with ps; [ ]; # missing inputs: nsw-fuel-api-client "nsw_rural_fire_service_feed" = ps: with ps; [ ]; # missing inputs: aio_geojson_nsw_rfs_incidents "nuheat" = ps: with ps; [ ]; # missing inputs: nuheat - "nuimo_controller" = ps: with ps; [ ]; # missing inputs: --only-binary=all nuimo "nuki" = ps: with ps; [ pynuki ]; "numato" = ps: with ps; [ ]; # missing inputs: numato-gpio "number" = ps: with ps; [ ]; @@ -622,7 +628,7 @@ "ping" = ps: with ps; [ icmplib ]; "pioneer" = ps: with ps; [ ]; "pjlink" = ps: with ps; [ ]; # missing inputs: pypjlink2 - "plaato" = ps: with ps; [ aiohttp-cors ]; + "plaato" = ps: with ps; [ aiohttp-cors hass-nabucasa pyplaato ]; "plant" = ps: with ps; [ sqlalchemy ]; "plex" = ps: with ps; [ aiohttp-cors plexapi plexauth plexwebsocket ]; "plugwise" = ps: with ps; [ plugwise ]; @@ -682,6 +688,7 @@ "ring" = ps: with ps; [ ha-ffmpeg ring-doorbell ]; "ripple" = ps: with ps; [ ]; # missing inputs: python-ripple-api "risco" = ps: with ps; [ pyrisco ]; + "rituals_perfume_genie" = ps: with ps; [ pyrituals ]; "rmvtransport" = ps: with ps; [ PyRMVtransport ]; "rocketchat" = ps: with ps; [ ]; # missing inputs: rocketchat-API "roku" = ps: with ps; [ ]; # missing inputs: rokuecp @@ -749,6 +756,7 @@ "smart_meter_texas" = ps: with ps; [ ]; # missing inputs: smart-meter-texas "smarthab" = ps: with ps; [ ]; # missing inputs: smarthab "smartthings" = ps: with ps; [ aiohttp-cors hass-nabucasa ]; # missing inputs: pysmartapp pysmartthings + "smarttub" = ps: with ps; [ python-smarttub ]; "smarty" = ps: with ps; [ ]; # missing inputs: pysmarty "smhi" = ps: with ps; [ ]; # missing inputs: smhi-pkg "sms" = ps: with ps; [ python-gammu ]; @@ -780,7 +788,7 @@ "sql" = ps: with ps; [ sqlalchemy ]; "squeezebox" = ps: with ps; [ pysqueezebox ]; "srp_energy" = ps: with ps; [ ]; # missing inputs: srpenergy - "ssdp" = ps: with ps; [ aiohttp-cors defusedxml netdisco zeroconf ]; + "ssdp" = ps: with ps; [ aiohttp-cors async-upnp-client defusedxml netdisco zeroconf ]; "starline" = ps: with ps; [ ]; # missing inputs: starline "starlingbank" = ps: with ps; [ ]; # missing inputs: starlingbank "startca" = ps: with ps; [ xmltodict ]; @@ -792,6 +800,7 @@ "stream" = ps: with ps; [ aiohttp-cors av ]; "streamlabswater" = ps: with ps; [ ]; # missing inputs: streamlabswater "stt" = ps: with ps; [ aiohttp-cors ]; + "subaru" = ps: with ps; [ subarulink ]; "suez_water" = ps: with ps; [ ]; # missing inputs: pysuez "sun" = ps: with ps; [ ]; "supervisord" = ps: with ps; [ ]; @@ -805,7 +814,6 @@ "switcher_kis" = ps: with ps; [ aioswitcher ]; "switchmate" = ps: with ps; [ ]; # missing inputs: pySwitchmate "syncthru" = ps: with ps; [ url-normalize ]; # missing inputs: pysyncthru - "synology" = ps: with ps; [ ]; # missing inputs: py-synology "synology_chat" = ps: with ps; [ ]; "synology_dsm" = ps: with ps; [ ]; # missing inputs: synologydsm-api "synology_srm" = ps: with ps; [ ]; # missing inputs: synology-srm @@ -873,7 +881,7 @@ "twinkly" = ps: with ps; [ twinkly-client ]; "twitch" = ps: with ps; [ python-twitch-client ]; "twitter" = ps: with ps; [ twitterapi ]; - "ubus" = ps: with ps; [ ]; + "ubus" = ps: with ps; [ openwrt-ubus-rpc ]; "ue_smart_radio" = ps: with ps; [ ]; "uk_transport" = ps: with ps; [ ]; "unifi" = ps: with ps; [ aiounifi ]; @@ -946,7 +954,6 @@ "xbox" = ps: with ps; [ aiohttp-cors ]; # missing inputs: xbox-webapi "xbox_live" = ps: with ps; [ xboxapi ]; "xeoma" = ps: with ps; [ pyxeoma ]; - "xfinity" = ps: with ps; [ ]; # missing inputs: xfinity-gateway "xiaomi" = ps: with ps; [ ha-ffmpeg ]; "xiaomi_aqara" = ps: with ps; [ pyxiaomigateway aiohttp-cors netdisco zeroconf ]; "xiaomi_miio" = ps: with ps; [ construct python-miio ]; diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index f7e0face11a2..108e2b578aed 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -61,14 +61,14 @@ let extraBuildInputs = extraPackages py.pkgs; # Don't forget to run parse-requirements.py after updating - hassVersion = "2021.2.3"; + hassVersion = "2021.3.0"; in with py.pkgs; buildPythonApplication rec { pname = "homeassistant"; version = assert (componentPackages.version == hassVersion); hassVersion; # check REQUIRED_PYTHON_VER in homeassistant/const.py - disabled = pythonOlder "3.7.1"; + disabled = pythonOlder "3.8"; # don't try and fail to strip 6600+ python files, it takes minutes! dontStrip = true; @@ -80,7 +80,7 @@ in with py.pkgs; buildPythonApplication rec { owner = "home-assistant"; repo = "core"; rev = version; - sha256 = "0s1jcd94wwvmvzq86w8s9dwfvnmjs9l661z9pc6kwgagggjjgd8c"; + sha256 = "19hdsnzrkkw1fihccmfjsgcg1m7l22a19sbmlh2dy272ckbnhj9r"; }; # leave this in, so users don't have to constantly update their downstream patch handling @@ -88,15 +88,15 @@ in with py.pkgs; buildPythonApplication rec { postPatch = '' substituteInPlace setup.py \ + --replace "aiohttp==3.7.4" "aiohttp>=3.7.3" \ --replace "attrs==19.3.0" "attrs>=19.3.0" \ --replace "bcrypt==3.1.7" "bcrypt>=3.1.7" \ - --replace "awesomeversion==21.2.2" "awesomeversion>=21.2.2" \ - --replace "cryptography==3.2" "cryptography" \ + --replace "cryptography==3.3.2" "cryptography" \ --replace "httpx==0.16.1" "httpx>=0.16.1" \ + --replace "jinja2>=2.11.3" "jinja2>=2.11.2" \ --replace "pip>=8.0.3,<20.3" "pip" \ - --replace "pytz>=2020.5" "pytz>=2020.4" \ + --replace "pytz>=2021.1" "pytz>=2020.5" \ --replace "pyyaml==5.4.1" "pyyaml" \ - --replace "requests==2.25.1" "requests>=2.25.0" \ --replace "ruamel.yaml==0.15.100" "ruamel.yaml>=0.15.100" substituteInPlace tests/test_config.py --replace '"/usr"' '"/build/media"' ''; @@ -177,6 +177,7 @@ in with py.pkgs; buildPythonApplication rec { "emulated_hue" "esphome" "fan" + "faa_delays" "ffmpeg" "file" "filesize" @@ -195,6 +196,7 @@ in with py.pkgs; buildPythonApplication rec { "hddtemp" "history" "history_stats" + "homekit_controller" "homeassistant" "html5" "http" @@ -211,6 +213,7 @@ in with py.pkgs; buildPythonApplication rec { "intent" "intent_script" "ipp" + "kmtronic" "light" "local_file" "local_ip" @@ -221,6 +224,7 @@ in with py.pkgs; buildPythonApplication rec { "lovelace" "manual" "manual_mqtt" + "mazda" "media_player" "media_source" "met" @@ -232,6 +236,7 @@ in with py.pkgs; buildPythonApplication rec { "mqtt_json" "mqtt_room" "mqtt_statestream" + "mullvad" "notify" "number" "ozw" @@ -239,6 +244,7 @@ in with py.pkgs; buildPythonApplication rec { "panel_iframe" "persistent_notification" "person" + "plaato" "prometheus" "proximity" "push" @@ -247,6 +253,7 @@ in with py.pkgs; buildPythonApplication rec { "recorder" "rest" "rest_command" + "rituals_perfume_genie" "rmvtransport" "rss_feed_template" "safe_mode" @@ -257,6 +264,7 @@ in with py.pkgs; buildPythonApplication rec { "shopping_list" "simulated" "sensor" + "smarttub" "smtp" "sql" "ssdp" @@ -313,12 +321,16 @@ in with py.pkgs; buildPythonApplication rec { disabledTests = [ # AssertionError: assert 1 == 0 + "test_error_posted_as_event" "test_merge" # ModuleNotFoundError: No module named 'pyqwikswitch' "test_merge_id_schema" # keyring.errors.NoKeyringError: No recommended backend was available. "test_secrets_from_unrelated_fails" "test_secrets_credstash" + # generic/test_camera.py: AssertionError: 500 == 200 + "test_fetching_without_verify_ssl" + "test_fetching_url_with_verify_ssl" ]; preCheck = '' diff --git a/pkgs/servers/home-assistant/frontend.nix b/pkgs/servers/home-assistant/frontend.nix index 812f4d096cef..ac660d87aefd 100644 --- a/pkgs/servers/home-assistant/frontend.nix +++ b/pkgs/servers/home-assistant/frontend.nix @@ -4,11 +4,11 @@ buildPythonPackage rec { # the frontend version corresponding to a specific home-assistant version can be found here # https://github.com/home-assistant/home-assistant/blob/master/homeassistant/components/frontend/manifest.json pname = "home-assistant-frontend"; - version = "20210127.7"; + version = "20210302.3"; src = fetchPypi { inherit pname version; - sha256 = "sha256-N+n1DI1oZ/j+GydH+Du21zTNA6leW4YBri7cAMvAac4="; + sha256 = "sha256-VJVYGg3xJC6npxYWw2h0Rb4jaeriOksN1NvAWVQzK50="; }; # there is nothing to strip in this package From 58b8e6142d4ea955a1175b36a31a9f50d914380d Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 1 Mar 2021 01:41:33 +0100 Subject: [PATCH 04/14] python3Packages.zha-quirks: 0.0.53 -> 0.0.54 --- pkgs/development/python-modules/zha-quirks/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/zha-quirks/default.nix b/pkgs/development/python-modules/zha-quirks/default.nix index 3141f666a63a..bc4599f08fbb 100644 --- a/pkgs/development/python-modules/zha-quirks/default.nix +++ b/pkgs/development/python-modules/zha-quirks/default.nix @@ -9,13 +9,13 @@ buildPythonPackage rec { pname = "zha-quirks"; - version = "0.0.53"; + version = "0.0.54"; src = fetchFromGitHub { owner = "zigpy"; repo = "zha-device-handlers"; rev = version; - sha256 = "16n99r7bjd3lnxn72lfnxg44n7mkv196vdhkw2sf1nq1an4ks1nc"; + sha256 = "1xc4rky9x2n15rsb18vyg4lb2897k14gkz03khgf8gp37bg2dk5h"; }; propagatedBuildInputs = [ aiohttp zigpy ]; From ba2a85549287c6ce9188b8ecb4de7e7ff365b05f Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 3 Mar 2021 23:22:31 +0100 Subject: [PATCH 05/14] python3Packages.zigpy-znp: 0.3.0 -> 0.4.0 --- pkgs/development/python-modules/zigpy-znp/default.nix | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/zigpy-znp/default.nix b/pkgs/development/python-modules/zigpy-znp/default.nix index 1a1c639a4738..2543d0675852 100644 --- a/pkgs/development/python-modules/zigpy-znp/default.nix +++ b/pkgs/development/python-modules/zigpy-znp/default.nix @@ -17,13 +17,13 @@ buildPythonPackage rec { pname = "zigpy-znp"; - version = "0.3.0"; + version = "0.4.0"; src = fetchFromGitHub { owner = "zha-ng"; repo = "zigpy-znp"; rev = "v${version}"; - sha256 = "18dav2n5fqdigf8dl7gcqa9z8l6p2ig6l5q78gqg2wj7wjpncwyj"; + sha256 = "1g5jssdnibhb4i4k1js9iy9w40cipf1gdnyp847x0bv6wblzx8rl"; }; propagatedBuildInputs = [ @@ -45,11 +45,6 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTests = [ - # zigpy-znp was too slow to sync up with the zigpy 0.29 release and has API breakage, remove >0.3.0 - "test_force_remove" - ]; - meta = with lib; { description = "A library for zigpy which communicates with TI ZNP radios"; homepage = "https://github.com/zha-ng/zigpy-znp"; From 7a7b2c47cb821480b48b396be234829d149a0dfe Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 3 Mar 2021 23:30:23 +0100 Subject: [PATCH 06/14] python3Pacakges.pyvera: 0.3.11 -> 0.3.13 --- pkgs/development/python-modules/pyvera/default.nix | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/pyvera/default.nix b/pkgs/development/python-modules/pyvera/default.nix index 4415ca7c376d..2439bd468568 100644 --- a/pkgs/development/python-modules/pyvera/default.nix +++ b/pkgs/development/python-modules/pyvera/default.nix @@ -1,7 +1,6 @@ { lib , buildPythonPackage , fetchFromGitHub -, fetchpatch , poetry-core , pytest-cov , pytest-asyncio @@ -13,24 +12,16 @@ buildPythonPackage rec { pname = "pyvera"; - version = "0.3.11"; + version = "0.3.13"; format = "pyproject"; src = fetchFromGitHub { owner = "pavoni"; repo = pname; rev = version; - sha256 = "0yi2cjd3jag95xa0k24f7d7agi26ywb3219a0j0k8l2nsx2sdi87"; + sha256 = "0vh82bwgbq93jrwi9q4da534paknpak8hxi4wwlxh3qcvnpy1njv"; }; - patches = [ - (fetchpatch { - # build-system section is missing https://github.com/pavoni/pyvera/pull/142 - url = "https://github.com/pavoni/pyvera/pull/142/commits/e90995a8d55107118d324e8cf189ddf1d9e3aa6c.patch"; - sha256 = "1psq3fiwg20kcwyybzh5g17dzn5fh29lhm238npyg846innbzgs7"; - }) - ]; - nativeBuildInputs = [ poetry-core ]; propagatedBuildInputs = [ requests ]; From 71d0d4ddce1e3c7a8090d70a1dbb7ed31898b15e Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 3 Mar 2021 23:53:13 +0100 Subject: [PATCH 07/14] python3Packages.bellows: 0.21.0 -> 0.22.0 --- .../python-modules/bellows/default.nix | 38 +++++++++++++------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/bellows/default.nix b/pkgs/development/python-modules/bellows/default.nix index d47c5d716a73..4371c8c8eaba 100644 --- a/pkgs/development/python-modules/bellows/default.nix +++ b/pkgs/development/python-modules/bellows/default.nix @@ -1,21 +1,40 @@ -{ lib, buildPythonPackage, fetchFromGitHub -, click, click-log, pure-pcapy3 -, pyserial-asyncio, voluptuous, zigpy -, asynctest, pytestCheckHook, pytest-asyncio }: +{ lib +, buildPythonPackage +, fetchFromGitHub +, click +, click-log +, pure-pcapy3 +, pyserial-asyncio +, voluptuous +, zigpy +, asynctest +, pytestCheckHook +, pytest-asyncio +}: buildPythonPackage rec { pname = "bellows"; - version = "0.21.0"; + version = "0.22.0"; src = fetchFromGitHub { owner = "zigpy"; repo = "bellows"; rev = version; - sha256 = "1gja7cb1cyzbi19k8awa2gyc3bjam0adapalpk5slxny0vxlc73a"; + sha256 = "0il2cwnrcvgxx9jkj1xr2caqyza3kqjys3fpmcx7avy04xbf5dbv"; }; + prePatch = '' + substituteInPlace setup.py \ + --replace "click-log==0.2.1" "click-log>=0.2.1" + ''; + propagatedBuildInputs = [ - click click-log pure-pcapy3 pyserial-asyncio voluptuous zigpy + click + click-log + pure-pcapy3 + pyserial-asyncio + voluptuous + zigpy ]; checkInputs = [ @@ -24,11 +43,6 @@ buildPythonPackage rec { pytest-asyncio ]; - prePatch = '' - substituteInPlace setup.py \ - --replace "click-log==0.2.0" "click-log>=0.2.0" - ''; - meta = with lib; { description = "A Python 3 project to implement EZSP for EmberZNet devices"; homepage = "https://github.com/zigpy/bellows"; From 7aaa74bf2fff598513c318fc8ffc50205ae54e67 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 3 Mar 2021 23:57:19 +0100 Subject: [PATCH 08/14] python3Packages.alarmdecoder: 1.13.9 -> 1.13.10 --- pkgs/development/python-modules/alarmdecoder/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/alarmdecoder/default.nix b/pkgs/development/python-modules/alarmdecoder/default.nix index 10438d540816..ee07588b325d 100644 --- a/pkgs/development/python-modules/alarmdecoder/default.nix +++ b/pkgs/development/python-modules/alarmdecoder/default.nix @@ -3,14 +3,14 @@ buildPythonPackage rec { pname = "alarmdecoder"; - version = "1.13.9"; + version = "1.13.10"; disabled = pythonOlder "3.6"; src = fetchFromGitHub { owner = "nutechsoftware"; repo = "alarmdecoder"; rev = version; - sha256 = "0plr2h1qn4ryawbaxf29cfna4wailghhaqy1jcm9kxq6q7b9xqqy"; + sha256 = "05581j78181p6mwbfpbkp5irnrzsvps1lslgqrh7xbdcmz5b2nxd"; }; propagatedBuildInputs = [ pyserial pyftdi pyusb pyopenssl ]; From 842e35e2814c5950db102679aa5ce3cae1a5a250 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 3 Mar 2021 23:57:34 +0100 Subject: [PATCH 09/14] python3Packaegs.adext: 0.3 -> 0.4.1 --- .../development/python-modules/adext/default.nix | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/adext/default.nix b/pkgs/development/python-modules/adext/default.nix index f3818c93188b..12c86bfc8f5f 100644 --- a/pkgs/development/python-modules/adext/default.nix +++ b/pkgs/development/python-modules/adext/default.nix @@ -1,24 +1,26 @@ { lib , buildPythonPackage , fetchPypi +, setuptools-scm , alarmdecoder }: buildPythonPackage rec { pname = "adext"; - version = "0.3"; + version = "0.4.1"; src = fetchPypi { inherit pname version; - sha256 = "184qxw6i5ixnhgkjnby4zwn4jg90mxb8xy9vbg80x5w331p4z50f"; + sha256 = "1yz1rpfvhbf7kfjck5vadbj9rd3bkx5248whaa3impdrjh7vs03x"; }; - postPatch = '' - substituteInPlace setup.py \ - --replace "alarmdecoder==1.13.2" "alarmdecoder>=1.13.2" - ''; + nativeBuildInputs = [ + setuptools-scm + ]; - propagatedBuildInputs = [ alarmdecoder ]; + propagatedBuildInputs = [ + alarmdecoder + ]; # Tests are not published yet doCheck = false; From c7b6d1a466a93f4d63b5bc73866af58d9d878524 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 4 Mar 2021 00:07:11 +0100 Subject: [PATCH 10/14] python3Packages.accuweather: 0.0.11 -> 0.1.0 --- .../python-modules/accuweather/default.nix | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/accuweather/default.nix b/pkgs/development/python-modules/accuweather/default.nix index ed6dcb54377e..da2feef18c83 100644 --- a/pkgs/development/python-modules/accuweather/default.nix +++ b/pkgs/development/python-modules/accuweather/default.nix @@ -1,22 +1,43 @@ -{ aiohttp, buildPythonPackage, fetchFromGitHub, lib, pytest, pytestCheckHook -, pytestcov, pytestrunner, pytest-asyncio, python, pythonOlder }: +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +, pytestrunner +, aiohttp +, aioresponses +, pytestCheckHook +, pytestcov +, pytest-asyncio +}: buildPythonPackage rec { pname = "accuweather"; - version = "0.0.11"; + version = "0.1.0"; - disabled = pythonOlder "3.8"; + disabled = pythonOlder "3.6"; src = fetchFromGitHub { owner = "bieniu"; repo = pname; rev = version; - sha256 = "1sgbw9yldf81phwx6pbvqg9sp767whxymyj0ca9pwx1r6ipr080h"; + sha256 = "0jp2x7fgg1shgr1fx296rni00lmjjmjgg141giljzizgd04dwgy3"; }; + postPatch = '' + # we don't have pytest-error-for-skips packaged + substituteInPlace pytest.ini --replace "--error-for-skips" "" + ''; + nativeBuildInputs = [ pytestrunner ]; + propagatedBuildInputs = [ aiohttp ]; - checkInputs = [ pytestCheckHook pytestcov pytest-asyncio ]; + + checkInputs = [ + aioresponses + pytestCheckHook + pytestcov + pytest-asyncio + ]; meta = with lib; { description = From 63a7edfc2489f9c859ab4b08a074289d2ff23ec3 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 4 Mar 2021 00:16:53 +0100 Subject: [PATCH 11/14] python3Packages.plexapi: 4.3.1 -> 4.4.0 --- pkgs/development/python-modules/plexapi/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/plexapi/default.nix b/pkgs/development/python-modules/plexapi/default.nix index 5251ff1de0ec..810bd1ffed15 100644 --- a/pkgs/development/python-modules/plexapi/default.nix +++ b/pkgs/development/python-modules/plexapi/default.nix @@ -9,14 +9,14 @@ buildPythonPackage rec { pname = "PlexAPI"; - version = "4.3.1"; + version = "4.4.0"; disabled = isPy27; src = fetchFromGitHub { owner = "pkkid"; repo = "python-plexapi"; rev = version; - sha256 = "sha256-gRXNOGd9YGcGysKbAtiNwi5NxPvv39F6PEXBjiYbVq4="; + sha256 = "0wzdzi5afncinavz5g77ximdr9y2ndzwb0gl819n0l6pnvbxdwp2"; }; propagatedBuildInputs = [ From 1050f1487b34270dd9e8f362f54a15f1f5e01d9f Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 6 Mar 2021 02:47:39 +0100 Subject: [PATCH 12/14] nixos/home-assistant: disable tests on the package by default We are running over 6000 tests by now and they take around 5 minutes on faster machines and tests alot of components that endusers will not actually be using. It is sufficient if we run them on package upgrades and in the passthrough test. --- nixos/modules/services/misc/home-assistant.nix | 12 +++++++++--- nixos/tests/home-assistant.nix | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/misc/home-assistant.nix b/nixos/modules/services/misc/home-assistant.nix index 1f2e13f37325..f53c49a1ee6d 100644 --- a/nixos/modules/services/misc/home-assistant.nix +++ b/nixos/modules/services/misc/home-assistant.nix @@ -183,8 +183,14 @@ in { }; package = mkOption { - default = pkgs.home-assistant; - defaultText = "pkgs.home-assistant"; + default = pkgs.home-assistant.overrideAttrs (oldAttrs: { + doInstallCheck = false; + }); + defaultText = literalExample '' + pkgs.home-assistant.overrideAttrs (oldAttrs: { + doInstallCheck = false; + }) + ''; type = types.package; example = literalExample '' pkgs.home-assistant.override { @@ -192,7 +198,7 @@ in { } ''; description = '' - Home Assistant package to use. + Home Assistant package to use. By default the tests are disabled, as they take a considerable amout of time to complete. Override extraPackages or extraComponents in order to add additional dependencies. If you specify and do not set to false, overriding extraComponents will have no effect. diff --git a/nixos/tests/home-assistant.nix b/nixos/tests/home-assistant.nix index 131f50747fef..726c7eb6acb6 100644 --- a/nixos/tests/home-assistant.nix +++ b/nixos/tests/home-assistant.nix @@ -24,6 +24,8 @@ in { services.home-assistant = { inherit configDir; enable = true; + # includes the package with all tests enabled + package = pkgs.home-assistant; config = { homeassistant = { name = "Home"; From 9ad62a752e5a98071eaa22123f505c3180593294 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 6 Mar 2021 03:02:30 +0100 Subject: [PATCH 13/14] home-assistant: 2021.3.0 -> 2021.3.2 --- pkgs/servers/home-assistant/component-packages.nix | 2 +- pkgs/servers/home-assistant/default.nix | 4 ++-- pkgs/servers/home-assistant/frontend.nix | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index e9788f699545..2fec4927e47e 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -2,7 +2,7 @@ # Do not edit! { - version = "2021.3.0"; + version = "2021.3.2"; components = { "abode" = ps: with ps; [ abodepy ]; "accuweather" = ps: with ps; [ accuweather ]; diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 108e2b578aed..fa38b7678564 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -61,7 +61,7 @@ let extraBuildInputs = extraPackages py.pkgs; # Don't forget to run parse-requirements.py after updating - hassVersion = "2021.3.0"; + hassVersion = "2021.3.2"; in with py.pkgs; buildPythonApplication rec { pname = "homeassistant"; @@ -80,7 +80,7 @@ in with py.pkgs; buildPythonApplication rec { owner = "home-assistant"; repo = "core"; rev = version; - sha256 = "19hdsnzrkkw1fihccmfjsgcg1m7l22a19sbmlh2dy272ckbnhj9r"; + sha256 = "09z2sds9my4vq0vmryjpzi7fv787zjfikfkd711d34c140bgcjch"; }; # leave this in, so users don't have to constantly update their downstream patch handling diff --git a/pkgs/servers/home-assistant/frontend.nix b/pkgs/servers/home-assistant/frontend.nix index ac660d87aefd..6a4f4420ff17 100644 --- a/pkgs/servers/home-assistant/frontend.nix +++ b/pkgs/servers/home-assistant/frontend.nix @@ -4,11 +4,11 @@ buildPythonPackage rec { # the frontend version corresponding to a specific home-assistant version can be found here # https://github.com/home-assistant/home-assistant/blob/master/homeassistant/components/frontend/manifest.json pname = "home-assistant-frontend"; - version = "20210302.3"; + version = "20210302.5"; src = fetchPypi { inherit pname version; - sha256 = "sha256-VJVYGg3xJC6npxYWw2h0Rb4jaeriOksN1NvAWVQzK50="; + sha256 = "sha256-+SKXLOuvMYfNyR++uQMMY4M5deRgm2w3AhMM/DP470k="; }; # there is nothing to strip in this package From 6ed2bd99376c7139cdca30a3073c42e720676e9f Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 6 Mar 2021 18:25:08 +0100 Subject: [PATCH 14/14] home-assistant: disable tests getting stuck on aarch64 --- pkgs/servers/home-assistant/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index fa38b7678564..6a922094232f 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -331,6 +331,12 @@ in with py.pkgs; buildPythonApplication rec { # generic/test_camera.py: AssertionError: 500 == 200 "test_fetching_without_verify_ssl" "test_fetching_url_with_verify_ssl" + ] ++ lib.optionals (stdenv.isAarch64) [ + # tests getting stuck on aarch64 + # components/stream/test_hls.py + "test_stream_ended" + # components/stream/test_recorder.py + "test_record_stream" ]; preCheck = ''