1{
2 lib,
3 aiohttp,
4 aiomqtt,
5 buildPythonPackage,
6 cachetools,
7 defusedxml,
8 docker,
9 fetchFromGitHub,
10 pkg-config,
11 pycountry,
12 pytest-asyncio,
13 pytest-codspeed,
14 pytestCheckHook,
15 pythonOlder,
16 rustPlatform,
17 testfixtures,
18 xz,
19}:
20
21buildPythonPackage rec {
22 pname = "deebot-client";
23 version = "13.1.0";
24 pyproject = true;
25
26 disabled = pythonOlder "3.13";
27
28 src = fetchFromGitHub {
29 owner = "DeebotUniverse";
30 repo = "client.py";
31 tag = version;
32 hash = "sha256-EIhefThzHC9hpI4bGkTu+TskdzajI7cc90DhrfDlbcs=";
33 };
34
35 cargoDeps = rustPlatform.fetchCargoVendor {
36 inherit pname version src;
37 hash = "sha256-WYWrfNigmu18yEa2QstJ5RfjLWS/Tckem48j8JK2NHk=";
38 };
39
40 pythonRelaxDeps = [
41 "aiohttp"
42 "defusedxml"
43 ];
44
45 nativeBuildInputs = [
46 pkg-config
47 rustPlatform.cargoSetupHook
48 rustPlatform.maturinBuildHook
49 ];
50
51 buildInputs = [ xz ];
52
53 dependencies = [
54 aiohttp
55 aiomqtt
56 cachetools
57 defusedxml
58 ];
59
60 nativeCheckInputs = [
61 docker
62 pycountry
63 pytest-asyncio
64 pytest-codspeed
65 pytestCheckHook
66 testfixtures
67 ];
68
69 preCheck = ''
70 rm -rf deebot_client
71 '';
72
73 pythonImportsCheck = [ "deebot_client" ];
74
75 disabledTests = [
76 # Tests require running container
77 "test_last_message_received_at"
78 "test_client_bot_subscription"
79 "test_client_reconnect_manual"
80 "test_p2p_success"
81 "test_p2p_not_supported"
82 "test_p2p_data_type_not_supported"
83 "test_p2p_to_late"
84 "test_p2p_parse_error"
85 "test_mqtt_task_exceptions"
86 "test_mqtt_task_exceptions"
87 "test_client_reconnect_on_broker_error"
88 ];
89
90 meta = with lib; {
91 description = "Deebot client library";
92 homepage = "https://github.com/DeebotUniverse/client.py";
93 changelog = "https://github.com/DeebotUniverse/client.py/releases/tag/${version}";
94 license = licenses.gpl3Only;
95 maintainers = with maintainers; [ fab ];
96 };
97}