From a29518707d829761a8f3b3c33e6cea10eb9d5a4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 25 May 2018 19:41:55 +0200 Subject: [PATCH] home-assistant: support requirements specified by URL --- pkgs/servers/home-assistant/component-packages.nix | 2 +- pkgs/servers/home-assistant/parse-requirements.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 282db5eb8bee..4d970a7e0d5d 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -589,7 +589,7 @@ "media_player.songpal" = ps: with ps; [ ]; "media_player.sonos" = ps: with ps; [ ]; "media_player.soundtouch" = ps: with ps; [ libsoundtouch ]; - "media_player.spotify" = ps: with ps; [ aiohttp-cors ]; + "media_player.spotify" = ps: with ps; [ aiohttp-cors spotipy ]; "media_player.squeezebox" = ps: with ps; [ ]; "media_player.ue_smart_radio" = ps: with ps; [ ]; "media_player.universal" = ps: with ps; [ ]; diff --git a/pkgs/servers/home-assistant/parse-requirements.py b/pkgs/servers/home-assistant/parse-requirements.py index 8415fd17e85a..3b6dccb27bc1 100755 --- a/pkgs/servers/home-assistant/parse-requirements.py +++ b/pkgs/servers/home-assistant/parse-requirements.py @@ -106,6 +106,9 @@ build_inputs = {} for component in sorted(components.keys()): attr_paths = [] for req in sorted(get_reqs(components, component)): + # Some requirements are specified by url, e.g. https://example.org/foobar#xyz==1.0.0 + # Therefore, if there's a "#" in the line, only take the part after it + req = req[req.find('#') + 1:] name = req.split('==')[0] attr_path = name_to_attr_path(name) if attr_path is not None: