1{
2 lib,
3 stdenv,
4 aiohttp,
5 async-timeout,
6 buildPythonPackage,
7 click,
8 construct,
9 dacite,
10 fetchFromGitHub,
11 paho-mqtt,
12 poetry-core,
13 pycryptodome,
14 pycryptodomex,
15 pytest-asyncio,
16 pytestCheckHook,
17 pythonOlder,
18}:
19
20buildPythonPackage rec {
21 pname = "python-roborock";
22 version = "2.6.0";
23 pyproject = true;
24
25 disabled = pythonOlder "3.10";
26
27 src = fetchFromGitHub {
28 owner = "humbertogontijo";
29 repo = "python-roborock";
30 rev = "refs/tags/v${version}";
31 hash = "sha256-Mszy1p7TOEynCePCEiLhwdWiKXfFnlo3/a3vc9TxGeY=";
32 };
33
34 postPatch = ''
35 substituteInPlace pyproject.toml \
36 --replace-fail "poetry-core==1.8.0" "poetry-core"
37 '';
38
39 pythonRelaxDeps = [ "pycryptodome" ];
40
41 build-system = [ poetry-core ];
42
43
44 propagatedBuildInputs = [
45 aiohttp
46 async-timeout
47 click
48 construct
49 dacite
50 paho-mqtt
51 pycryptodome
52 ] ++ lib.optionals stdenv.isDarwin [ pycryptodomex ];
53
54 nativeCheckInputs = [
55 pytest-asyncio
56 pytestCheckHook
57 ];
58
59 pythonImportsCheck = [ "roborock" ];
60
61 meta = with lib; {
62 description = "Python library & console tool for controlling Roborock vacuum";
63 homepage = "https://github.com/humbertogontijo/python-roborock";
64 changelog = "https://github.com/humbertogontijo/python-roborock/blob/v${version}/CHANGELOG.md";
65 license = licenses.gpl3Only;
66 maintainers = with maintainers; [ fab ];
67 mainProgram = "roborock";
68 };
69}