1{ lib
2, aiohttp
3, aresponses
4, backoff
5, buildPythonPackage
6, fetchFromGitHub
7, packaging
8, poetry-core
9, pydantic
10, pytest-asyncio
11, pytest-mock
12, pytestCheckHook
13, pythonOlder
14, yarl
15}:
16
17buildPythonPackage rec {
18 pname = "python-bsblan";
19 version = "0.5.16";
20 format = "pyproject";
21
22 disabled = pythonOlder "3.9";
23
24 src = fetchFromGitHub {
25 owner = "liudger";
26 repo = pname;
27 rev = "refs/tags/v${version}";
28 hash = "sha256-m80lnNd1ANddV0d/w3S7+QWzIPRklDZsWMO2g1hgEoQ=";
29 };
30
31 postPatch = ''
32 substituteInPlace pyproject.toml \
33 --replace 'version = "0.0.0"' 'version = "${version}"' \
34 --replace "--cov" ""
35 sed -i "/covdefaults/d" pyproject.toml
36 sed -i "/ruff/d" pyproject.toml
37 '';
38
39 nativeBuildInputs = [
40 poetry-core
41 ];
42
43 propagatedBuildInputs = [
44 aiohttp
45 backoff
46 packaging
47 pydantic
48 yarl
49 ];
50
51 nativeCheckInputs = [
52 aresponses
53 pytest-asyncio
54 pytest-mock
55 pytestCheckHook
56 ];
57
58 pythonImportsCheck = [
59 "bsblan"
60 ];
61
62 meta = with lib; {
63 description = "Module to control and monitor an BSBLan device programmatically";
64 homepage = "https://github.com/liudger/python-bsblan";
65 changelog = "https://github.com/liudger/python-bsblan/releases/tag/v${version}";
66 license = with licenses; [ mit ];
67 maintainers = with maintainers; [ fab ];
68 };
69}