From 64572a82cc8c8e60183ed4021c2a1d4b28c16ab1 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 11 Nov 2021 10:18:40 +0100 Subject: [PATCH 1/3] python3Packages.pyuptimerobot: init at 21.11.0 --- .../python-modules/pyuptimerobot/default.nix | 51 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/development/python-modules/pyuptimerobot/default.nix diff --git a/pkgs/development/python-modules/pyuptimerobot/default.nix b/pkgs/development/python-modules/pyuptimerobot/default.nix new file mode 100644 index 000000000000..6334c3f64c08 --- /dev/null +++ b/pkgs/development/python-modules/pyuptimerobot/default.nix @@ -0,0 +1,51 @@ +{ lib +, aiohttp +, aresponses +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +, pytest-asyncio +, pythonOlder +}: + +buildPythonPackage rec { + pname = "pyuptimerobot"; + version = "21.11.0"; + format = "setuptools"; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "ludeeus"; + repo = pname; + rev = version; + sha256 = "1nmmwp9m38b75lz51ypcj0qxnxm9wq4id5cggl0pn2rx6gwnbw9n"; + }; + + propagatedBuildInputs = [ + aiohttp + ]; + + checkInputs = [ + aresponses + pytestCheckHook + pytest-asyncio + ]; + + postPatch = '' + # Upstream doesn't set version in the repo + substituteInPlace setup.py \ + --replace 'version="main",' 'version="${version}",' + ''; + + pythonImportsCheck = [ + "pyuptimerobot" + ]; + + meta = with lib; { + description = "Python API wrapper for Uptime Robot"; + homepage = "https://github.com/ludeeus/pyuptimerobot"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ff164908e448..efd37ea8837d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7766,6 +7766,8 @@ in { pyupgrade = callPackage ../development/python-modules/pyupgrade { }; + pyuptimerobot = callPackage ../development/python-modules/pyuptimerobot { }; + pyusb = callPackage ../development/python-modules/pyusb { inherit (pkgs) libusb1; }; From 32d63aec97c7bcf2f37bddbceb05fc55264213c3 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 11 Nov 2021 10:19:46 +0100 Subject: [PATCH 2/3] home-assistant: update component-packages --- pkgs/servers/home-assistant/component-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index c41791a90540..b58ef3a0d729 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -922,7 +922,7 @@ "updater" = ps: with ps; [ ]; "upnp" = ps: with ps; [ aiohttp-cors async-upnp-client ifaddr zeroconf ]; "uptime" = ps: with ps; [ ]; - "uptimerobot" = ps: with ps; [ ]; # missing inputs: pyuptimerobot + "uptimerobot" = ps: with ps; [ pyuptimerobot ]; "usb" = ps: with ps; [ aiohttp-cors pyserial pyudev ]; "uscis" = ps: with ps; [ ]; # missing inputs: uscisstatus "usgs_earthquakes_feed" = ps: with ps; [ geojson-client ]; From 5bfe45de8bbcb47382e5788ed0040353457b2b39 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 11 Nov 2021 10:23:33 +0100 Subject: [PATCH 3/3] home-assistant: enable uptimerobot 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 affe1e6c205e..c9ddf6c5120d 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -683,6 +683,7 @@ in with py.pkgs; buildPythonApplication rec { # disabled, because it tries to join a multicast group and fails to find a usable network interface # "upnp" "uptime" + "uptimerobot" "usgs_earthquakes_feed" "utility_meter" "uvc"