summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2021-02-18 21:28:54 +0100
committerGitHub <noreply@github.com>2021-02-18 21:28:54 +0100
commit2f5e4503524906e4b973e7af45c5145ef0f08d52 (patch)
tree1eb7fd53af36b8b7998f347d82ef0bd1cc7cadb0 /pkgs
parent3363d4a92a7b4894812812f312dbf2f78a7fc798 (diff)
parent66c013566921d770ac842ff0cb23141bcfb8d34d (diff)
downloadnixpkgs-2f5e4503524906e4b973e7af45c5145ef0f08d52.tar
nixpkgs-2f5e4503524906e4b973e7af45c5145ef0f08d52.tar.gz
nixpkgs-2f5e4503524906e4b973e7af45c5145ef0f08d52.tar.bz2
nixpkgs-2f5e4503524906e4b973e7af45c5145ef0f08d52.tar.lz
nixpkgs-2f5e4503524906e4b973e7af45c5145ef0f08d52.tar.xz
nixpkgs-2f5e4503524906e4b973e7af45c5145ef0f08d52.tar.zst
nixpkgs-2f5e4503524906e4b973e7af45c5145ef0f08d52.zip
Merge pull request #110587 from fabaff/aioasuswrt
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/aioasuswrt/default.nix52
-rw-r--r--pkgs/servers/home-assistant/component-packages.nix2
-rw-r--r--pkgs/top-level/python-packages.nix4
3 files changed, 56 insertions, 2 deletions
diff --git a/pkgs/development/python-modules/aioasuswrt/default.nix b/pkgs/development/python-modules/aioasuswrt/default.nix
new file mode 100644
index 00000000000..0e25ab3581a
--- /dev/null
+++ b/pkgs/development/python-modules/aioasuswrt/default.nix
@@ -0,0 +1,52 @@
+{ lib
+, asyncssh
+, buildPythonPackage
+, fetchFromGitHub
+, fetchpatch
+, pytest-asyncio
+, pytest-mock
+, pytestCheckHook
+}:
+
+buildPythonPackage rec {
+  pname = "aioasuswrt";
+  version = "1.3.2";
+
+  src = fetchFromGitHub {
+    owner = "kennedyshead";
+    repo = pname;
+    rev = "V${version}";
+    sha256 = "0bzl11224vny4p9vhi1n5s9p04kfavdzs9xkq5qimbisz9sg4ysj";
+  };
+
+  patches = [
+    (fetchpatch {
+      # Remove pytest-runner, https://github.com/kennedyshead/aioasuswrt/pull/63
+      url = "https://github.com/kennedyshead/aioasuswrt/pull/63/commits/e7923927648d5d8daccac1716db86db2a45fcb34.patch";
+      sha256 = "09xzs3hjr3133li6b7lr58n090r00kaxi9hx1fms2zn0ai4xwp9d";
+    })
+  ];
+
+  postPatch = ''
+    substituteInPlace setup.cfg \
+      --replace "--cov-report html" "" \
+      --replace "--cov-report term-missing" ""
+  '';
+
+  propagatedBuildInputs = [ asyncssh ];
+
+  checkInputs = [
+    pytest-asyncio
+    pytest-mock
+    pytestCheckHook
+  ];
+
+  pythonImportsCheck = [ "aioasuswrt" ];
+
+  meta = with lib; {
+    description = "Python module for Asuswrt";
+    homepage = "https://github.com/kennedyshead/aioasuswrt";
+    license = with licenses; [ mit ];
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix
index 68d42d161e5..ce7fbfb6064 100644
--- a/pkgs/servers/home-assistant/component-packages.nix
+++ b/pkgs/servers/home-assistant/component-packages.nix
@@ -52,7 +52,7 @@
     "arwn" = ps: with ps; [ aiohttp-cors paho-mqtt ];
     "asterisk_cdr" = ps: with ps; [ ]; # missing inputs: asterisk_mbox
     "asterisk_mbox" = ps: with ps; [ ]; # missing inputs: asterisk_mbox
-    "asuswrt" = ps: with ps; [ ]; # missing inputs: aioasuswrt
+    "asuswrt" = ps: with ps; [ aioasuswrt ];
     "atag" = ps: with ps; [ ]; # missing inputs: pyatag
     "aten_pe" = ps: with ps; [ atenpdu ];
     "atome" = ps: with ps; [ ]; # missing inputs: pyatome
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index f138554c839..bdff2fce152 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -204,9 +204,11 @@ in {
 
   aioambient = callPackage ../development/python-modules/aioambient { };
 
+  ailment = callPackage ../development/python-modules/ailment { };
+
   aioamqp = callPackage ../development/python-modules/aioamqp { };
 
-  ailment = callPackage ../development/python-modules/ailment { };
+  aioasuswrt = callPackage ../development/python-modules/aioasuswrt { };
 
   aiocoap = callPackage ../development/python-modules/aiocoap { };