From 272144218705aee3462408c1ad2ac450fcbd8105 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 7 Oct 2020 20:59:10 +0200 Subject: [PATCH 1/7] python3Packages.voluptuous: 0.11.7 -> 0.12.0 Enable tests by running nosetests during checkPhase. --- pkgs/development/python-modules/voluptuous/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/voluptuous/default.nix b/pkgs/development/python-modules/voluptuous/default.nix index 6dd8ab86938..4d5b5d48fda 100644 --- a/pkgs/development/python-modules/voluptuous/default.nix +++ b/pkgs/development/python-modules/voluptuous/default.nix @@ -2,14 +2,17 @@ buildPythonPackage rec { pname = "voluptuous"; - version = "0.11.7"; + version = "0.12.0"; src = fetchPypi { inherit pname version; - sha256 = "0mplkcpb5d8wjf8vk195fys4y6a3wbibiyf708imw33lphfk9g1a"; + sha256 = "1p5j3fgbpqj31fajkaisdrz10ah9667sijz4kp3m0sbgw6ag4kis"; }; checkInputs = [ nose ]; + checkPhase = '' + nosetests + ''; meta = with stdenv.lib; { description = "Voluptuous is a Python data validation library"; From 9cf3b6a4735d74ffa0eb7aa81f75686e84768654 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 7 Oct 2020 20:28:25 +0200 Subject: [PATCH 2/7] homeassistant: 0.115.6 -> 0.116.0 --- .../home-assistant/component-packages.nix | 13 ++++++---- pkgs/servers/home-assistant/default.nix | 15 ++++++------ .../home-assistant/fix-media-path-test.patch | 24 ------------------- pkgs/servers/home-assistant/frontend.nix | 4 ++-- .../home-assistant/relax-dependencies.patch | 21 ---------------- 5 files changed, 17 insertions(+), 60 deletions(-) delete mode 100644 pkgs/servers/home-assistant/fix-media-path-test.patch delete mode 100644 pkgs/servers/home-assistant/relax-dependencies.patch diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 21fe6e0d003..f2f188ce264 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 = "0.115.6"; + version = "0.116.0"; components = { "abode" = ps: with ps; [ abodepy ]; "accuweather" = ps: with ps; [ ]; # missing inputs: accuweather @@ -303,6 +303,7 @@ "glances" = ps: with ps; [ ]; # missing inputs: glances_api "gntp" = ps: with ps; [ ]; # missing inputs: gntp "goalfeed" = ps: with ps; [ ]; # missing inputs: pysher + "goalzero" = ps: with ps; [ ]; # missing inputs: goalzero "gogogate2" = ps: with ps; [ ]; # missing inputs: gogogate2-api "google" = ps: with ps; [ google_api_python_client httplib2 oauth2client ]; "google_assistant" = ps: with ps; [ aiohttp-cors ]; @@ -364,7 +365,7 @@ "hunterdouglas_powerview" = ps: with ps; [ ]; # missing inputs: aiopvapi "hvv_departures" = ps: with ps; [ ]; # missing inputs: pygti "hydrawise" = ps: with ps; [ ]; # missing inputs: hydrawiser - "hyperion" = ps: with ps; [ ]; + "hyperion" = ps: with ps; [ ]; # missing inputs: hyperion-py "ialarm" = ps: with ps; [ ]; # missing inputs: pyialarm "iammeter" = ps: with ps; [ ]; # missing inputs: iammeter "iaqualink" = ps: with ps; [ ]; # missing inputs: iaqualink @@ -565,7 +566,8 @@ "oem" = ps: with ps; [ ]; # missing inputs: oemthermostat "ohmconnect" = ps: with ps; [ defusedxml ]; "ombi" = ps: with ps; [ ]; # missing inputs: pyombi - "onboarding" = ps: with ps; [ aiohttp-cors pillow ]; + "omnilogic" = ps: with ps; [ ]; # missing inputs: omnilogic + "onboarding" = ps: with ps; [ aiohttp-cors pillow ]; # missing inputs: home-assistant-frontend "onewire" = ps: with ps; [ ]; # missing inputs: pyownet "onkyo" = ps: with ps; [ onkyo-eiscp ]; "onvif" = ps: with ps; [ ha-ffmpeg ]; # missing inputs: WSDiscovery onvif-zeep-async @@ -682,6 +684,7 @@ "rpi_gpio" = ps: with ps; [ ]; # missing inputs: RPi.GPIO "rpi_gpio_pwm" = ps: with ps; [ ]; # missing inputs: pwmled "rpi_pfio" = ps: with ps; [ ]; # missing inputs: pifacecommon pifacedigitalio + "rpi_power" = ps: with ps; [ ]; # missing inputs: rpi-bad-power "rpi_rf" = ps: with ps; [ ]; # missing inputs: rpi-rf "rss_feed_template" = ps: with ps; [ aiohttp-cors ]; "rtorrent" = ps: with ps; [ ]; @@ -762,7 +765,7 @@ "spc" = ps: with ps; [ ]; # missing inputs: pyspcwebgw "speedtestdotnet" = ps: with ps; [ speedtest-cli ]; "spider" = ps: with ps; [ ]; # missing inputs: spiderpy - "splunk" = ps: with ps; [ ]; + "splunk" = ps: with ps; [ ]; # missing inputs: hass_splunk "spotcrime" = ps: with ps; [ ]; # missing inputs: spotcrime "spotify" = ps: with ps; [ aiohttp-cors spotipy ]; "sql" = ps: with ps; [ sqlalchemy ]; @@ -809,7 +812,6 @@ "tautulli" = ps: with ps; [ ]; # missing inputs: pytautulli "tcp" = ps: with ps; [ ]; "ted5000" = ps: with ps; [ xmltodict ]; - "teksavvy" = ps: with ps; [ ]; "telegram" = ps: with ps; [ pysocks aiohttp-cors python-telegram-bot ]; "telegram_bot" = ps: with ps; [ pysocks aiohttp-cors python-telegram-bot ]; "tellduslive" = ps: with ps; [ ]; # missing inputs: tellduslive @@ -957,6 +959,7 @@ "zha" = ps: with ps; [ bellows pyserial zha-quirks zigpy-cc zigpy-deconz zigpy-xbee zigpy-zigate zigpy ]; # missing inputs: zigpy-znp "zhong_hong" = ps: with ps; [ ]; # missing inputs: zhong_hong_hvac "ziggo_mediabox_xl" = ps: with ps; [ ]; # missing inputs: ziggo-mediabox-xl + "zodiac" = ps: with ps; [ ]; "zone" = ps: with ps; [ ]; "zoneminder" = ps: with ps; [ zm-py ]; "zwave" = ps: with ps; [ homeassistant-pyozw pydispatcher ]; diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 92fb7dffd29..90f2d65e7be 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -68,18 +68,14 @@ let extraBuildInputs = extraPackages py.pkgs; # Don't forget to run parse-requirements.py after updating - hassVersion = "0.115.6"; + hassVersion = "0.116.0"; in with py.pkgs; buildPythonApplication rec { pname = "homeassistant"; version = assert (componentPackages.version == hassVersion); hassVersion; - disabled = pythonOlder "3.5"; - - patches = [ - ./relax-dependencies.patch - ./fix-media-path-test.patch - ]; + # check REQUIRED_PYTHON_VER in homeassistant/const.py + disabled = pythonOlder "3.7.1"; inherit availableComponents; @@ -88,12 +84,15 @@ in with py.pkgs; buildPythonApplication rec { owner = "home-assistant"; repo = "core"; rev = version; - sha256 = "07j54glcpa5ngkr0pwdg44f8gas3jz3nh653mr5sb5wg7xspgcr8"; + sha256 = "1bqpk9dpra53yhasmp0yb7kzmfwdvlhb7jrf6wyv12rwzf8wy5w7"; }; postPatch = '' substituteInPlace setup.py \ + --replace "cryptography==2.9.2" "cryptography" \ + --replace "ruamel.yaml==0.15.100" "ruamel.yaml>=0.15.100" \ --replace "yarl==1.4.2" "yarl~=1.4" + substituteInPlace tests/test_config.py --replace '"/usr"' '"/build/media"' ''; propagatedBuildInputs = [ diff --git a/pkgs/servers/home-assistant/fix-media-path-test.patch b/pkgs/servers/home-assistant/fix-media-path-test.patch deleted file mode 100644 index 558fabfe344..00000000000 --- a/pkgs/servers/home-assistant/fix-media-path-test.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/tests/test_config.py b/tests/test_config.py -index fb22ee1118..1b87e32fe7 100644 ---- a/tests/test_config.py -+++ b/tests/test_config.py -@@ -440,7 +440,7 @@ async def test_loading_configuration(hass): - "allowlist_external_dirs": "/etc", - "external_url": "https://www.example.com", - "internal_url": "http://example.local", -- "media_dirs": {"mymedia": "/usr"}, -+ "media_dirs": {"mymedia": "/build/media"}, - }, - ) - -@@ -454,8 +454,8 @@ async def test_loading_configuration(hass): - assert hass.config.internal_url == "http://example.local" - assert len(hass.config.allowlist_external_dirs) == 3 - assert "/etc" in hass.config.allowlist_external_dirs -- assert "/usr" in hass.config.allowlist_external_dirs -- assert hass.config.media_dirs == {"mymedia": "/usr"} -+ assert "/build/media" in hass.config.allowlist_external_dirs -+ assert hass.config.media_dirs == {"mymedia": "/build/media"} - assert hass.config.config_source == config_util.SOURCE_YAML - - diff --git a/pkgs/servers/home-assistant/frontend.nix b/pkgs/servers/home-assistant/frontend.nix index 493c1a44107..c2c2fca0b6e 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 = "20200918.2"; + version = "20201001.1"; src = fetchPypi { inherit pname version; - sha256 = "1gmk5rbfyqanj30dinfphxrsji4l1yiya2p0ahybyjb9fbzz9cl4"; + sha256 = "0y24017jdbhc7yh8r3c97qk7ygcjlg0b5r3p2j4yqipk213jp5nl"; }; # no Python tests implemented diff --git a/pkgs/servers/home-assistant/relax-dependencies.patch b/pkgs/servers/home-assistant/relax-dependencies.patch deleted file mode 100644 index d06a37352f6..00000000000 --- a/pkgs/servers/home-assistant/relax-dependencies.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/setup.py b/setup.py -index 81f8727ed6..12200e0b9f 100755 ---- a/setup.py -+++ b/setup.py -@@ -43,13 +43,13 @@ REQUIRES = [ - "jinja2>=2.11.1", - "PyJWT==1.7.1", - # PyJWT has loose dependency. We want the latest one. -- "cryptography==2.9.2", -+ "cryptography>=2.9.2", - "pip>=8.0.3", - "python-slugify==4.0.1", - "pytz>=2020.1", - "pyyaml==5.3.1", -- "requests==2.24.0", -- "ruamel.yaml==0.15.100", -+ "requests>=2.23.0", -+ "ruamel.yaml>=0.15.100", - "voluptuous==0.11.7", - "voluptuous-serialize==2.4.0", - "yarl==1.4.2", From 53d04173e02238e4085788476bd185a307d44a4e Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 8 Oct 2020 01:27:42 +0200 Subject: [PATCH 3/7] home-assistant: convert tests to pytestCheckHook Enables testing in parallel. This cuts down the test phase from over five to under one minute on my 6C/12T processor. Sadly while the upstream runs their tests using `-n auto` this isn't working for us in all cases. I currently assume they use low concurrency in their CI, which is not triggering these issues.. --- pkgs/servers/home-assistant/default.nix | 100 ++++++++++++++++++------ 1 file changed, 76 insertions(+), 24 deletions(-) diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 90f2d65e7be..8ccc2b1dd2b 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -10,15 +10,12 @@ # self: super: { pkg = super.pkg.overridePythonAttrs (oldAttrs: { ... }); } # Applied after defaultOverrides , packageOverrides ? self: super: { - # TODO: Remove this override after updating to cryptography 2.8: - } # Skip pip install of required packages on startup , skipPip ? true }: let - defaultOverrides = [ # Override the version of some packages pinned in Home Assistant's setup.py @@ -87,6 +84,14 @@ in with py.pkgs; buildPythonApplication rec { sha256 = "1bqpk9dpra53yhasmp0yb7kzmfwdvlhb7jrf6wyv12rwzf8wy5w7"; }; + patches = [ + (fetchpatch { + # Fix group tests when run in parallel, remove >= 0.117.0 + url = "https://github.com/home-assistant/core/pull/41446/commits/c79dc478b7136b6df43707bf0ad6b53419c8a909.patch"; + sha256 = "1cl81swq960vd2f733dcqq60c0jjzrkm0l2sibcblhmyw597b4vj"; + }) + ]; + postPatch = '' substituteInPlace setup.py \ --replace "cryptography==2.9.2" "cryptography" \ @@ -100,37 +105,84 @@ in with py.pkgs; buildPythonApplication rec { aiohttp astral async-timeout attrs bcrypt certifi importlib-metadata jinja2 pyjwt cryptography pip python-slugify pytz pyyaml requests ruamel_yaml setuptools voluptuous voluptuous-serialize - # From frontend, image, http and recorder components and auth.mfa_modules.totp - sqlalchemy aiohttp-cors hass-frontend pillow pyotp pyqrcode ciso8601 + # From default_config. frontend, http, image, mobile_app and recorder components as well as + # the auth.mfa_modules.totp module + aiohttp-cors ciso8601 defusedxml distro emoji hass-frontend pynacl pillow pyotp + pyqrcode sqlalchemy ] ++ componentBuildInputs ++ extraBuildInputs; # upstream only tests on Linux, so do we. doCheck = stdenv.isLinux; checkInputs = [ - asynctest pytest pytest-aiohttp requests-mock hass-nabucasa netdisco pydispatcher + asynctest pytestCheckHook pytest-aiohttp pytest_xdist requests-mock hass-nabucasa netdisco pydispatcher ]; - checkPhase = '' + # 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`. + componentTests = [ + "api" + "automation" + "config" + "configurator" + "default_config" + "demo" + "discovery" + "frontend" + "group" + "history" + "homeassistant" + "http" + "input_boolean" + "input_datetime" + "input_text" + "input_number" + "input_select" + "logbook" + "logger" + "media_source" + "mobile_app" + "person" + "scene" + "script" + "shell_command" + "ssdp" + "sun" + "system_health" + "system_log" + "tag" + "websocket_api" + "zeroconf" + "zone" + ]; + + pytestFlagsArray = [ + "-n auto" + # don't bulk test all components + "--ignore tests/components" + # prone to race conditions due to parallel file access + "--ignore tests/test_config.py" + # tries to import unpackaged dependencies + "--ignore tests/test_loader.py" + # 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" + ] ++ map (component: "tests/components/" + component) componentTests; + + disabledTests = [ + # AssertionError: merge_log_err.call_count != 0 + "test_merge" + # ModuleNotFoundError: No module named 'pyqwikswitch' + "test_merge_id_schema" + # AssertionError: assert 'unknown' == 'not_home' + "test_device_tracker_not_home" + # Racy https://github.com/home-assistant/core/issues/41425 + "test_cached_event_message" + ]; + + preCheck = '' # the tests require the existance of a media dir mkdir /build/media - - # - components' dependencies are not included, so they cannot be tested - # - test_merge_id_schema requires pyqwikswitch - # - test_loader.py tries to load not-packaged dependencies - # - test_notify pyotp doesn't like the short mock keys - # - unclear why test_merge fails: assert merge_log_err.call_count != 0 - # - test_setup_safe_mode_if_no_frontend: requires dependencies for components we have not packaged - py.test \ - --ignore tests/components \ - --ignore tests/test_loader.py \ - --ignore tests/auth/mfa_modules/test_notify.py \ - -k "not test_setup_safe_mode_if_no_frontend and not test_merge_id_schema and not test_merge" - - # Some basic components should be tested however - py.test \ - tests/components/{api,config,configurator,demo,discovery,frontend,group,history} \ - tests/components/{homeassistant,http,logger,script,shell_command,system_log,websocket_api} ''; makeWrapperArgs = lib.optional skipPip "--add-flags --skip-pip"; From 41331908ac9b530914a5c21d9ad3ab7aad8cf39b Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 8 Oct 2020 19:28:37 +0200 Subject: [PATCH 4/7] homeassistant: 0.116.0 -> 0.116.1 --- 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 f2f188ce264..02c8f0fe5b5 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 = "0.116.0"; + version = "0.116.1"; components = { "abode" = ps: with ps; [ abodepy ]; "accuweather" = ps: with ps; [ ]; # missing inputs: accuweather diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 8ccc2b1dd2b..c28007317e4 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -65,7 +65,7 @@ let extraBuildInputs = extraPackages py.pkgs; # Don't forget to run parse-requirements.py after updating - hassVersion = "0.116.0"; + hassVersion = "0.116.1"; in with py.pkgs; buildPythonApplication rec { pname = "homeassistant"; @@ -81,7 +81,7 @@ in with py.pkgs; buildPythonApplication rec { owner = "home-assistant"; repo = "core"; rev = version; - sha256 = "1bqpk9dpra53yhasmp0yb7kzmfwdvlhb7jrf6wyv12rwzf8wy5w7"; + sha256 = "182iw9dbz15zj47npvpxp531q3wdw81qnsy663d2bkvqlqszbiw5"; }; patches = [ diff --git a/pkgs/servers/home-assistant/frontend.nix b/pkgs/servers/home-assistant/frontend.nix index c2c2fca0b6e..8dd99d94ee0 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 = "20201001.1"; + version = "20201001.2"; src = fetchPypi { inherit pname version; - sha256 = "0y24017jdbhc7yh8r3c97qk7ygcjlg0b5r3p2j4yqipk213jp5nl"; + sha256 = "1wyac980d8j8bk4bzh9y3a5c4xqfn3062wj5m45kwsx1f5rfx26j"; }; # no Python tests implemented From 94515128c3bb27fb7bb7a73cf9d7acc76e649f40 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 8 Oct 2020 23:13:48 +0200 Subject: [PATCH 5/7] home-assistant: clean up dependencies --- pkgs/servers/home-assistant/default.nix | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index c28007317e4..7f675db39d4 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -19,18 +19,20 @@ let defaultOverrides = [ # Override the version of some packages pinned in Home Assistant's setup.py - # required by the sun/moon plugins + # Pinned due to API changes in astral>=2.0, required by the sun/moon plugins # https://github.com/home-assistant/core/issues/36636 (mkOverride "astral" "1.10.1" "d2a67243c4503131c856cafb1b1276de52a86e5b8a1d507b7e08bee51cb67bf1") - # We have 3.x in nixpkgs which is incompatible with home-assistant atm: - # https://github.com/home-assistant/core/blob/dev/requirements_all.txt + # Pinned due to an API change in pyowm>=3.0 + # Remove after https://github.com/home-assistant/core/pull/39839 gets merged (mkOverride "pyowm" "2.10.0" "1xvcv3sbcn9na8cwz21nnjlixysfk5lymnf65d1nqkbgacc1mm4g") - (mkOverride "bcrypt" "3.1.7" - "0hhywhxx301cxivgxrpslrangbfpccc8y83qbwn1f57cab3nj00b") + # Pinned, because v1.5.0 broke the google_translate integration + # https://github.com/home-assistant/core/pull/38428 + (mkOverride "yarl" "1.4.2" + "0jzpgrdl6415zzl8js7095q8ks14555lhgxah76mimffkr39rkaq") # hass-frontend does not exist in python3.pkgs (self: super: { @@ -94,20 +96,20 @@ in with py.pkgs; buildPythonApplication rec { postPatch = '' substituteInPlace setup.py \ + --replace "bcrypt==3.1.7" "bcrypt>=3.1.7" \ --replace "cryptography==2.9.2" "cryptography" \ - --replace "ruamel.yaml==0.15.100" "ruamel.yaml>=0.15.100" \ - --replace "yarl==1.4.2" "yarl~=1.4" + --replace "ruamel.yaml==0.15.100" "ruamel.yaml>=0.15.100" substituteInPlace tests/test_config.py --replace '"/usr"' '"/build/media"' ''; propagatedBuildInputs = [ # From setup.py - aiohttp astral async-timeout attrs bcrypt certifi importlib-metadata jinja2 + aiohttp astral async-timeout attrs bcrypt certifi ciso8601 jinja2 pyjwt cryptography pip python-slugify pytz pyyaml requests ruamel_yaml - setuptools voluptuous voluptuous-serialize + setuptools voluptuous voluptuous-serialize yarl # From default_config. frontend, http, image, mobile_app and recorder components as well as # the auth.mfa_modules.totp module - aiohttp-cors ciso8601 defusedxml distro emoji hass-frontend pynacl pillow pyotp + aiohttp-cors defusedxml distro emoji hass-frontend pynacl pillow pyotp pyqrcode sqlalchemy ] ++ componentBuildInputs ++ extraBuildInputs; From 5a9a3143fc41d1c17bdb93b174a76cd909c64129 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 9 Oct 2020 16:54:53 +0200 Subject: [PATCH 6/7] homeassistant: 0.116.1 -> 0.116.2 --- pkgs/servers/home-assistant/component-packages.nix | 2 +- pkgs/servers/home-assistant/default.nix | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 02c8f0fe5b5..8e7533dbfb9 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 = "0.116.1"; + version = "0.116.2"; components = { "abode" = ps: with ps; [ abodepy ]; "accuweather" = ps: with ps; [ ]; # missing inputs: accuweather diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 7f675db39d4..90b76ef3984 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -67,7 +67,7 @@ let extraBuildInputs = extraPackages py.pkgs; # Don't forget to run parse-requirements.py after updating - hassVersion = "0.116.1"; + hassVersion = "0.116.2"; in with py.pkgs; buildPythonApplication rec { pname = "homeassistant"; @@ -83,7 +83,7 @@ in with py.pkgs; buildPythonApplication rec { owner = "home-assistant"; repo = "core"; rev = version; - sha256 = "182iw9dbz15zj47npvpxp531q3wdw81qnsy663d2bkvqlqszbiw5"; + sha256 = "0q4yqcikkph05mkvg160664lyf0f1qkpm7yc6kh9hgigambxi0yp"; }; patches = [ From 657c387464585bce1ac031b51b2098ebd85efafb Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 9 Oct 2020 17:10:28 +0200 Subject: [PATCH 7/7] pythonPackages.yeelight: 0.5.3 -> 0.5.4 Use pytestCheckhook for testing. --- .../python-modules/yeelight/default.nix | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/yeelight/default.nix b/pkgs/development/python-modules/yeelight/default.nix index 4cc7056da19..443b4daec85 100644 --- a/pkgs/development/python-modules/yeelight/default.nix +++ b/pkgs/development/python-modules/yeelight/default.nix @@ -1,17 +1,38 @@ -{ stdenv, fetchPypi, buildPythonPackage, future, enum-compat }: +{ lib +, fetchgit +, buildPythonPackage +, pythonOlder +, enum-compat +, future +, ifaddr +, mock +, pytestCheckHook +}: buildPythonPackage rec { pname = "yeelight"; - version = "0.5.3"; + version = "0.5.4"; - src = fetchPypi { - inherit pname version; - sha256 = "8d49846f0cede1e312cbcd1d0e44c42073910bbcadb31b87ce2a7d24dea3af38"; + src = fetchgit { + url = "https://gitlab.com/stavros/python-yeelight.git"; + rev = "119faeff0d4f9de8c7f6d0580bdecc1c79bcdaea"; # v0.5.4 wasn't tagged + sha256 = "0j2c5pzd3kny7ghr9q7xn9vs8dffvyzz5igaavvvd04w7aph29sy"; }; - propagatedBuildInputs = [ future enum-compat ]; + propagatedBuildInputs = [ + future + ifaddr + ] ++ lib.optional (pythonOlder "3.4") enum-compat; - meta = with stdenv.lib; { + checkInputs = [ + pytestCheckHook + ] ++ lib.optional (pythonOlder "3.3") mock; + + pytestFlagsArray = [ "yeelight/tests.py" ]; + + pythonImportsCheck = [ "yeelight" ]; + + meta = with lib; { description = "A Python library for controlling YeeLight RGB bulbs"; homepage = "https://gitlab.com/stavros/python-yeelight/"; license = licenses.asl20;