From ff3d8044cf03949139a2994ff605b0cd1dd10bbe Mon Sep 17 00:00:00 2001 From: Gerhard Schwanzer Date: Mon, 13 Jul 2026 16:51:52 +0200 Subject: [PATCH] cpplint: fix build on Python 3.14 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport upstream’s removal of deprecated codecs.open(), whose warnings cause the test suite to fail under Python 3.14. https://github.com/cpplint/cpplint/pull/405 Assisted-by: pi coding agent / Mika (OpenAI gpt-5.6-sol) --- pkgs/by-name/cp/cpplint/package.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/by-name/cp/cpplint/package.nix b/pkgs/by-name/cp/cpplint/package.nix index f28a21289b99..35df50e7375c 100644 --- a/pkgs/by-name/cp/cpplint/package.nix +++ b/pkgs/by-name/cp/cpplint/package.nix @@ -2,6 +2,7 @@ lib, python3Packages, fetchFromGitHub, + fetchpatch2, versionCheckHook, }: @@ -17,6 +18,20 @@ python3Packages.buildPythonApplication (finalAttrs: { hash = "sha256-4crTuqynQt8Nyjqea6DpREtLy7ydRF0hNVnc7tUnO1k="; }; + # Fix Python 3.14 test failures. Remove with the next release. + patches = [ + (fetchpatch2 { + name = "drop-codecs-open.patch"; + url = "https://github.com/cpplint/cpplint/commit/89bff410afed72e58d23ae084de4103986ea8630.patch?full_index=1"; + hash = "sha256-Jdeewj3GM7GMoRF7+Qz/9n1hc8PYPcXLgtSGwSUpT1E="; + }) + (fetchpatch2 { + name = "use-universal-newlines.patch"; + url = "https://github.com/cpplint/cpplint/commit/d15a8715a6e848f784fda700758c4ac2d252fd31.patch?full_index=1"; + hash = "sha256-Oo2doknEGnuxDJA0y17n1DCaKwadtMW/14a5wnIgfkw="; + }) + ]; + # We use pytest-cov-stub instead postPatch = '' substituteInPlace pyproject.toml \