]> git.scottworley.com Git - git-cache/blobdiff - default.nix
Merge changelog from 1.1 branch
[git-cache] / default.nix
index 6c57b0d389bd9f9d1ae2c26ee2232b0ec5851078..ee0f2683dab5b19bb6eeafde8c564356212ead35 100644 (file)
@@ -1,11 +1,34 @@
 { pkgs ? import <nixpkgs> { }, lint ? false }:
-pkgs.python3Packages.callPackage
-({ lib, buildPythonPackage, nix, git, autopep8, mypy, pylint, }:
+
+let
+  # Remove this package definition after https://github.com/NixOS/nixpkgs/pull/93377 reaches stable
+  backoff-fallback = { lib, buildPythonPackage, fetchPypi }:
+    buildPythonPackage rec {
+      pname = "backoff";
+      version = "1.10.0";
+      src = fetchPypi {
+        inherit pname version;
+        sha256 = "190rdpfhpjvb6bjh99fhdkgfsfkjwky7nz7b0nn5ah67z8hs1yxq";
+      };
+      meta = with lib; {
+        description = "Function decoration for backoff and retry";
+        homepage = "https://github.com/litl/backoff";
+        license = licenses.mit;
+        maintainers = with maintainers; [ chkno ];
+      };
+    };
+
+in pkgs.python3Packages.callPackage
+({ lib, buildPythonPackage, nix, git, backoff, autopep8, mypy, pylint, }:
   buildPythonPackage rec {
     pname = "git-cache";
-    version = "1.2.0-pre";
+    version = "1.2.2-pre";
     src = lib.cleanSource ./.;
+    propagatedBuildInputs = [ backoff ];
     checkInputs = [ nix git mypy ] ++ lib.optionals lint [ autopep8 pylint ];
     doCheck = true;
     checkPhase = "./test.sh";
-  }) { }
+  }) {
+    backoff = pkgs.python3Packages.backoff or (pkgs.python3Packages.callPackage
+      backoff-fallback { });
+  }