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 pythonRelaxDeps = [ "defusedxml" ];
41
42 nativeBuildInputs = [ poetry-core ];
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") [ importlib-metadata ];
68
69 nativeCheckInputs = [
70 pytest-asyncio
71 pytest-mock
72 pytestCheckHook
73 ];
74
75 pythonImportsCheck = [ "miio" ];
76
77 meta = with lib; {
78 description = "Python library for interfacing with Xiaomi smart appliances";
79 homepage = "https://github.com/rytilahti/python-miio";
80 license = licenses.gpl3Only;
81 maintainers = with maintainers; [ flyfloh ];
82 };
83}