1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, freezegun
5, ical
6, parameterized
7, pycryptodome
8, pydantic
9, pytest-aiohttp
10, pytest-asyncio
11, pytest-golden
12, pytest-mock
13, pytestCheckHook
14, python-dateutil
15, pythonOlder
16, pyyaml
17, requests
18, requests-mock
19, responses
20}:
21
22buildPythonPackage rec {
23 pname = "pyrainbird";
24 version = "2.0.1";
25 format = "setuptools";
26
27 disabled = pythonOlder "3.9";
28
29 src = fetchFromGitHub {
30 owner = "allenporter";
31 repo = pname;
32 rev = "refs/tags/${version}";
33 hash = "sha256-ssm/nFciUeWexgsKUpF4qZHz/grG8OYJV7roBAjMsac=";
34 };
35
36 postPatch = ''
37 substituteInPlace pytest.ini \
38 --replace "--cov=pyrainbird --cov-report=term-missing" ""
39
40 substituteInPlace setup.cfg \
41 --replace "pycryptodome>=3.16.0" "pycryptodome"
42 '';
43
44 propagatedBuildInputs = [
45 ical
46 pycryptodome
47 pydantic
48 python-dateutil
49 pyyaml
50 requests
51 ];
52
53 nativeCheckInputs = [
54 freezegun
55 parameterized
56 pytest-aiohttp
57 pytest-asyncio
58 pytest-golden
59 pytest-mock
60 pytestCheckHook
61 requests-mock
62 responses
63 ];
64
65 pythonImportsCheck = [
66 "pyrainbird"
67 ];
68
69 meta = with lib; {
70 description = "Module to interact with Rainbird controllers";
71 homepage = "https://github.com/allenporter/pyrainbird";
72 changelog = "https://github.com/allenporter/pyrainbird/releases/tag/${version}";
73 license = with licenses; [ mit ];
74 maintainers = with maintainers; [ fab ];
75 };
76}