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