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