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