nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
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 micloud,
15 netifaces,
16 poetry-core,
17 pytest-asyncio,
18 pytest-mock,
19 pytestCheckHook,
20 pytz,
21 pyyaml,
22 tqdm,
23 zeroconf,
24}:
25
26buildPythonPackage rec {
27 pname = "python-miio";
28 version = "0.5.12";
29 pyproject = true;
30
31 src = fetchPypi {
32 inherit pname version;
33 hash = "sha256-BJw1Gg3FO2R6WWKjkrpxDN4fTMTug5AIj0SNq1gEbBY=";
34 };
35
36 pythonRelaxDeps = [ "defusedxml" ];
37
38 build-system = [ poetry-core ];
39
40 patches = [
41 (fetchpatch {
42 # Fix pytest 7.2 compat
43 url = "https://github.com/rytilahti/python-miio/commit/67d9d771d04d51f5bd97f361ca1c15ae4a18c274.patch";
44 hash = "sha256-Os9vCSKyieCqHs63oX6gcLrtv1N7hbX5WvEurelEp8w=";
45 })
46 (fetchpatch {
47 # Python 3.13 compat
48 url = "https://github.com/rytilahti/python-miio/commit/0aa4df3ab1e47d564c8312016fbcfb3a9fc06c6c.patch";
49 hash = "sha256-Zydv3xqCliA/oAnjNmqh0vDrlZFPcTAIyW6vIZzijZY=";
50 })
51 ];
52
53 dependencies = [
54 android-backup
55 appdirs
56 attrs
57 click
58 construct
59 croniter
60 cryptography
61 defusedxml
62 micloud
63 netifaces
64 pytz
65 pyyaml
66 tqdm
67 zeroconf
68 ];
69
70 nativeCheckInputs = [
71 pytest-asyncio
72 pytest-mock
73 pytestCheckHook
74 ];
75
76 pythonImportsCheck = [ "miio" ];
77
78 meta = {
79 description = "Python library for interfacing with Xiaomi smart appliances";
80 homepage = "https://github.com/rytilahti/python-miio";
81 license = lib.licenses.gpl3Only;
82 };
83}