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.7.2";
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-sPG3AqVrv+BiB+copgaghWDT/Rb/WU0R+Y8Z2J6l+7E=";
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 propagatedBuildInputs = [
44 aiohttp
45 async-timeout
46 click
47 construct
48 dacite
49 paho-mqtt
50 pycryptodome
51 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ pycryptodomex ];
52
53 nativeCheckInputs = [
54 pytest-asyncio
55 pytestCheckHook
56 ];
57
58 pythonImportsCheck = [ "roborock" ];
59
60 meta = with lib; {
61 description = "Python library & console tool for controlling Roborock vacuum";
62 homepage = "https://github.com/humbertogontijo/python-roborock";
63 changelog = "https://github.com/humbertogontijo/python-roborock/blob/v${version}/CHANGELOG.md";
64 license = licenses.gpl3Only;
65 maintainers = with maintainers; [ fab ];
66 mainProgram = "roborock";
67 };
68}