push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,80 @@
{
lib,
buildPythonPackage,
cacert,
fetchFromGitHub,
fetchpatch,
git-annex,
gitMinimal,
pygit2,
pytestCheckHook,
pythonOlder,
setuptools,
replaceVars,
util-linux,
}:
buildPythonPackage rec {
pname = "git-annex-adapter";
version = "0.2.2";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "alpernebbi";
repo = "git-annex-adapter";
tag = "v${version}";
hash = "sha256-vb0vxnwAs0/yOjpyyoGWvX6Tu+cuziGNdnXbdzXexhg=";
};
patches = [
# fix tests with recent versions of git-annex
(fetchpatch {
url = "https://github.com/alpernebbi/git-annex-adapter/commit/6c210d828e8a57b12c716339ad1bf15c31cd4a55.patch";
sha256 = "17kp7pnm9svq9av4q7hfic95xa1w3z02dnr8nmg14sjck2rlmqsi";
})
(fetchpatch {
url = "https://github.com/alpernebbi/git-annex-adapter/commit/b78a8f445f1fb5cf34b28512fc61898ef166b5a1.patch";
hash = "sha256-BSVoOPWsgY1btvn68bco4yb90FAC7ay2kYZ+q9qDHHw=";
})
(fetchpatch {
url = "https://github.com/alpernebbi/git-annex-adapter/commit/d0d8905965a3659ce95cbd8f8b1e8598f0faf76b.patch";
hash = "sha256-UcRTKzD3sbXGIuxj4JzZDnvjTYyWVkfeWgKiZ1rAlus=";
})
(replaceVars ./git-annex-path.patch {
gitAnnex = "${git-annex}/bin/git-annex";
})
];
nativeBuildInputs = [ setuptools ];
propagatedBuildInputs = [
pygit2
cacert
];
nativeCheckInputs = [
gitMinimal
util-linux # `rev` is needed in tests/test_process.py
pytestCheckHook
];
pythonImportsCheck = [ "git_annex_adapter" ];
disabledTests = [
# KeyError and AssertionError
"test_annex_keys"
"test_batchjson_metadata"
"test_file_tree"
"test_jsonprocess_annex_metadata_batch"
"test_process_annex_metadata_batch"
];
meta = with lib; {
homepage = "https://github.com/alpernebbi/git-annex-adapter";
description = "Call git-annex commands from Python";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ dotlambda ];
};
}

View File

@@ -0,0 +1,75 @@
diff --git a/git_annex_adapter/process.py b/git_annex_adapter/process.py
index 6ddb985..bbd0ab8 100644
--- a/git_annex_adapter/process.py
+++ b/git_annex_adapter/process.py
@@ -389,7 +389,7 @@ class GitAnnexBatchProcess:
_procclass = Process
def __init__(self, args, workdir):
- self.args = ('git', 'annex', *args)
+ self.args = ('@gitAnnex@', *args)
self.workdir = workdir
self._process = None
self._dead_process = None
@@ -586,7 +586,7 @@ class ProcessRunner:
class GitAnnexRunner(ProcessRunner):
"""Helper class to run git-annex commands."""
def __init__(self, args_prefix, workdir):
- args_prefix = ('git-annex', *args_prefix)
+ args_prefix = ('@gitAnnex@', *args_prefix)
super().__init__(args_prefix, workdir)
def __call__(self, *args_suffix):
diff --git a/tests/test_process.py b/tests/test_process.py
index ed619bb..9335078 100644
--- a/tests/test_process.py
+++ b/tests/test_process.py
@@ -181,7 +181,7 @@ class TestProcessOnEmptyAnnex(TempAnnexTestCase):
def test_process_annex_metadata_batch(self):
"""Process should be able to read one line"""
with Process(
- ['git', 'annex', 'metadata', '--batch', '--json'],
+ ['@gitAnnex@', 'metadata', '--batch', '--json'],
str(self.tempdir),
) as proc:
proc.writeline(
@@ -202,7 +202,7 @@ class TestProcessOnEmptyAnnex(TempAnnexTestCase):
def test_jsonprocess_annex_metadata_batch(self):
"""JsonProcess should encode and decode properly"""
with JsonProcess(
- ['git', 'annex', 'metadata', '--batch', '--json'],
+ ['@gitAnnex@', 'metadata', '--batch', '--json'],
str(self.tempdir),
) as proc:
obj = proc({'key':'SHA256E-s0--0'})
@@ -218,7 +218,7 @@ class TestProcessOnEmptyAnnex(TempAnnexTestCase):
def test_process_annex_info_batch(self):
"""Process should be able to read multiple lines"""
with Process(
- ['git', 'annex', 'info', '--batch'],
+ ['@gitAnnex@', 'info', '--batch'],
str(self.tempdir),
) as proc:
proc.writeline('here')
diff --git a/tests/utils.py b/tests/utils.py
index 281ee3f..969aedc 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -107,7 +107,7 @@ class TempAnnexTestCase(TempRepoTestCase):
# Have to uninit before cleaning directory, since git-annex
# marks its objects read-only so that they don't get deleted.
subprocess.run(
- ['git', 'annex', 'uninit'],
+ ['@gitAnnex@', 'uninit'],
cwd=self.repo.workdir,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
@@ -122,7 +122,7 @@ class TempAnnexTestCase(TempRepoTestCase):
path.write_text(text)
subprocess.run(
- ['git', 'annex', 'add', '--quiet', relpath],
+ ['@gitAnnex@', 'add', '--quiet', relpath],
cwd=self.repo.workdir,
check=True,
)