about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/python-kasa
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/python-kasa')
-rw-r--r--nixpkgs/pkgs/development/python-modules/python-kasa/default.nix77
1 files changed, 77 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/python-kasa/default.nix b/nixpkgs/pkgs/development/python-modules/python-kasa/default.nix
new file mode 100644
index 000000000000..78f97117f89f
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/python-kasa/default.nix
@@ -0,0 +1,77 @@
+{ lib
+, anyio
+, async-timeout
+, asyncclick
+, buildPythonPackage
+, fetchFromGitHub
+, kasa-crypt
+, orjson
+, poetry-core
+, pydantic
+, pytest-asyncio
+, pytest-mock
+, pytestCheckHook
+, pythonOlder
+, voluptuous
+}:
+
+buildPythonPackage rec {
+  pname = "python-kasa";
+  version = "0.5.3";
+  format = "pyproject";
+
+  disabled = pythonOlder "3.8";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "refs/tags/${version}";
+    hash = "sha256-7GJnkT7FOYzytQyOCP8zU5hUk4SbeC7gc1qkhl5eXGo=";
+  };
+
+  nativeBuildInputs = [
+    poetry-core
+  ];
+
+  propagatedBuildInputs = [
+    anyio
+    async-timeout
+    asyncclick
+    pydantic
+  ];
+
+  nativeCheckInputs = [
+    pytest-asyncio
+    pytest-mock
+    pytestCheckHook
+    voluptuous
+  ];
+
+  passthru.optional-dependencies = {
+    speedup = [
+      kasa-crypt
+      orjson
+    ];
+  };
+
+  pytestFlagsArray = [
+    "--asyncio-mode=auto"
+  ];
+
+  disabledTestPaths = [
+    # Skip the examples tests
+    "kasa/tests/test_readme_examples.py"
+  ];
+
+  pythonImportsCheck = [
+    "kasa"
+  ];
+
+  meta = with lib; {
+    description = "Python API for TP-Link Kasa Smarthome products";
+    homepage = "https://python-kasa.readthedocs.io/";
+    changelog = "https://github.com/python-kasa/python-kasa/blob/${version}/CHANGELOG.md";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ fab ];
+  };
+}