]> git.scottworley.com Git - pinch/blobdiff - default.nix
Make tests fast again when using recent git-cache with backoff
[pinch] / default.nix
index 3209685a0cdc7fb17244ca945fe34383b3ec9163..56f47deebc7b86acddafed2e53a553e3bd9350ab 100644 (file)
@@ -1,11 +1,32 @@
 { pkgs ? import <nixpkgs> { }, lint ? false }:
-pkgs.python3Packages.callPackage
-({ lib, buildPythonPackage, nix, git, autopep8, mypy, pylint, }:
+
+let
+  git-cache-fallback = { buildPythonPackage, fetchgit, git, mypy, }:
+    buildPythonPackage rec {
+      pname = "git-cache";
+      version = "1.0.0";
+      src = fetchgit {
+        url = "https://scottworley.com/git-cache.git";
+        rev = "v${version}";
+        sha256 = "06mzjc424988n2s1h25x2bi3mxbk2pnba31zkjljgw4cgw2p9036";
+      };
+      checkInputs = [ git mypy ];
+      doCheck = true;
+      checkPhase = "./test.sh";
+    };
+
+in pkgs.python3Packages.callPackage
+({ lib, buildPythonPackage, nix, git, autopep8, mypy, pylint, git-cache, }:
   buildPythonPackage rec {
     pname = "pinch";
-    version = "2.0.0-pre";
+    version = "3.0.1-pre";
     src = lib.cleanSource ./.;
+    propagatedBuildInputs = [ git-cache ];
     checkInputs = [ nix git mypy ] ++ lib.optionals lint [ autopep8 pylint ];
     doCheck = true;
     checkPhase = "./test.sh";
-  }) { }
+  }) {
+    git-cache =
+      pkgs.python3Packages.git-cache or (pkgs.python3Packages.callPackage
+        git-cache-fallback { });
+  }