about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pyarr/default.nix
blob: ef2e3a5b0a0961c8857af82abd882533c1217a0d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{ lib
, buildPythonPackage
, fetchFromGitHub
, overrides
, poetry-core
, pythonOlder
, requests
, pytestCheckHook
, types-requests
, responses
}:

buildPythonPackage rec {
  pname = "pyarr";
  version = "5.2.0";
  pyproject = true;

  disabled = pythonOlder "3.9";

  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
  ];

  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 ];
  };
}