summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/gl/globus-cli/package.nix
blob: 556439f7673f4911218c92ff21d59c3e56b4cd46 (plain)
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
76
77
78
79
{
  lib,
  fetchFromGitHub,
  python3Packages,
  installShellFiles,
  versionCheckHook,
}:

python3Packages.buildPythonApplication rec {
  pname = "globus-cli";
  version = "3.41.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "globus";
    repo = "globus-cli";
    tag = version;
    hash = "sha256-bTS4dXQU49asmPmgUnf4VjAWJ34+1YbXmCJ4KOeOoMI=";
  };

  build-system = with python3Packages; [
    flit-core
    ruamel-yaml
    flit-core
  ];

  dependencies = with python3Packages; [
    globus-sdk
    click
    jmespath
    packaging
    typing-extensions
    requests
  ];

  pythonRelaxDeps = [
    "globus-sdk"
    "jmespath"
  ];

  nativeBuildInputs = [ installShellFiles ];

  nativeCheckInputs = with python3Packages; [
    pytest
    pytest-xdist
    pytest-timeout
    responses

    click
    requests
    pyjwt
    cryptography
    packaging
    typing-extensions

    pytestCheckHook
    versionCheckHook
  ];

  versionCheckProgramArg = "version";

  postInstall = ''
    mkdir -p completions/{bash,zsh}
    $out/bin/globus --bash-completer > completions/bash/globus
    $out/bin/globus --zsh-completer > completions/zsh/_globus
    installShellCompletion \
      --bash completions/bash/globus \
      --zsh completions/zsh/_globus
  '';

  meta = {
    mainProgram = "globus";
    description = "Command-line interface to Globus REST APIs, including the Transfer API and the Globus Auth API";
    homepage = "https://github.com/globus/globus-cli";
    changelog = "https://github.com/globus/globus-cli/releases/tag/${src.tag}";
    license = lib.licenses.asl20;
    maintainers = [ lib.maintainers.richardjacton ];
  };
}