From 3f4d568ccf41afc6f20435aaea2b884cb15f38b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 27 Jun 2021 12:41:24 +0200 Subject: [PATCH] python3Packages.synologydsm-api: init at 1.0.2 --- .../synologydsm-api/default.nix | 57 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 59 insertions(+) create mode 100644 pkgs/development/python-modules/synologydsm-api/default.nix diff --git a/pkgs/development/python-modules/synologydsm-api/default.nix b/pkgs/development/python-modules/synologydsm-api/default.nix new file mode 100644 index 000000000000..71bd11144294 --- /dev/null +++ b/pkgs/development/python-modules/synologydsm-api/default.nix @@ -0,0 +1,57 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, fetchpatch +, poetry-core +, requests +, urllib3 +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "synologydsm-api"; + version = "1.0.2"; + + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "hacf-fr"; + repo = "synologydsm-api"; + rev = "v${version}"; + sha256 = "0gyahf1x6i6j9pslh1y3pyh3si5jvxb06r1w761b9gsxyk14y1si"; + }; + + patches = [ + # https://github.com/hacf-fr/synologydsm-api/pull/84 + (fetchpatch { + name = "switch-to-poetry-core.patch"; + url = "https://github.com/hacf-fr/synologydsm-api/commit/f1ea2be927388bdff6d43d09027b82a854635e34.patch"; + sha256 = "120pdgp2i4ds6y3rf9j372f9zdcf4y8rsgl1xjbkgdhkp76bkkgr"; + }) + ]; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + requests + urllib3 + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ "synology_dsm" ]; + + meta = with lib; { + description = "Python API for communication with Synology DSM"; + homepage = "https://github.com/hacf-fr/synologydsm-api"; + license = licenses.mit; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 72af595d3c1f..07135006fd6c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8342,6 +8342,8 @@ in { syncer = callPackage ../development/python-modules/syncer { }; + synologydsm-api = callPackage ../development/python-modules/synologydsm-api { }; + systembridge = callPackage ../development/python-modules/systembridge { }; systemd = callPackage ../development/python-modules/systemd {