From 79035d5344095d48f04812958e825798893d1bf6 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 8 Jan 2024 10:23:21 +0100 Subject: [PATCH 1/2] python311Packages.pyarr: fix usage of poetry-core --- .../python-modules/pyarr/default.nix | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/pyarr/default.nix b/pkgs/development/python-modules/pyarr/default.nix index 7f2a4ce78878..ced4202648b4 100644 --- a/pkgs/development/python-modules/pyarr/default.nix +++ b/pkgs/development/python-modules/pyarr/default.nix @@ -1,30 +1,49 @@ { lib -, fetchPypi , buildPythonPackage -, types-requests +, fetchPypi +, overrides +, poetry-core +, pythonOlder , requests +, types-requests }: buildPythonPackage rec { pname = "pyarr"; version = "5.2.0"; - format = "setuptools"; + pyproject = true; + + disabled = pythonOlder "3.9"; src = fetchPypi { inherit pname version; hash = "sha256-jlcc9Kj1MYSsnvJkKZXXWWJVDx3KIuojjbGtl8kDUpw="; }; + postPatch = '' + # https://github.com/totaldebug/pyarr/pull/167 + substituteInPlace pyproject.toml \ + --replace "poetry.masonry.api" "poetry.core.masonry.api" + ''; + + nativeBuildInputs = [ + poetry-core + ]; + propagatedBuildInputs = [ + overrides requests types-requests ]; - pythonImportsCheck = [ "pyarr" ]; + pythonImportsCheck = [ + "pyarr" + ]; meta = with lib; { description = "Python client for Servarr API's (Sonarr, Radarr, Readarr, Lidarr)"; homepage = "https://github.com/totaldebug/pyarr"; + changelog = "https://github.com/totaldebug/pyarr/releases/tag/v${version}"; license = licenses.mit; maintainers = with maintainers; [ onny ]; }; From 745b182e45d43ed616d5e821c20e7f29fbd86b27 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 8 Jan 2024 10:30:38 +0100 Subject: [PATCH 2/2] python311Packages.pyarr: enable tests --- .../python-modules/pyarr/default.nix | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/pyarr/default.nix b/pkgs/development/python-modules/pyarr/default.nix index ced4202648b4..ef2e3a5b0a09 100644 --- a/pkgs/development/python-modules/pyarr/default.nix +++ b/pkgs/development/python-modules/pyarr/default.nix @@ -1,11 +1,13 @@ { lib , buildPythonPackage -, fetchPypi +, fetchFromGitHub , overrides , poetry-core , pythonOlder , requests +, pytestCheckHook , types-requests +, responses }: buildPythonPackage rec { @@ -15,9 +17,11 @@ buildPythonPackage rec { disabled = pythonOlder "3.9"; - src = fetchPypi { - inherit pname version; - hash = "sha256-jlcc9Kj1MYSsnvJkKZXXWWJVDx3KIuojjbGtl8kDUpw="; + src = fetchFromGitHub { + owner = "totaldebug"; + repo = "pyarr"; + rev = "refs/tags/v${version}"; + hash = "sha256-yvlDnAjmwDNdU1SWHGVrmoD3WHwrNt7hXoNNPo1hm1w="; }; postPatch = '' @@ -36,10 +40,26 @@ buildPythonPackage rec { types-requests ]; + nativeCheckInputs = [ + pytestCheckHook + responses + ]; + pythonImportsCheck = [ "pyarr" ]; + disabledTests = [ + # Tests require a running sonarr instance + "test_add" + "test_create" + "test_del" + "test_get" + "test_lookup" + "test_post" + "test_upd" + ]; + meta = with lib; { description = "Python client for Servarr API's (Sonarr, Radarr, Readarr, Lidarr)"; homepage = "https://github.com/totaldebug/pyarr";