diff options
author | V3n3RiX <venerix@koprulu.sector> | 2025-02-19 00:15:15 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2025-02-19 00:15:15 +0000 |
commit | 2e512e4e32285f8c4eb19586d014cb9d31454ec9 (patch) | |
tree | e5884cadbd260c6936495a63b92f4503d54e5428 /dev-python/pytest | |
parent | 5264c18a325553759d67fb4e059db03cf3fc5c81 (diff) |
gentoo auto-resync : 19:02:2025 - 00:15:15
Diffstat (limited to 'dev-python/pytest')
-rw-r--r-- | dev-python/pytest/Manifest | 3 | ||||
-rw-r--r-- | dev-python/pytest/files/pytest-8.3.4-pygments-2.19.patch | 106 | ||||
-rw-r--r-- | dev-python/pytest/pytest-8.3.4.ebuild | 12 |
3 files changed, 116 insertions, 5 deletions
diff --git a/dev-python/pytest/Manifest b/dev-python/pytest/Manifest index eb87d2048d8e..c9f957283bb0 100644 --- a/dev-python/pytest/Manifest +++ b/dev-python/pytest/Manifest @@ -1,4 +1,5 @@ AUX pytest-7.4.3-no-color.patch 1293 BLAKE2B 85ae23dc612eb7825f4c3ba2d727a6115540118269ae2748fcb4b39b958180078f0c171562a84879f7b18da16149fb40d06be36e782abf41133ae6d510414490 SHA512 7550397bb42f08c886dd72674a4bfd53dbe449e30c1fe51358b77eb055d3626c053167a27cc2b0883151a4651b6133be222dcf78cab8675b980c79836f72ae57 +AUX pytest-8.3.4-pygments-2.19.patch 4752 BLAKE2B a553da314179fce03c7225e99ef0d33b7ea9b0267d2f9651e096c70a14fd606c98b42942d7b406a13499ed2a71252f63150369aa63dcd1500af183049d5cd8b7 SHA512 93ef119952f5105a745932d87111ef73c834ec5ae889e6a1906a8dd5276d4e303ceaede9012441a31ab8ffdaca7f39698aa6ea12a49b0a6e1f52a48c5bac9a43 DIST pytest-7.4.4.tar.gz 1357116 BLAKE2B 0bf281b3d4b7b2eb7805423a75c8c2befa820cc230318511e5a2d5ea35321a78a2603d5dbc033414ed73171525371efa9d9f54083d5638fc752c1c218e6d53aa SHA512 28a259dac6739683c131993409d508e10fbfee461291b8fc7697dd83f30725a3c60e681ba00b5669a215af6a5e683f07a329485d780acc9ad0372a6552f783a1 DIST pytest-8.0.2.tar.gz 1396924 BLAKE2B ad95d246f5592cfe54faea6c96e38cb60d3e2713070d1ff7cab6c42aea312883c5d97c99a930dbcbd8493e966c4b8351320f6494b4ab904afbf21d7e1dd004a7 SHA512 c495943baad05e09b467d23c7afadb3edff7ae93ee96290d6db9e64739236888148b63dff7e8e25b331b11bd48c55fb0ca8901cf823d69b1a922e94915bab2f1 DIST pytest-8.1.2.tar.gz 1410060 BLAKE2B 1379047c5ba434e98a383756c53a9cf31dc3bd3abcc49820f872b9110ec70906ca14080ce17ed2770b71195fbd79627a0eb16ee00429e165368144b20153a02b SHA512 a6ffae29da98ee4c357ebb03f00c4bc1a33f093ef867ad118841695548468c7f229eaa2c029a2ce3b158bbb0a65be5014e91555a223d04c1c72e614cb1d00546 @@ -8,5 +9,5 @@ EBUILD pytest-7.4.4.ebuild 3790 BLAKE2B 423ab7e603e423d33317e40e856147a47bc2146c EBUILD pytest-8.0.2.ebuild 3762 BLAKE2B b42378cb5a9d500692c7d56ed4afca8d3617e7955b21978f450c3715064fd0aa0513f31055d26b2d5b48c4fbebc285a957819f6540e37ad3ea64dcb4536cae2c SHA512 2d14cb001ad4a702152715e39a17c85aed9c4c95f2433719eaa9f1d2a165e0eeb9c071b707f1f510d9913933dd0af81f2326b7bcda90f95e7f68f326d2dbeb70 EBUILD pytest-8.1.2.ebuild 3743 BLAKE2B 5c6d59e9ff19dc924eae975b1e2a86f261a12703712fce0590a2ba70f82e18b5eabdfdd63fe7622fbcbbde7c8ef17b5fa638f92f412b7611f1566f10002095bc SHA512 8be8ca9eae330873aa9ccc47e9fac24ebd5c60fb20d08d9a616cbdf64dcf6be3efdd361da6f94f1296dcaa3d789c9a45b0e82975d3e3a75e60b6cc6c819be021 EBUILD pytest-8.2.2.ebuild 3699 BLAKE2B 008e49cf2e768cd64ccef4b79224d8da066b9d7e82778443f6ffe5d24521e7611889c8c23447c5d63c36c51aa39dbb4801d0b35c76ef30941a0a44baffaac058 SHA512 52c4e2786d694ad6ac5611d156981ab56cb96a8f9ef71014fb46bf98c1937f661a3578f394474786b18ff95389b16026b670429f8affbc8a5d25f9468952fd67 -EBUILD pytest-8.3.4.ebuild 3720 BLAKE2B fafb80b047e222adb93381b544842bdb07dbada3c1df25d41e4c8152722037fab4de7846bd883db8db205832e5ea859a76e00f751c78e67b5eca460a7b2067a0 SHA512 f5b68571c4b64571dd0ed2623de0351aa3d0864063639e43e0345edf41347bedb68cb04ff12b4bb1723300a4664b08de95a2fda3fd3bd867afda03e4fd9e1469 +EBUILD pytest-8.3.4.ebuild 3778 BLAKE2B d05ac266127d40ac967b76f82fab1837e859252f3be5ec7d0fd645a1a1043f2699b305957b600dc3511eede8b1cbf2522f08dfb99e627b031fcca102c1781121 SHA512 ce509afaa11f754132ac160cb828689a2222f46686e9a86dfe5e13ee01a6037ff1de7b434384f8562e46c6bdab778733f0baf8db3e723348a0fd842d3391eb5b MISC metadata.xml 391 BLAKE2B 48d31ecb4c8b171ee4e84a58399211368ddc00dfb5dbe0999f96e03d744294cd4fd5263e90600c93d1f13c7da21052faef84b6d0d56709f3559e37b3392ca31d SHA512 6e9caa57eda23995d21df6f52c52d5868e1ff56abb6c1351ffc0fe14b771639473481a2630e659caaff83f0255379aa2d012175af52a0de41221b27d3ab2f425 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 <me@the-compiler.org> +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..561634bb8170 100644 --- a/dev-python/pytest/pytest-8.3.4.ebuild +++ b/dev-python/pytest/pytest-8.3.4.ebuild @@ -4,8 +4,8 @@ EAPI=8 DISTUTILS_USE_PEP517=setuptools -PYTHON_TESTED=( python3_{10..13} pypy3 ) -PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" pypy3_11 python3_13t ) +PYTHON_TESTED=( python3_{10..13} pypy3 pypy3_11 ) +PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" python3_13t ) inherit distutils-r1 pypi @@ -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 @@ -101,12 +106,11 @@ python_test() { ) case ${EPYTHON} in - pypy3) + pypy3*) EPYTEST_DESELECT+=( # regressions on pypy3.9 # https://github.com/pytest-dev/pytest/issues/9787 testing/test_skipping.py::test_errors_in_xfail_skip_expressions - testing/test_unraisableexception.py ) ;; esac |