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