From f8e8b40db295aae1215cc8a38f6cae7502bdfb47 Mon Sep 17 00:00:00 2001 From: Bryan Lai Date: Sat, 16 Mar 2024 22:36:43 +0800 Subject: [PATCH 1/2] python311Packages.python-lsp-black: fix build Some tests are broken in the current staging-next due to black version bump to v24.2.0. Upstream fix is already available and scheduled for the next release. Fetch the patch for now until upstream releases 2.0.1. --- .../python-modules/python-lsp-black/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/development/python-modules/python-lsp-black/default.nix b/pkgs/development/python-modules/python-lsp-black/default.nix index 59b4cdaa76f0..6387e833b7fc 100644 --- a/pkgs/development/python-modules/python-lsp-black/default.nix +++ b/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 ]; From 3213fbef2c7ec5935366709e0ed20d4e7372578d Mon Sep 17 00:00:00 2001 From: Bryan Lai Date: Sat, 16 Mar 2024 23:09:16 +0800 Subject: [PATCH 2/2] python311Packages.pylint: disable failing test Similar failures have been observed upstream, but the fix has not landed yet, so we disable the failing `test_functional` with a comment linked to the upstream issues. --- pkgs/development/python-modules/pylint/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/pylint/default.nix b/pkgs/development/python-modules/pylint/default.nix index 948b2afc5a15..52d1f976514f 100644 --- a/pkgs/development/python-modules/pylint/default.nix +++ b/pkgs/development/python-modules/pylint/default.nix @@ -96,6 +96,8 @@ buildPythonPackage rec { "test_save_and_load_not_a_linter_stats" # Truncated string expectation mismatch "test_truncated_compare" + # Probably related to pytest versions, see pylint-dev/pylint#9477 and pylint-dev/pylint#9483 + "test_functional" # AssertionError: assert [('specializa..., 'Ancestor')] == [('aggregatio..., 'Ancestor')] "test_functional_relation_extraction" ] ++ lib.optionals stdenv.isDarwin [