1{
2 lib,
3 aiohttp,
4 aioresponses,
5 beautifulsoup4,
6 buildPythonPackage,
7 fetchFromGitHub,
8 html5lib,
9 pytest-asyncio,
10 pytest-aiohttp,
11 pytestCheckHook,
12 pythonAtLeast,
13 pythonOlder,
14 requests,
15 requests-mock,
16 setuptools,
17 setuptools-scm,
18 urllib3,
19}:
20
21buildPythonPackage rec {
22 pname = "raincloudy";
23 version = "1.2.0";
24 pypriject = true;
25
26 # https://github.com/vanstinator/raincloudy/issues/65
27 disabled = pythonOlder "3.7" || pythonAtLeast "3.12";
28
29 src = fetchFromGitHub {
30 owner = "vanstinator";
31 repo = "raincloudy";
32 rev = "refs/tags/${version}";
33 hash = "sha256-qCkBVirM09iA1sXiOB9FJns8bHjQq7rRk8XbRWrtBDI=";
34 };
35
36 postPatch = ''
37 # https://github.com/vanstinator/raincloudy/pull/60
38 substituteInPlace setup.py \
39 --replace-fail "bs4" "beautifulsoup4" \
40
41 # fix raincloudy.aio package discovery, by relying on
42 # autodiscovery instead.
43 sed -i '/packages=/d' setup.py
44 '';
45
46 build-system = [
47 setuptools
48 setuptools-scm
49 ];
50
51 dependencies = [
52 aiohttp
53 requests
54 beautifulsoup4
55 urllib3
56 html5lib
57 ];
58
59 nativeCheckInputs = [
60 aioresponses
61 pytest-asyncio
62 pytest-aiohttp
63 pytestCheckHook
64 requests-mock
65 ];
66
67 pythonImportsCheck = [
68 "raincloudy"
69 "raincloudy.aio"
70 ];
71
72 disabledTests = [
73 # Test requires network access
74 "test_attributes"
75 ];
76
77 meta = with lib; {
78 description = "Module to interact with Melnor RainCloud Smart Garden Watering Irrigation Timer";
79 homepage = "https://github.com/vanstinator/raincloudy";
80 changelog = "https://github.com/vanstinator/raincloudy/releases/tag/${version}";
81 license = licenses.asl20;
82 maintainers = with maintainers; [ fab ];
83 };
84}