about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pyarr/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pyarr/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/pyarr/default.nix53
1 files changed, 46 insertions, 7 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/pyarr/default.nix b/nixpkgs/pkgs/development/python-modules/pyarr/default.nix
index 7f2a4ce78878..ef2e3a5b0a09 100644
--- a/nixpkgs/pkgs/development/python-modules/pyarr/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/pyarr/default.nix
@@ -1,30 +1,69 @@
 { lib
-, fetchPypi
 , buildPythonPackage
-, types-requests
+, fetchFromGitHub
+, overrides
+, poetry-core
+, pythonOlder
 , requests
+, pytestCheckHook
+, types-requests
+, responses
 }:
 
 buildPythonPackage rec {
   pname = "pyarr";
   version = "5.2.0";
-  format = "setuptools";
+  pyproject = true;
+
+  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 = ''
+    # 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" ];
+  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";
+    changelog = "https://github.com/totaldebug/pyarr/releases/tag/v${version}";
     license = licenses.mit;
     maintainers = with maintainers; [ onny ];
   };