summary refs log tree commit diff
path: root/pkgs/development/python-modules/git-annex-adapter
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2018-08-15 12:59:36 +0200
committerMaximilian Bosch <maximilian@mbosch.me>2018-08-16 10:20:20 +0200
commit1022c3c25a166aaa517b08e2dcc6ccb9701f54ab (patch)
tree94f92d88e79b98469425fe1f5c360c064a3c6e6a /pkgs/development/python-modules/git-annex-adapter
parent6e7b11dbb631d651ef1a84528a66418979ff85a6 (diff)
downloadnixpkgs-1022c3c25a166aaa517b08e2dcc6ccb9701f54ab.tar
nixpkgs-1022c3c25a166aaa517b08e2dcc6ccb9701f54ab.tar.gz
nixpkgs-1022c3c25a166aaa517b08e2dcc6ccb9701f54ab.tar.bz2
nixpkgs-1022c3c25a166aaa517b08e2dcc6ccb9701f54ab.tar.lz
nixpkgs-1022c3c25a166aaa517b08e2dcc6ccb9701f54ab.tar.xz
nixpkgs-1022c3c25a166aaa517b08e2dcc6ccb9701f54ab.tar.zst
nixpkgs-1022c3c25a166aaa517b08e2dcc6ccb9701f54ab.zip
python3Packages.git-annex-adapter: fix build
`git-annex` version 6.20180719 enhances the output of `git-annex info`
with a description and UUID of the repository which broke the testcase
`test_process_annex_info_batch` which parses the output of the info
command.

The testcase has been fixed accordingly and the patch was filed upstream
here: https://github.com/alpernebbi/git-annex-adapter/pull/6

I rechecked the functionality in a simple python environment with the
following expression:

```
with import ./. {};
python3.withPackages (ps: with ps; [ git-annex-adapter ])
```

Furthermore I tested the main functionality in a Python REPL within the environment.

The Darwin patch fixes tests that rely on `rev`, a binary which is
distributed in the `utillinux` package and not available on Nix with
Darwin.

To make the purpose of the patches for future contributors clear I
documented the purpose for each patch.
Diffstat (limited to 'pkgs/development/python-modules/git-annex-adapter')
-rw-r--r--pkgs/development/python-modules/git-annex-adapter/default.nix19
1 files changed, 18 insertions, 1 deletions
diff --git a/pkgs/development/python-modules/git-annex-adapter/default.nix b/pkgs/development/python-modules/git-annex-adapter/default.nix
index 6cb6e626f27..935217c6992 100644
--- a/pkgs/development/python-modules/git-annex-adapter/default.nix
+++ b/pkgs/development/python-modules/git-annex-adapter/default.nix
@@ -22,13 +22,30 @@ buildPythonPackage rec {
       --replace "'git-annex'" "'${git-annex}/bin/git-annex'"
   '';
 
-  # TODO: Remove for next version
   patches = [
+    # fixes the "not-a-git-repo" testcase where recent git versions expect a slightly different error.
     ./not-a-git-repo-testcase.patch
+
+    # fixes the testcase which parses the output of `git-annex info` where several
+    # new lines are displayed that broke the test.
+    (fetchpatch {
+      url = "https://github.com/Ma27/git-annex-adapter/commit/39cb6da69c1aec3d57ea9f68c2dea5113ae1b764.patch";
+      sha256 = "0wyy2icqan3jpiw7dm50arfq3mgq4b5s3g91k82srap763r9hg5m";
+    })
+
+    # fixes the testcase which runs "git status" and complies with the
+    # slightly altered output.
     (fetchpatch {
       url = "https://github.com/alpernebbi/git-annex-adapter/commit/9f64c4b99cae7b681820c6c7382e1e40489f4d1e.patch";
       sha256 = "0yh66gial6bx7kbl7s7lkzljnkpgvgr8yahqqcq9z76d0w752dir";
     })
+  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+    # `rev` is part of utillinux on NixOS which is not available on `nixpks` for darwin:
+    # https://logs.nix.ci/?key=nixos/nixpkgs.45061&attempt_id=271763ba-2ae7-4098-b469-b82b1d8edb9b
+    (fetchpatch {
+      url = "https://github.com/alpernebbi/git-annex-adapter/commit/0b60b4577528b309f6ac9d47b55a00dbda9850ea.patch";
+      sha256 = "0z608hpmyzv1mm01dxr7d6bi1hc77h4yafghkynmv99ijgnm1qk7";
+    })
   ];
 
   checkInputs = [