1{
2 lib,
3 aiohttp,
4 anyio,
5 async-timeout,
6 asyncclick,
7 buildPythonPackage,
8 cryptography,
9 fetchFromGitHub,
10 kasa-crypt,
11 orjson,
12 poetry-core,
13 pydantic,
14 pytest-asyncio,
15 pytest-mock,
16 pytestCheckHook,
17 pythonOlder,
18 voluptuous,
19}:
20
21buildPythonPackage rec {
22 pname = "python-kasa";
23 version = "0.6.2.1";
24 pyproject = true;
25
26 disabled = pythonOlder "3.8";
27
28 src = fetchFromGitHub {
29 owner = "python-kasa";
30 repo = "python-kasa";
31 rev = "refs/tags/${version}";
32 hash = "sha256-iCqJY3qkA3ZVXTCfxvQoaZsaqGui8PwKGAmLXKZgLJs=";
33 };
34
35 nativeBuildInputs = [ poetry-core ];
36
37 propagatedBuildInputs = [
38 aiohttp
39 anyio
40 async-timeout
41 asyncclick
42 cryptography
43 pydantic
44 ];
45
46 nativeCheckInputs = [
47 pytest-asyncio
48 pytest-mock
49 pytestCheckHook
50 voluptuous
51 ];
52
53 passthru.optional-dependencies = {
54 speedups = [
55 kasa-crypt
56 orjson
57 ];
58 };
59
60 pytestFlagsArray = [ "--asyncio-mode=auto" ];
61
62 disabledTestPaths = [
63 # Skip the examples tests
64 "kasa/tests/test_readme_examples.py"
65 ];
66
67 pythonImportsCheck = [ "kasa" ];
68
69 meta = with lib; {
70 description = "Python API for TP-Link Kasa Smarthome products";
71 mainProgram = "kasa";
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}