1{
2 lib,
3 android-backup,
4 appdirs,
5 attrs,
6 buildPythonPackage,
7 click,
8 construct,
9 croniter,
10 cryptography,
11 defusedxml,
12 fetchPypi,
13 fetchpatch,
14 importlib-metadata,
15 micloud,
16 netifaces,
17 poetry-core,
18 pytest-asyncio,
19 pytest-mock,
20 pytestCheckHook,
21 pythonOlder,
22 pytz,
23 pyyaml,
24 tqdm,
25 zeroconf,
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 = [ poetry-core ];
41
42 patches = [
43 (fetchpatch {
44 # Fix pytest 7.2 compat
45 url = "https://github.com/rytilahti/python-miio/commit/67d9d771d04d51f5bd97f361ca1c15ae4a18c274.patch";
46 hash = "sha256-Os9vCSKyieCqHs63oX6gcLrtv1N7hbX5WvEurelEp8w=";
47 })
48 ];
49
50 propagatedBuildInputs = [
51 android-backup
52 appdirs
53 attrs
54 click
55 construct
56 croniter
57 cryptography
58 defusedxml
59 micloud
60 netifaces
61 pytz
62 pyyaml
63 tqdm
64 zeroconf
65 ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ];
66
67 nativeCheckInputs = [
68 pytest-asyncio
69 pytest-mock
70 pytestCheckHook
71 ];
72
73 pythonImportsCheck = [ "miio" ];
74
75 meta = with lib; {
76 description = "Python library for interfacing with Xiaomi smart appliances";
77 homepage = "https://github.com/rytilahti/python-miio";
78 license = licenses.gpl3Only;
79 maintainers = with maintainers; [ flyfloh ];
80 };
81}