1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 fetchpatch,
7 poetry-core,
8 pythonRelaxDepsHook,
9 requests,
10 urllib3,
11 pytestCheckHook,
12}:
13
14buildPythonPackage rec {
15 pname = "synologydsm-api";
16 version = "1.0.2";
17
18 pyproject = true;
19
20 disabled = pythonOlder "3.7";
21
22 src = fetchFromGitHub {
23 owner = "hacf-fr";
24 repo = "synologydsm-api";
25 rev = "v${version}";
26 hash = "sha256-UQdPwvRdv7SCOTxkA1bfskQ9oL/DB0j1TdJE04ODyj8=";
27 };
28
29 patches = [
30 # https://github.com/hacf-fr/synologydsm-api/pull/84
31 (fetchpatch {
32 name = "switch-to-poetry-core.patch";
33 url = "https://github.com/hacf-fr/synologydsm-api/commit/f1ea2be927388bdff6d43d09027b82a854635e34.patch";
34 hash = "sha256-+c25zLkTtjeX7IE+nZEnjrWfnDhDJpeHN7qRKO5rF4g=";
35 })
36 ];
37
38 nativeBuildInputs = [
39 poetry-core
40 pythonRelaxDepsHook
41 ];
42
43 pythonRelaxDeps = [ "urllib3" ];
44
45 propagatedBuildInputs = [
46 requests
47 urllib3
48 ];
49
50 nativeCheckInputs = [ pytestCheckHook ];
51
52 pythonImportsCheck = [ "synology_dsm" ];
53
54 meta = with lib; {
55 description = "Python API for communication with Synology DSM";
56 mainProgram = "synologydsm-api";
57 homepage = "https://github.com/hacf-fr/synologydsm-api";
58 license = licenses.mit;
59 maintainers = with maintainers; [ dotlambda ];
60 };
61}