1{ lib
2, anyio
3, async-timeout
4, asyncclick
5, buildPythonPackage
6, fetchFromGitHub
7, kasa-crypt
8, orjson
9, poetry-core
10, pydantic
11, pytest-asyncio
12, pytest-mock
13, pytestCheckHook
14, pythonOlder
15, voluptuous
16}:
17
18buildPythonPackage rec {
19 pname = "python-kasa";
20 version = "0.5.4";
21 format = "pyproject";
22
23 disabled = pythonOlder "3.8";
24
25 src = fetchFromGitHub {
26 owner = pname;
27 repo = pname;
28 rev = "refs/tags/${version}";
29 hash = "sha256-wGPMrYaTtKkkNW88eyiiciFcBSTRqqChYi6e15WUCHo=";
30 };
31
32 nativeBuildInputs = [
33 poetry-core
34 ];
35
36 propagatedBuildInputs = [
37 anyio
38 async-timeout
39 asyncclick
40 pydantic
41 ];
42
43 nativeCheckInputs = [
44 pytest-asyncio
45 pytest-mock
46 pytestCheckHook
47 voluptuous
48 ];
49
50 passthru.optional-dependencies = {
51 speedup = [
52 kasa-crypt
53 orjson
54 ];
55 };
56
57 pytestFlagsArray = [
58 "--asyncio-mode=auto"
59 ];
60
61 disabledTestPaths = [
62 # Skip the examples tests
63 "kasa/tests/test_readme_examples.py"
64 ];
65
66 pythonImportsCheck = [
67 "kasa"
68 ];
69
70 meta = with lib; {
71 description = "Python API for TP-Link Kasa Smarthome products";
72 homepage = "https://python-kasa.readthedocs.io/";
73 changelog = "https://github.com/python-kasa/python-kasa/blob/${version}/CHANGELOG.md";
74 license = licenses.gpl3Plus;
75 maintainers = with maintainers; [ fab ];
76 };
77}