1{
2 lib,
3 stdenv,
4 fetchpatch,
5 fetchFromGitHub,
6 buildPythonApplication,
7 click,
8 pydantic,
9 toml,
10 watchdog,
11 pytestCheckHook,
12 pytest-cov-stub,
13 rsync,
14}:
15
16buildPythonApplication rec {
17 pname = "remote-exec";
18 version = "1.13.3";
19 format = "setuptools";
20
21 src = fetchFromGitHub {
22 owner = "remote-cli";
23 repo = "remote";
24 tag = "v${version}";
25 hash = "sha256-rsboHJLOHXnpXtsVsvsfKsav8mSbloaq2lzZnU2pw6c=";
26 };
27
28 patches = [
29 # relax install requirements
30 # https://github.com/remote-cli/remote/pull/60.patch
31 (fetchpatch {
32 url = "https://github.com/remote-cli/remote/commit/a2073c30c7f576ad7ceb46e39f996de8d06bf186.patch";
33 hash = "sha256-As0j+yY6LamhOCGFzvjUQoXFv46BN/tRBpvIS7r6DaI=";
34 })
35 ];
36
37 # remove legacy endpoints, we use --multi now
38 postPatch = ''
39 substituteInPlace setup.py \
40 --replace-fail '"mremote' '#"mremote'
41 '';
42
43 dependencies = [
44 click
45 pydantic
46 toml
47 watchdog
48 ];
49
50 doCheck = true;
51
52 nativeCheckInputs = [
53 rsync
54 ];
55
56 checkInputs = [
57 pytestCheckHook
58 pytest-cov-stub
59 ];
60
61 disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [
62 # `watchdog` dependency does not correctly detect fsevents on darwin.
63 # this only affects `remote --stream-changes`
64 "test/test_file_changes.py"
65 ];
66
67 meta = with lib; {
68 description = "Work with remote hosts seamlessly via rsync and ssh";
69 homepage = "https://github.com/remote-cli/remote";
70 changelog = "https://github.com/remote-cli/remote/releases/tag/v${version}";
71 license = licenses.bsd2;
72 maintainers = with maintainers; [ pbsds ];
73 };
74}