2024-02-07 01:22:34 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, cacert
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, git-annex
|
|
|
|
, gitMinimal
|
|
|
|
, pygit2
|
|
|
|
, pytestCheckHook
|
|
|
|
, python
|
|
|
|
, pythonOlder
|
|
|
|
, setuptools
|
|
|
|
, substituteAll
|
|
|
|
, util-linux
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "git-annex-adapter";
|
2020-10-07 09:15:18 +00:00
|
|
|
version = "0.2.2";
|
2024-02-07 01:22:34 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "alpernebbi";
|
2024-02-07 01:22:34 +00:00
|
|
|
repo = "git-annex-adapter";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-vb0vxnwAs0/yOjpyyoGWvX6Tu+cuziGNdnXbdzXexhg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2021-02-05 17:12:51 +00:00
|
|
|
# fix tests with recent versions of git-annex
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/alpernebbi/git-annex-adapter/commit/6c210d828e8a57b12c716339ad1bf15c31cd4a55.patch";
|
|
|
|
sha256 = "17kp7pnm9svq9av4q7hfic95xa1w3z02dnr8nmg14sjck2rlmqsi";
|
|
|
|
})
|
2022-04-27 09:35:20 +00:00
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/alpernebbi/git-annex-adapter/commit/b78a8f445f1fb5cf34b28512fc61898ef166b5a1.patch";
|
|
|
|
hash = "sha256-BSVoOPWsgY1btvn68bco4yb90FAC7ay2kYZ+q9qDHHw=";
|
|
|
|
})
|
2022-11-21 17:40:18 +00:00
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/alpernebbi/git-annex-adapter/commit/d0d8905965a3659ce95cbd8f8b1e8598f0faf76b.patch";
|
|
|
|
hash = "sha256-UcRTKzD3sbXGIuxj4JzZDnvjTYyWVkfeWgKiZ1rAlus=";
|
|
|
|
})
|
2020-04-24 23:36:52 +00:00
|
|
|
(substituteAll {
|
|
|
|
src = ./git-annex-path.patch;
|
|
|
|
gitAnnex = "${git-annex}/bin/git-annex";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
pygit2
|
|
|
|
cacert
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2020-04-24 23:36:52 +00:00
|
|
|
gitMinimal
|
2020-11-24 20:58:05 +00:00
|
|
|
util-linux # `rev` is needed in tests/test_process.py
|
2024-02-07 01:22:34 +00:00
|
|
|
pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"git_annex_adapter"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
disabledTests = [
|
|
|
|
# KeyError and AssertionError
|
|
|
|
"test_jsonprocess_annex_metadata_batch"
|
|
|
|
"test_process_annex_metadata_batch"
|
|
|
|
"test_batchjson_metadata"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/alpernebbi/git-annex-adapter";
|
|
|
|
description = "Call git-annex commands from Python";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
}
|