1{ lib
2, buildPythonPackage
3, cryptography
4, fetchFromGitHub
5, pytest-asyncio
6, pytestCheckHook
7, pythonOlder
8, setuptools
9, typing-extensions
10, zeroconf
11}:
12
13buildPythonPackage rec {
14 pname = "python-rabbitair";
15 version = "0.0.8";
16 format = "pyproject";
17
18 disabled = pythonOlder "3.6";
19
20 src = fetchFromGitHub {
21 owner = "rabbit-air";
22 repo = pname;
23 rev = "v${version}";
24 hash = "sha256-CGr7NvnGRNTiKq5BpB/zmfgyd/2ggTbO0nj+Q+MavTs=";
25 };
26
27 nativeBuildInputs = [
28 setuptools
29 ];
30
31 propagatedBuildInputs = [
32 cryptography
33 zeroconf
34 ] ++ lib.optionals (pythonOlder "3.8") [
35 typing-extensions
36 ];
37
38 checkInputs = [
39 pytest-asyncio
40 pytestCheckHook
41 ];
42
43 pythonImportsCheck = [
44 "rabbitair"
45 ];
46
47 disabledTests = [
48 # Tests require network access
49 "test_info"
50 "test_no_response"
51 "test_protocol_error"
52 "test_sequential_requests"
53 "test_set_state"
54 "test_state_a2"
55 "test_state_a3"
56 "test_zeroconf"
57 ];
58
59 meta = with lib; {
60 description = "Module for the control of Rabbit Air air purifiers";
61 homepage = "https://github.com/rabbit-air/python-rabbitair";
62 license = with licenses; [ asl20 ];
63 maintainers = with maintainers; [ fab ];
64 };
65}