From f129df86a11183683bcd29b4f7fd421f11355cdf Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 23 Apr 2021 02:00:52 +0200 Subject: [PATCH 1/3] home-assistant: find unstable versions in parse-requirements.py Previously unstable versions would not have been found, because the regular expression was looking for a numeric version after the attribute name. When the version is however an unstable one, it would start with > unstable-2021-04-23 and therefore not match the pattern. --- pkgs/servers/home-assistant/component-packages.nix | 2 +- pkgs/servers/home-assistant/parse-requirements.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index e46a97b6fa9c..fe36bb524c7f 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -90,7 +90,7 @@ "blueprint" = ps: with ps; [ ]; "bluesound" = ps: with ps; [ xmltodict ]; "bluetooth_le_tracker" = ps: with ps; [ ]; # missing inputs: pygatt[GATTTOOL] - "bluetooth_tracker" = ps: with ps; [ bt_proximity ]; # missing inputs: pybluez + "bluetooth_tracker" = ps: with ps; [ bt_proximity pybluez ]; "bme280" = ps: with ps; [ smbus-cffi ]; # missing inputs: i2csense "bme680" = ps: with ps; [ bme680 smbus-cffi ]; "bmp280" = ps: with ps; [ ]; # missing inputs: RPi.GPIO adafruit-circuitpython-bmp280 diff --git a/pkgs/servers/home-assistant/parse-requirements.py b/pkgs/servers/home-assistant/parse-requirements.py index eeb117a984e4..b6ff5662f9e5 100755 --- a/pkgs/servers/home-assistant/parse-requirements.py +++ b/pkgs/servers/home-assistant/parse-requirements.py @@ -124,7 +124,10 @@ def name_to_attr_path(req: str, packages: Dict[str, Dict[str, str]]) -> Optional for name in names: # treat "-" and "_" equally name = re.sub("[-_]", "[-_]", name) - pattern = re.compile("^python\\d\\.\\d-{}-\\d".format(name), re.I) + # python(minor).(major)-(pname)-(version or unstable-date) + # we need the version qualifier, or we'll have multiple matches + # (e.g. pyserial and pyserial-asyncio when looking for pyserial) + pattern = re.compile("^python\\d\\.\\d-{}-(?:\\d|unstable-.*)".format(name), re.I) for attr_path, package in packages.items(): if pattern.match(package["name"]): attr_paths.add(attr_path) From af62869aee1bb7fc7350b080c075030ef49fa138 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 23 Apr 2021 02:12:04 +0200 Subject: [PATCH 2/3] python3Packages.slackclient: fix pname The python package is called slackclient, as can be seen in setup.py for this version. https://github.com/slackapi/python-slack-sdk/blob/v2.9.3/setup.py?rgh-link-date=2021-04-23T00%3A03%3A28Z#L217 This prevented home-assistant tooling from finding the package and providing support for the component. --- pkgs/development/python-modules/slackclient/default.nix | 2 +- pkgs/servers/home-assistant/component-packages.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/slackclient/default.nix b/pkgs/development/python-modules/slackclient/default.nix index 4a3c29272186..cf7b161261ed 100644 --- a/pkgs/development/python-modules/slackclient/default.nix +++ b/pkgs/development/python-modules/slackclient/default.nix @@ -18,7 +18,7 @@ }: buildPythonPackage rec { - pname = "python-slackclient"; + pname = "slackclient"; version = "2.9.3"; disabled = !isPy3k; diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index fe36bb524c7f..65d304fb90be 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -750,7 +750,7 @@ "sky_hub" = ps: with ps; [ ]; # missing inputs: pyskyqhub "skybeacon" = ps: with ps; [ ]; # missing inputs: pygatt[GATTTOOL] "skybell" = ps: with ps; [ skybellpy ]; - "slack" = ps: with ps; [ ]; # missing inputs: slackclient + "slack" = ps: with ps; [ slackclient ]; "sleepiq" = ps: with ps; [ sleepyq ]; "slide" = ps: with ps; [ ]; # missing inputs: goslide-api "sma" = ps: with ps; [ pysma ]; From bf77354e38629a2e2c9bb646bf726e6b19c7c418 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 23 Apr 2021 02:16:35 +0200 Subject: [PATCH 3/3] home-assistant: enable slack component tests --- pkgs/servers/home-assistant/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 2865cd1fe591..1ebc381c6cc2 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -354,6 +354,7 @@ in with py.pkgs; buildPythonApplication rec { "sleepiq" "sma" "sensor" + "slack" "smarttub" "smtp" "smappee"