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