diff --git a/pkgs/development/python-modules/py-synologydsm-api/default.nix b/pkgs/development/python-modules/py-synologydsm-api/default.nix index 3aa0fe76fff0..ffdd24efe49b 100644 --- a/pkgs/development/python-modules/py-synologydsm-api/default.nix +++ b/pkgs/development/python-modules/py-synologydsm-api/default.nix @@ -1,6 +1,8 @@ { lib , buildPythonPackage -, fetchPypi +, fetchFromGitHub +, pytestCheckHook +, poetry-core , urllib3 , requests }: @@ -8,18 +10,25 @@ buildPythonPackage rec { pname = "py-synologydsm-api"; version = "1.0.2"; + format = "pyproject"; - src = fetchPypi { - pname = "synologydsm-api"; - inherit version; - sha256 = "42ea453ef5734dd5b8163e3d18ef309658f0298411720e6b834bededd28c5d53"; + src = fetchFromGitHub { + owner = "hacf-fr"; + repo = "synologydsm-api"; + rev = "v${version}"; + sha256 = "sha256-UQdPwvRdv7SCOTxkA1bfskQ9oL/DB0j1TdJE04ODyj8="; }; + nativeBuildInputs = [ poetry-core ]; propagatedBuildInputs = [ urllib3 requests ]; + pythonImportsCheck = [ "synology_dsm" ]; + checkInputs = [ pytestCheckHook ]; - pythonImportsCheck = [ - "synology_dsm" - ]; + postPatch = '' + # was fixed upstream but not released, remove after upgrade to version > 1.0.2 + substituteInPlace pyproject.toml \ + --replace "poetry.masonry.api" "poetry.core.masonry.api" + ''; meta = with lib; { description = "Python API for Synology DSM";