2022-08-12 12:06:08 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2024-01-13 08:15:51 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, overrides
|
|
|
|
, poetry-core
|
|
|
|
, pythonOlder
|
2022-08-12 12:06:08 +00:00
|
|
|
, requests
|
2024-01-13 08:15:51 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, types-requests
|
|
|
|
, responses
|
2022-08-12 12:06:08 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyarr";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "5.2.0";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.9";
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "totaldebug";
|
|
|
|
repo = "pyarr";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-yvlDnAjmwDNdU1SWHGVrmoD3WHwrNt7hXoNNPo1hm1w=";
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
postPatch = ''
|
|
|
|
# https://github.com/totaldebug/pyarr/pull/167
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace "poetry.masonry.api" "poetry.core.masonry.api"
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
propagatedBuildInputs = [
|
2024-01-13 08:15:51 +00:00
|
|
|
overrides
|
2022-08-12 12:06:08 +00:00
|
|
|
requests
|
|
|
|
types-requests
|
|
|
|
];
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
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"
|
|
|
|
];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python client for Servarr API's (Sonarr, Radarr, Readarr, Lidarr)";
|
|
|
|
homepage = "https://github.com/totaldebug/pyarr";
|
2024-01-13 08:15:51 +00:00
|
|
|
changelog = "https://github.com/totaldebug/pyarr/releases/tag/v${version}";
|
2022-08-12 12:06:08 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ onny ];
|
|
|
|
};
|
|
|
|
}
|