1{
2 lib,
3 buildPythonPackage,
4 cacert,
5 fetchFromGitHub,
6 fetchpatch,
7 git-annex,
8 gitMinimal,
9 pygit2,
10 pytestCheckHook,
11 pythonOlder,
12 setuptools,
13 substituteAll,
14 util-linux,
15}:
16
17buildPythonPackage rec {
18 pname = "git-annex-adapter";
19 version = "0.2.2";
20 pyproject = true;
21
22 disabled = pythonOlder "3.7";
23
24 src = fetchFromGitHub {
25 owner = "alpernebbi";
26 repo = "git-annex-adapter";
27 rev = "refs/tags/v${version}";
28 hash = "sha256-vb0vxnwAs0/yOjpyyoGWvX6Tu+cuziGNdnXbdzXexhg=";
29 };
30
31 patches = [
32 # fix tests with recent versions of git-annex
33 (fetchpatch {
34 url = "https://github.com/alpernebbi/git-annex-adapter/commit/6c210d828e8a57b12c716339ad1bf15c31cd4a55.patch";
35 sha256 = "17kp7pnm9svq9av4q7hfic95xa1w3z02dnr8nmg14sjck2rlmqsi";
36 })
37 (fetchpatch {
38 url = "https://github.com/alpernebbi/git-annex-adapter/commit/b78a8f445f1fb5cf34b28512fc61898ef166b5a1.patch";
39 hash = "sha256-BSVoOPWsgY1btvn68bco4yb90FAC7ay2kYZ+q9qDHHw=";
40 })
41 (fetchpatch {
42 url = "https://github.com/alpernebbi/git-annex-adapter/commit/d0d8905965a3659ce95cbd8f8b1e8598f0faf76b.patch";
43 hash = "sha256-UcRTKzD3sbXGIuxj4JzZDnvjTYyWVkfeWgKiZ1rAlus=";
44 })
45 (substituteAll {
46 src = ./git-annex-path.patch;
47 gitAnnex = "${git-annex}/bin/git-annex";
48 })
49 ];
50
51 nativeBuildInputs = [ setuptools ];
52
53 propagatedBuildInputs = [
54 pygit2
55 cacert
56 ];
57
58 nativeCheckInputs = [
59 gitMinimal
60 util-linux # `rev` is needed in tests/test_process.py
61 pytestCheckHook
62 ];
63
64 pythonImportsCheck = [ "git_annex_adapter" ];
65
66 disabledTests = [
67 # KeyError and AssertionError
68 "test_annex_keys"
69 "test_batchjson_metadata"
70 "test_file_tree"
71 "test_jsonprocess_annex_metadata_batch"
72 "test_process_annex_metadata_batch"
73 ];
74
75 meta = with lib; {
76 homepage = "https://github.com/alpernebbi/git-annex-adapter";
77 description = "Call git-annex commands from Python";
78 license = licenses.gpl3Plus;
79 maintainers = with maintainers; [ dotlambda ];
80 };
81}