From 28d1115bb5e42fe92ed2a1976f385f2eb82d2404 Mon Sep 17 00:00:00 2001 From: Daniel Baker Date: Sun, 19 Jul 2026 22:50:02 -0700 Subject: [PATCH 1/3] python3Packages.python-lsp-black: fix build Two independent breakages on the default Python 3.14 / setuptools 82 stack: - tests/test_plugin.py imports pkg_resources, which setuptools 81+ no longer ships; add setuptools_80 to nativeCheckInputs so it is available at test time. - black 26.5 split SourceASTParseError out of ASTSafetyError, which the plugin did not catch; backport the upstream fix (python-lsp-black#65). Assisted-by: Claude Code (Claude Opus 4.8) --- .../python-modules/python-lsp-black/default.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/python-lsp-black/default.nix b/pkgs/development/python-modules/python-lsp-black/default.nix index e129a26a5f2f..d68d9b3053eb 100644 --- a/pkgs/development/python-modules/python-lsp-black/default.nix +++ b/pkgs/development/python-modules/python-lsp-black/default.nix @@ -15,6 +15,7 @@ # checks pytestCheckHook, + setuptools_80, }: buildPythonPackage rec { @@ -41,7 +42,14 @@ buildPythonPackage rec { ++ lib.optional (lib.versionAtLeast black.version "24.3.0") (fetchpatch { url = "https://github.com/python-lsp/python-lsp-black/commit/9298585a9d14d25920c33b188d79e820dc98d4a9.patch"; hash = "sha256-4u0VIS7eidVEiKRW2wc8lJVkJwhzJD/M+uuqmTtiZ7E="; - }); + }) + # https://github.com/python-lsp/python-lsp-black/pull/65 (black >= 26.5) + ++ [ + (fetchpatch { + url = "https://github.com/python-lsp/python-lsp-black/commit/35b5bc6f944bddac0c896127dc44a9404e95f482.patch"; + hash = "sha256-FRxM8leFVkPjRiR3wNjy5g5BazHc6ZvtnoI8Qgz4co4="; + }) + ]; build-system = [ setuptools ]; @@ -52,7 +60,10 @@ buildPythonPackage rec { pythonImportsCheck = [ "pylsp_black" ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + setuptools_80 # for pkg_resources, removed in setuptools 81+ (tests/test_plugin.py) + ]; meta = { homepage = "https://github.com/python-lsp/python-lsp-black"; From 29b6b653f8195f7dc3114bd8c030e34646ceb67c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Thu, 23 Jul 2026 14:37:16 +0200 Subject: [PATCH 2/3] python314Packages.python-lsp-black: remove always true conditions from patches --- .../python-lsp-black/default.nix | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/python-lsp-black/default.nix b/pkgs/development/python-modules/python-lsp-black/default.nix index d68d9b3053eb..2f8356d7eeb1 100644 --- a/pkgs/development/python-modules/python-lsp-black/default.nix +++ b/pkgs/development/python-modules/python-lsp-black/default.nix @@ -1,7 +1,6 @@ { lib, buildPythonPackage, - pythonOlder, fetchFromGitHub, black, fetchpatch, @@ -30,26 +29,23 @@ buildPythonPackage rec { hash = "sha256-nV6mePSWzfPW2RwXg/mxgzfT9wD95mmTuPnPEro1kEY="; }; - patches = - /** - includes a series of patches fixing tests not yet released as 2.0.1+ version - they are meant to keep up to date with black releases - */ - lib.optional (lib.versionAtLeast black.version "24.2.0") (fetchpatch { + patches = [ + # includes a series of patches fixing tests not yet released as 2.0.1+ version + # they are meant to keep up to date with black releases + (fetchpatch { url = "https://github.com/python-lsp/python-lsp-black/commit/d43b41431379f9c9bb05fab158c4d97e6d515f8f.patch"; hash = "sha256-38bYU27+xtA8Kq3appXTkNnkG5/XgrUJ2nQ5+yuSU2U="; }) - ++ lib.optional (lib.versionAtLeast black.version "24.3.0") (fetchpatch { + (fetchpatch { url = "https://github.com/python-lsp/python-lsp-black/commit/9298585a9d14d25920c33b188d79e820dc98d4a9.patch"; hash = "sha256-4u0VIS7eidVEiKRW2wc8lJVkJwhzJD/M+uuqmTtiZ7E="; }) # https://github.com/python-lsp/python-lsp-black/pull/65 (black >= 26.5) - ++ [ - (fetchpatch { - url = "https://github.com/python-lsp/python-lsp-black/commit/35b5bc6f944bddac0c896127dc44a9404e95f482.patch"; - hash = "sha256-FRxM8leFVkPjRiR3wNjy5g5BazHc6ZvtnoI8Qgz4co4="; - }) - ]; + (fetchpatch { + url = "https://github.com/python-lsp/python-lsp-black/commit/35b5bc6f944bddac0c896127dc44a9404e95f482.patch"; + hash = "sha256-FRxM8leFVkPjRiR3wNjy5g5BazHc6ZvtnoI8Qgz4co4="; + }) + ]; build-system = [ setuptools ]; From cd7de3a50e463917c554b8d86d3619c2ecd9cdc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Thu, 23 Jul 2026 14:38:12 +0200 Subject: [PATCH 3/3] python314Packages.python-lsp-black: drop unused input --- pkgs/development/python-modules/python-lsp-black/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/development/python-modules/python-lsp-black/default.nix b/pkgs/development/python-modules/python-lsp-black/default.nix index 2f8356d7eeb1..573f400a4bd7 100644 --- a/pkgs/development/python-modules/python-lsp-black/default.nix +++ b/pkgs/development/python-modules/python-lsp-black/default.nix @@ -10,7 +10,6 @@ # dependencies python-lsp-server, - tomli, # checks pytestCheckHook,