From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4F89A1582EF for ; Tue, 18 Feb 2025 12:50:25 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 321F634317D for ; Tue, 18 Feb 2025 12:50:25 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 7C0E8110472; Tue, 18 Feb 2025 12:50:12 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 71666110472 for ; Tue, 18 Feb 2025 12:50:12 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id F371B3430F3 for ; Tue, 18 Feb 2025 12:50:11 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1EEC72735 for ; Tue, 18 Feb 2025 12:50:10 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1739882988.55fc42718e2a6e2a4155b0f3f069646173041aa4.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pytest/, dev-python/pytest/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/pytest/files/pytest-8.3.4-pygments-2.19.patch dev-python/pytest/pytest-8.3.4.ebuild X-VCS-Directories: dev-python/pytest/files/ dev-python/pytest/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 55fc42718e2a6e2a4155b0f3f069646173041aa4 X-VCS-Branch: master Date: Tue, 18 Feb 2025 12:50:10 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 026e619a-c70f-4c89-af65-d040d10050dd X-Archives-Hash: 50dd81c433cf30c08fad6e0f0c25a010 commit: 55fc42718e2a6e2a4155b0f3f069646173041aa4 Author: Michał Górny gentoo org> AuthorDate: Tue Feb 18 11:29:35 2025 +0000 Commit: Michał Górny gentoo org> CommitDate: Tue Feb 18 12:49:48 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=55fc4271 dev-python/pytest: Backport a test fix for pygments-2.19 Signed-off-by: Michał Górny gentoo.org> .../pytest/files/pytest-8.3.4-pygments-2.19.patch | 106 +++++++++++++++++++++ dev-python/pytest/pytest-8.3.4.ebuild | 5 + 2 files changed, 111 insertions(+) diff --git a/dev-python/pytest/files/pytest-8.3.4-pygments-2.19.patch b/dev-python/pytest/files/pytest-8.3.4-pygments-2.19.patch new file mode 100644 index 000000000000..5674f72ead18 --- /dev/null +++ b/dev-python/pytest/files/pytest-8.3.4-pygments-2.19.patch @@ -0,0 +1,106 @@ +From ad4081f63985ff42f54fc52baa7ce0e7b5cffba4 Mon Sep 17 00:00:00 2001 +From: Florian Bruhin +Date: Wed, 8 Jan 2025 18:04:15 +0100 +Subject: [PATCH] Merge pull request #13113 from + The-Compiler/fix-pygments-whitespace + +Fix selftests with Pygments >= 2.19.0 + +(cherry picked from commit bdfc3a99bd733f385f150446caef6d5843bb6418) +--- + changelog/13112.contrib.rst | 1 + + testing/conftest.py | 7 +++++++ + testing/test_terminal.py | 10 +++++----- + 3 files changed, 13 insertions(+), 5 deletions(-) + create mode 100644 changelog/13112.contrib.rst + +diff --git a/changelog/13112.contrib.rst b/changelog/13112.contrib.rst +new file mode 100644 +index 000000000..5e59a736e +--- /dev/null ++++ b/changelog/13112.contrib.rst +@@ -0,0 +1 @@ ++Fixed selftest failures in ``test_terminal.py`` with Pygments >= 2.19.0 +diff --git a/testing/conftest.py b/testing/conftest.py +index 69af03324..194da0f83 100644 +--- a/testing/conftest.py ++++ b/testing/conftest.py +@@ -2,10 +2,13 @@ + from __future__ import annotations + + import dataclasses ++import importlib.metadata + import re + import sys + from typing import Generator + ++from packaging.version import Version ++ + from _pytest.monkeypatch import MonkeyPatch + from _pytest.pytester import Pytester + import pytest +@@ -168,6 +171,9 @@ def color_mapping(): + + Used by tests which check the actual colors output by pytest. + """ ++ # https://github.com/pygments/pygments/commit/d24e272894a56a98b1b718d9ac5fabc20124882a ++ pygments_version = Version(importlib.metadata.version("pygments")) ++ pygments_has_kwspace_hl = pygments_version >= Version("2.19") + + class ColorMapping: + COLORS = { +@@ -180,6 +186,7 @@ def color_mapping(): + "bold": "\x1b[1m", + "reset": "\x1b[0m", + "kw": "\x1b[94m", ++ "kwspace": "\x1b[90m \x1b[39;49;00m" if pygments_has_kwspace_hl else " ", + "hl-reset": "\x1b[39;49;00m", + "function": "\x1b[92m", + "number": "\x1b[94m", +diff --git a/testing/test_terminal.py b/testing/test_terminal.py +index 14c152d61..cbbe9cbd7 100644 +--- a/testing/test_terminal.py ++++ b/testing/test_terminal.py +@@ -1299,13 +1299,13 @@ def test_color_yes(pytester: Pytester, color_mapping) -> None: + "=*= FAILURES =*=", + "{red}{bold}_*_ test_this _*_{reset}", + "", +- " {reset}{kw}def{hl-reset} {function}test_this{hl-reset}():{endline}", ++ " {reset}{kw}def{hl-reset}{kwspace}{function}test_this{hl-reset}():{endline}", + "> fail(){endline}", + "", + "{bold}{red}test_color_yes.py{reset}:5: ", + "_ _ * _ _*", + "", +- " {reset}{kw}def{hl-reset} {function}fail{hl-reset}():{endline}", ++ " {reset}{kw}def{hl-reset}{kwspace}{function}fail{hl-reset}():{endline}", + "> {kw}assert{hl-reset} {number}0{hl-reset}{endline}", + "{bold}{red}E assert 0{reset}", + "", +@@ -2585,7 +2585,7 @@ class TestCodeHighlight: + result.stdout.fnmatch_lines( + color_mapping.format_for_fnmatch( + [ +- " {reset}{kw}def{hl-reset} {function}test_foo{hl-reset}():{endline}", ++ " {reset}{kw}def{hl-reset}{kwspace}{function}test_foo{hl-reset}():{endline}", + "> {kw}assert{hl-reset} {number}1{hl-reset} == {number}10{hl-reset}{endline}", + "{bold}{red}E assert 1 == 10{reset}", + ] +@@ -2607,7 +2607,7 @@ class TestCodeHighlight: + result.stdout.fnmatch_lines( + color_mapping.format_for_fnmatch( + [ +- " {reset}{kw}def{hl-reset} {function}test_foo{hl-reset}():{endline}", ++ " {reset}{kw}def{hl-reset}{kwspace}{function}test_foo{hl-reset}():{endline}", + " {print}print{hl-reset}({str}'''{hl-reset}{str}{hl-reset}", + "> {str} {hl-reset}{str}'''{hl-reset}); {kw}assert{hl-reset} {number}0{hl-reset}{endline}", + "{bold}{red}E assert 0{reset}", +@@ -2630,7 +2630,7 @@ class TestCodeHighlight: + result.stdout.fnmatch_lines( + color_mapping.format_for_fnmatch( + [ +- " {reset}{kw}def{hl-reset} {function}test_foo{hl-reset}():{endline}", ++ " {reset}{kw}def{hl-reset}{kwspace}{function}test_foo{hl-reset}():{endline}", + "> {kw}assert{hl-reset} {number}1{hl-reset} == {number}10{hl-reset}{endline}", + "{bold}{red}E assert 1 == 10{reset}", + ] diff --git a/dev-python/pytest/pytest-8.3.4.ebuild b/dev-python/pytest/pytest-8.3.4.ebuild index cd59dc91caa9..835e9a6ea2d6 100644 --- a/dev-python/pytest/pytest-8.3.4.ebuild +++ b/dev-python/pytest/pytest-8.3.4.ebuild @@ -50,6 +50,11 @@ BDEPEND=" ) " +PATCHES=( + # ad4081f63985ff42f54fc52baa7ce0e7b5cffba4 + "${FILESDIR}/${P}-pygments-2.19.patch" +) + src_test() { # workaround new readline defaults echo "set enable-bracketed-paste off" > "${T}"/inputrc || die