1{ lib
2, aiohttp
3, aresponses
4, buildPythonPackage
5, fetchFromGitHub
6, fetchpatch
7, poetry-core
8, pytest-aiohttp
9, pytest-asyncio
10, pytest-mock
11, pytestCheckHook
12, pythonOlder
13, typing-extensions
14}:
15
16buildPythonPackage rec {
17 pname = "regenmaschine";
18 version = "2023.08.0";
19 format = "pyproject";
20
21 disabled = pythonOlder "3.9";
22
23 src = fetchFromGitHub {
24 owner = "bachya";
25 repo = pname;
26 rev = "refs/tags/${version}";
27 hash = "sha256-2czpPLTJOUxjzG0+aOyY01jfwlcRgoHiQdB6ybQ6gWg=";
28 };
29
30 patches = [
31 # This patch removes references to setuptools and wheel that are no longer
32 # necessary and changes poetry to poetry-core, so that we don't need to add
33 # unnecessary nativeBuildInputs.
34 #
35 # https://github.com/bachya/regenmaschine/pull/334
36 #
37 (fetchpatch {
38 name = "clean-up-build-dependencies.patch";
39 url = "https://github.com/bachya/regenmaschine/commit/ecc2f771e2ae2e0a8d46f5beab072df4e4727ba3.patch";
40 hash = "sha256-RLRbHmaR2A8MNc96WHx0L8ccyygoBUaOulAuRJkFuUM=";
41 })
42 ];
43
44 nativeBuildInputs = [
45 poetry-core
46 ];
47
48 propagatedBuildInputs = [
49 aiohttp
50 typing-extensions
51 ];
52
53 nativeCheckInputs = [
54 aresponses
55 pytest-aiohttp
56 pytest-asyncio
57 pytest-mock
58 pytestCheckHook
59 ];
60
61 disabledTestPaths = [
62 # Examples are prefix with test_
63 "examples/"
64 ];
65
66 pythonImportsCheck = [
67 "regenmaschine"
68 ];
69
70 __darwinAllowLocalNetworking = true;
71
72 meta = with lib; {
73 description = "Python library for interacting with RainMachine smart sprinkler controllers";
74 homepage = "https://github.com/bachya/regenmaschine";
75 changelog = "https://github.com/bachya/regenmaschine/releases/tag/${version}";
76 license = with licenses; [ mit ];
77 maintainers = with maintainers; [ fab ];
78 };
79}