about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/python-lsp-black/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/python-lsp-black/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/python-lsp-black/default.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/python-lsp-black/default.nix b/nixpkgs/pkgs/development/python-modules/python-lsp-black/default.nix
index 59b4cdaa76f0..6387e833b7fc 100644
--- a/nixpkgs/pkgs/development/python-modules/python-lsp-black/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/python-lsp-black/default.nix
@@ -7,6 +7,7 @@
 , python-lsp-server
 , setuptools
 , tomli
+, fetchpatch
 }:
 
 buildPythonPackage rec {
@@ -22,6 +23,17 @@ buildPythonPackage rec {
     hash = "sha256-nV6mePSWzfPW2RwXg/mxgzfT9wD95mmTuPnPEro1kEY=";
   };
 
+  patches =
+    /** fix test failure with black<24.2.0;
+        remove this patch once python-lsp-black>2.0.0 */
+    lib.optional
+      (with lib; (versionOlder version "2.0.1") && (versionAtLeast black.version "24.2.0"))
+      (fetchpatch {
+        url = "https://patch-diff.githubusercontent.com/raw/python-lsp/python-lsp-black/pull/56.patch";
+        hash = "sha256-38bYU27+xtA8Kq3appXTkNnkG5/XgrUJ2nQ5+yuSU2U=";
+      })
+    ++ [ ];
+
   nativeBuildInputs = [
     setuptools
   ];