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