1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchPypi
5, poetry
6, click
7, cryptography
8, construct
9, zeroconf
10, attrs
11, pytz
12, appdirs
13, tqdm
14, netifaces
15, android-backup
16, importlib-metadata
17, croniter
18, defusedxml
19, pytestCheckHook
20, pytest-mock
21, pyyaml
22}:
23
24
25buildPythonPackage rec {
26 pname = "python-miio";
27 version = "0.5.8";
28 disabled = pythonOlder "3.6";
29 format = "pyproject";
30
31 src = fetchPypi {
32 inherit pname version;
33 sha256 = "sha256-16XEah5rgem/L8A/zo1zPrifrU15VMk652rFLZcvjig=";
34 };
35
36 postPatch = ''
37 substituteInPlace pyproject.toml \
38 --replace 'click = "^7"' 'click = "*"' \
39 --replace 'croniter = "^0"' 'croniter = "*"' \
40 --replace 'cryptography = "^3"' 'cryptography = "*"' \
41 --replace 'defusedxml = "^0.6"' 'defusedxml = "*"'
42 '';
43
44 nativeBuildInputs = [
45 poetry
46 ];
47
48 propagatedBuildInputs = [
49 android-backup
50 appdirs
51 attrs
52 click
53 construct
54 croniter
55 cryptography
56 defusedxml
57 netifaces
58 pytz
59 pyyaml
60 tqdm
61 zeroconf
62 ] ++ lib.optional (pythonOlder "3.8") importlib-metadata;
63
64 checkInputs = [
65 pytestCheckHook
66 pytest-mock
67 ];
68
69 pythonImportsCheck = [ "miio" ];
70
71 meta = with lib; {
72 description = "Python library for interfacing with Xiaomi smart appliances";
73 homepage = "https://github.com/rytilahti/python-miio";
74 license = licenses.gpl3Only;
75 maintainers = with maintainers; [ flyfloh ];
76 };
77}