1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 httpx,
6 protobuf,
7 pytest-asyncio_0,
8 pytest-httpx,
9 pytest-mock,
10 pytestCheckHook,
11 pythonOlder,
12 segno,
13 setuptools-scm,
14 syrupy,
15 tenacity,
16 zeroconf,
17}:
18
19buildPythonPackage rec {
20 pname = "devolo-plc-api";
21 version = "1.5.1";
22 pyproject = true;
23
24 disabled = pythonOlder "3.8";
25
26 src = fetchFromGitHub {
27 owner = "2Fake";
28 repo = "devolo_plc_api";
29 tag = "v${version}";
30 hash = "sha256-bmZcjvqZwVJzDsdtSbQvJpry2QSSuB6/jOTWG1+jyV4=";
31 };
32
33 postPatch = ''
34 substituteInPlace pyproject.toml \
35 --replace-fail "protobuf>=4.22.0" "protobuf"
36 '';
37
38 build-system = [ setuptools-scm ];
39
40 dependencies = [
41 httpx
42 protobuf
43 segno
44 tenacity
45 zeroconf
46 ];
47
48 __darwinAllowLocalNetworking = true;
49
50 nativeCheckInputs = [
51 pytest-asyncio_0
52 pytest-httpx
53 pytest-mock
54 pytestCheckHook
55 syrupy
56 ];
57
58 disabledTests = [
59 # pytest-httpx compat issue
60 "test_wrong_password_type"
61 ];
62
63 pythonImportsCheck = [ "devolo_plc_api" ];
64
65 meta = with lib; {
66 description = "Module to interact with Devolo PLC devices";
67 homepage = "https://github.com/2Fake/devolo_plc_api";
68 changelog = "https://github.com/2Fake/devolo_plc_api/releases/tag/v${version}";
69 license = licenses.gpl3Only;
70 maintainers = with maintainers; [ fab ];
71 };
72}