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