1{
2 lib,
3 aiohttp,
4 aresponses,
5 buildPythonPackage,
6 fetchFromGitHub,
7 poetry-core,
8 pytest-asyncio,
9 pytest-cov-stub,
10 pytestCheckHook,
11 syrupy,
12 pythonOlder,
13 yarl,
14}:
15
16buildPythonPackage rec {
17 pname = "p1monitor";
18 version = "3.2.0";
19 pyproject = true;
20
21 disabled = pythonOlder "3.11";
22
23 src = fetchFromGitHub {
24 owner = "klaasnicolaas";
25 repo = "python-p1monitor";
26 tag = "v${version}";
27 hash = "sha256-u+hjMTL51GWqYYHOxUjr7D6Q6MfGJhHZ6XsbE1fOF+A=";
28 };
29
30 postPatch = ''
31 substituteInPlace pyproject.toml \
32 --replace '"0.0.0"' '"${version}"'
33 '';
34
35 build-system = [ poetry-core ];
36
37 dependencies = [
38 aiohttp
39 yarl
40 ];
41
42 nativeCheckInputs = [
43 aresponses
44 pytest-asyncio
45 pytest-cov-stub
46 pytestCheckHook
47 syrupy
48 ];
49
50 pythonImportsCheck = [ "p1monitor" ];
51
52 meta = with lib; {
53 description = "Module for interacting with the P1 Monitor";
54 homepage = "https://github.com/klaasnicolaas/python-p1monitor";
55 changelog = "https://github.com/klaasnicolaas/python-p1monitor/releases/tag/v${version}";
56 license = licenses.mit;
57 maintainers = with maintainers; [ fab ];
58 };
59}