1{ lib
2, android-backup
3, appdirs
4, attrs
5, buildPythonPackage
6, click
7, construct
8, croniter
9, cryptography
10, defusedxml
11, fetchPypi
12, fetchpatch
13, importlib-metadata
14, micloud
15, netifaces
16, poetry-core
17, pytest-asyncio
18, pytest-mock
19, pytestCheckHook
20, pythonOlder
21, pytz
22, pyyaml
23, tqdm
24, zeroconf
25}:
26
27
28buildPythonPackage rec {
29 pname = "python-miio";
30 version = "0.5.12";
31 format = "pyproject";
32
33 disabled = pythonOlder "3.7";
34
35 src = fetchPypi {
36 inherit pname version;
37 hash = "sha256-BJw1Gg3FO2R6WWKjkrpxDN4fTMTug5AIj0SNq1gEbBY=";
38 };
39
40 nativeBuildInputs = [
41 poetry-core
42 ];
43
44 patches = [
45 (fetchpatch {
46 # Fix pytest 7.2 compat
47 url = "https://github.com/rytilahti/python-miio/commit/67d9d771d04d51f5bd97f361ca1c15ae4a18c274.patch";
48 hash = "sha256-Os9vCSKyieCqHs63oX6gcLrtv1N7hbX5WvEurelEp8w=";
49 })
50 ];
51
52 propagatedBuildInputs = [
53 android-backup
54 appdirs
55 attrs
56 click
57 construct
58 croniter
59 cryptography
60 defusedxml
61 micloud
62 netifaces
63 pytz
64 pyyaml
65 tqdm
66 zeroconf
67 ] ++ lib.optionals (pythonOlder "3.8") [
68 importlib-metadata
69 ];
70
71 nativeCheckInputs = [
72 pytest-asyncio
73 pytest-mock
74 pytestCheckHook
75 ];
76
77 pythonImportsCheck = [
78 "miio"
79 ];
80
81 meta = with lib; {
82 description = "Python library for interfacing with Xiaomi smart appliances";
83 homepage = "https://github.com/rytilahti/python-miio";
84 license = licenses.gpl3Only;
85 maintainers = with maintainers; [ flyfloh ];
86 };
87}