about summary refs log tree commit diff
path: root/pkgs/tools/misc/remote-exec/default.nix
blob: 84b8026c0a0735d5abdaf93ed27b5080714875c8 (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
71
72
73
74
75
{ lib
, stdenv
, fetchpatch
, fetchFromGitHub
, buildPythonApplication
, click
, pydantic
, toml
, watchdog
, pytestCheckHook
, rsync
}:

buildPythonApplication rec {
  pname = "remote-exec";
  version = "1.13.3";

  src = fetchFromGitHub {
    owner = "remote-cli";
    repo = "remote";
    rev = "refs/tags/v${version}";
    hash = "sha256-rsboHJLOHXnpXtsVsvsfKsav8mSbloaq2lzZnU2pw6c=";
  };

  patches = [
    # relax install requirements
    # https://github.com/remote-cli/remote/pull/60.patch
    (fetchpatch {
      url = "https://github.com/remote-cli/remote/commit/a2073c30c7f576ad7ceb46e39f996de8d06bf186.patch";
      hash = "sha256-As0j+yY6LamhOCGFzvjUQoXFv46BN/tRBpvIS7r6DaI=";
    })
  ];

  # remove legacy endpoints, we use --multi now
  postPatch = ''
    substituteInPlace setup.py \
      --replace-fail '"mremote' '#"mremote'
  '';

  dependencies = [
    click
    pydantic
    toml
    watchdog
  ];

  # disable pytest --cov
  preCheck = ''
    rm setup.cfg
  '';

  doCheck = true;

  nativeCheckInputs = [
    rsync
  ];

  checkInputs = [
    pytestCheckHook
  ];

  disabledTestPaths = lib.optionals stdenv.isDarwin [
    # `watchdog` dependency does not correctly detect fsevents on darwin.
    # this only affects `remote --stream-changes`
    "test/test_file_changes.py"
  ];

  meta = with lib; {
    description = "Work with remote hosts seamlessly via rsync and ssh";
    homepage = "https://github.com/remote-cli/remote";
    changelog = "https://github.com/remote-cli/remote/releases/tag/v${version}";
    license = licenses.bsd2;
    maintainers = with maintainers; [ pbsds ];
  };
}