summary refs log tree commit diff
path: root/pkgs/applications/misc/nimbo/default.nix
blob: 5ad86eeccd44852ce428741b8f53b03adb0c8c2d (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
{ lib
, python3
, fetchFromGitHub
, installShellFiles
, awscli
}:

python3.pkgs.buildPythonApplication rec {
  pname = "nimbo";
  version = "0.2.4";
  disabled = python3.pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "nimbo-sh";
    repo = pname;
    rev = "v${version}";
    sha256 = "1fs28s9ynfxrb4rzba6cmik0kl0q0vkpb4zdappsq62jqf960k24";
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace "awscli>=1.19<2.0" ""
  '';

  nativeBuildInputs = [ installShellFiles ];

  propagatedBuildInputs = with python3.pkgs; [
    setuptools
    boto3
    requests
    click
    pyyaml
    pydantic
  ];

  # nimbo tests require an AWS instance
  doCheck = false;
  pythonImportsCheck = [ "nimbo" ];

  makeWrapperArgs = [
    "--prefix" "PATH" ":" (lib.makeBinPath [ awscli ])
  ];

  postInstall = ''
    installShellCompletion --cmd nimbo \
      --zsh <(_NIMBO_COMPLETE=source_zsh $out/bin/nimbo) \
      --bash <(_NIMBO_COMPLETE=source_bash $out/bin/nimbo) \
      --fish  <(_NIMBO_COMPLETE=source_fish $out/bin/nimbo)
  '';

  meta = with lib; {
    description = "Run machine learning jobs on AWS with a single command";
    homepage = "https://github.com/nimbo-sh/nimbo";
    license = licenses.bsl11;
    maintainers = with maintainers; [ alexeyre noreferences ];
  };
}