about summary refs log tree commit diff
path: root/pkgs/applications/version-management/datalad/default.nix
blob: 2b7d9eb032f96ff9ceb70595b4df1bbb72300898 (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
76
77
78
79
80
81
82
83
84
85
86
{ lib, stdenv, fetchFromGitHub, installShellFiles, python3, git, git-annex }:

python3.pkgs.buildPythonApplication rec {
  pname = "datalad";
  version = "1.0.2";

  src = fetchFromGitHub {
    owner = "datalad";
    repo = pname;
    rev = "refs/tags/${version}";
    hash = "sha256-oq+DdlWcwjJSQdnqHlYCa9I7iSOKf+hI35Lcv/GM24c=";
  };

  nativeBuildInputs = [ installShellFiles git ];

  propagatedBuildInputs = with python3.pkgs; [
    # core
    platformdirs
    chardet
    iso8601
    humanize
    fasteners
    packaging
    patool
    tqdm
    annexremote
    looseversion
    setuptools
    git-annex

    # downloaders-extra
    # requests-ftp # not in nixpkgs yet

    # downloaders
    boto
    keyrings-alt
    keyring
    msgpack
    requests

    # publish
    python-gitlab

    # misc
    argcomplete
    pyperclip
    python-dateutil

    # metadata
    simplejson
    whoosh

    # metadata-extra
    pyyaml
    mutagen
    exifread
    python-xmp-toolkit
    pillow

    # duecredit
    duecredit

    # python>=3.8
    distro
  ] ++ lib.optionals stdenv.hostPlatform.isWindows [ colorama ]
    ++ lib.optionals (python3.pythonOlder "3.10") [ importlib-metadata ];

  postInstall = ''
    installShellCompletion --cmd datalad \
         --bash <($out/bin/datalad shell-completion) \
         --zsh  <($out/bin/datalad shell-completion)
    wrapProgram $out/bin/datalad --prefix PYTHONPATH : "$PYTHONPATH"
  '';

  # no tests
  doCheck = false;

  pythonImportsCheck = [ "datalad" ];

  meta = with lib; {
    description = "Keep code, data, containers under control with git and git-annex";
    homepage = "https://www.datalad.org";
    license = licenses.mit;
    maintainers = with maintainers; [ renesat ];
  };
}