Bug#1028619: rich: autopkgtest is failng after updating pygments to 2.14.0+dfsg-1

2023-01-13 Thread Carsten Schoenert

tags -1 patch + upstream
forwarded -1 https://github.com/Textualize/rich/pull/2751

Am 13.01.23 um 19:25 schrieb Sandro Tosi:

yeah i'm wondering why you keep updating packages you dont maintain to
new upstream releases and breaking revdeps as consequence


It's seems to me you are the only person who who disagrees on the work I do.

That rdeps are will fail on package update is quite normal not only to 
me. But it's a difference if a upstream project is doing a major version 
bump or some usual minor update.
And we are not in any freeze state yet there I agree no uncoordinated 
and unneeded version updates should happen.


So far possible I pointed in other reports I did open to the upstream 
fix that adjust the local tests for the different behavior pygments 
2.14.0 is producing.
Within rich this doesn't did happen yet by any other reporter or by 
upstream itself.


So I created a PR [1] that will fix the issues within the tests.

For your convenience I added the same patch here where I can rebuild the 
current version of rich in unstable successful again.


[1] https://github.com/Textualize/rich/pull/2751

--
Regards
CarstenFrom bea71b3ca0f7b5c22f0ed050eb125b32e8085a65 Mon Sep 17 00:00:00 2001
From: Carsten Schoenert 
Date: Sat, 14 Jan 2023 07:38:57 +0100
Subject: [PATCH] tests: Adjustments to run tests with pygments 2.14.0

The current most recent version of pygments produces some different
output which provoke failing some of the the existing tests.
---
 tests/test_syntax.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/test_syntax.py b/tests/test_syntax.py
index 5eff05ee..6b8cfd8b 100644
--- a/tests/test_syntax.py
+++ b/tests/test_syntax.py
@@ -110,7 +110,7 @@ def test_python_render_simple_indent_guides():
 )
 rendered_syntax = render(syntax)
 print(repr(rendered_syntax))
-expected = '\x1b[34mdef\x1b[0m \x1b[32mloop_first_last\x1b[0m(values: Iterable[T]) -> Iterable[Tuple[\x1b[36mb\x1b[0m\n\x1b[2m│   \x1b[0m\x1b[33m"""Iterate and generate a tuple with a flag for first an\x1b[0m\n\x1b[2m│   \x1b[0miter_values = \x1b[36miter\x1b[0m(values)\n\x1b[2m│   \x1b[0m\x1b[34mtry\x1b[0m:\n\x1b[2m│   │   \x1b[0mprevious_value = \x1b[36mnext\x1b[0m(iter_values)\n\x1b[2m│   \x1b[0m\x1b[34mexcept\x1b[0m \x1b[36mStopIteration\x1b[0m:\n\x1b[2m│   │   \x1b[0m\x1b[34mreturn\x1b[0m\n\x1b[2m│   \x1b[0mfirst = \x1b[34mTrue\x1b[0m\n\x1b[2m│   \x1b[0m\x1b[34mfor\x1b[0m value \x1b[35min\x1b[0m iter_values:\n\x1b[2m│   │   \x1b[0m\x1b[34myield\x1b[0m first, \x1b[34mFalse\x1b[0m, previous_value\n\x1b[2m│   │   \x1b[0mfirst = \x1b[34mFalse\x1b[0m\n\x1b[2m│   │   \x1b[0mprevious_value = value\n\x1b[2m│   \x1b[0m\x1b[34myield\x1b[0m first, \x1b[34mTrue\x1b[0m, previous_value\n'
+expected = '\x1b[34mdef\x1b[0m \x1b[32mloop_first_last\x1b[0m(values: Iterable[T]) -> Iterable[Tuple[\x1b[36mb\x1b[0m\n\x1b[2;37m│   \x1b[0m\x1b[33m"""Iterate and generate a tuple with a flag for first an\x1b[0m\n\x1b[2m│   \x1b[0miter_values = \x1b[36miter\x1b[0m(values)\n\x1b[2m│   \x1b[0m\x1b[34mtry\x1b[0m:\n\x1b[2m│   │   \x1b[0mprevious_value = \x1b[36mnext\x1b[0m(iter_values)\n\x1b[2m│   \x1b[0m\x1b[34mexcept\x1b[0m \x1b[36mStopIteration\x1b[0m:\n\x1b[2m│   │   \x1b[0m\x1b[34mreturn\x1b[0m\n\x1b[2m│   \x1b[0mfirst = \x1b[34mTrue\x1b[0m\n\x1b[2m│   \x1b[0m\x1b[34mfor\x1b[0m value \x1b[35min\x1b[0m iter_values:\n\x1b[2m│   │   \x1b[0m\x1b[34myield\x1b[0m first, \x1b[34mFalse\x1b[0m, previous_value\n\x1b[2m│   │   \x1b[0mfirst = \x1b[34mFalse\x1b[0m\n\x1b[2m│   │   \x1b[0mprevious_value = value\n\x1b[2m│   \x1b[0m\x1b[34myield\x1b[0m first, \x1b[34mTrue\x1b[0m, previous_value\n'
 assert rendered_syntax == expected
 
 
@@ -127,7 +127,7 @@ def test_python_render_line_range_indent_guides():
 )
 rendered_syntax = render(syntax)
 print(repr(rendered_syntax))
-expected = '\x1b[2m│   \x1b[0m\x1b[33m"""Iterate and generate a tuple with a flag for first an\x1b[0m\n\x1b[2m│   \x1b[0miter_values = \x1b[36miter\x1b[0m(values)\n'
+expected = '\x1b[2;37m│   \x1b[0m\x1b[33m"""Iterate and generate a tuple with a flag for first an\x1b[0m\n\x1b[2m│   \x1b[0miter_values = \x1b[36miter\x1b[0m(values)\n'
 assert rendered_syntax == expected
 
 
-- 
2.39.0



Bug#1028619: rich: autopkgtest is failng after updating pygments to 2.14.0+dfsg-1

2023-01-13 Thread Sandro Tosi
On Fri, Jan 13, 2023 at 1:24 PM Carsten Schoenert
 wrote:
>
> Source: rich
> Version: 13.0.0-1
> Severity: serious
>
> Dear Maintainer,
>
> after the upload of pygments 2.14.0+dfsg-1 your package is failung while
> running the autopkgtest.

yeah i'm wondering why you keep updating packages you dont maintain to
new upstream releases and breaking revdeps as consequence



-- 
Sandro "morph" Tosi
My website: http://sandrotosi.me/
Me at Debian: http://wiki.debian.org/SandroTosi
Twitter: https://twitter.com/sandrotosi



Bug#1028619: rich: autopkgtest is failng after updating pygments to 2.14.0+dfsg-1

2023-01-13 Thread Carsten Schoenert
Source: rich
Version: 13.0.0-1
Severity: serious

Dear Maintainer,

after the upload of pygments 2.14.0+dfsg-1 your package is failung while
running the autopkgtest.

The failed part in detail is:

=== FAILURES ===
___ test_python_render_simple_indent_guides 

def test_python_render_simple_indent_guides():
syntax = Syntax(
CODE,
lexer="python",
line_numbers=False,
theme="ansi_light",
code_width=60,
word_wrap=False,
indent_guides=True,
)
rendered_syntax = render(syntax)
print(repr(rendered_syntax))
expected = '\x1b[34mdef\x1b[0m \x1b[32mloop_first_last\x1b[0m(values: 
Iterable[T]) -> Iterable[Tuple[\x1b[36mb\x1b[0m\n\x1b[2m│   
\x1b[0m\x1b[33m"""Iterate and generate a tuple with a flag for first 
an\x1b[0m\n\x1b[2m│   \x1b[0miter_values = 
\x1b[36miter\x1b[0m(values)\n\x1b[2m│   \x1b[0m\x1b[34mtry\x1b[0m:\n\x1b[2m│   
│   \x1b[0mprevious_value = \x1b[36mnext\x1b[0m(iter_values)\n\x1b[2m│   
\x1b[0m\x1b[34mexcept\x1b[0m \x1b[36mStopIteration\x1b[0m:\n\x1b[2m│   │   
\x1b[0m\x1b[34mreturn\x1b[0m\n\x1b[2m│   \x1b[0mfirst = 
\x1b[34mTrue\x1b[0m\n\x1b[2m│   \x1b[0m\x1b[34mfor\x1b[0m value 
\x1b[35min\x1b[0m iter_values:\n\x1b[2m│   │   \x1b[0m\x1b[34myield\x1b[0m 
first, \x1b[34mFalse\x1b[0m, previous_value\n\x1b[2m│   │   \x1b[0mfirst = 
\x1b[34mFalse\x1b[0m\n\x1b[2m│   │   \x1b[0mprevious_value = value\n\x1b[2m│   
\x1b[0m\x1b[34myield\x1b[0m first, \x1b[34mTrue\x1b[0m, previous_value\n'
>   assert rendered_syntax == expected
E   assert '\x1b[34mdef\...vious_value\n' == '\x1b[34mdef\...vious_value\n'
E Skipping 81 identical leading characters in diff, use -v to show
E   mb␛[0m
E - ␛[2m│   ␛[0m␛[33m"""Iterate and generate a tuple with a flag for 
first an␛[0m
E + ␛[2;37m│   ␛[0m␛[33m"""Iterate and generate a tuple with a flag for 
first an␛[0m
E ?+++
E   ␛[2m│   ␛[0miter_values = ␛[36miter␛[0m(values)
E   ␛[2m│   ␛[0m␛[34mtry␛[0m:...
E 
E ...Full output truncated (10 lines hidden), use '-vv' to show

tests/test_syntax.py:114: AssertionError
- Captured stdout call -
'\x1b[34mdef\x1b[0m \x1b[32mloop_first_last\x1b[0m(values: Iterable[T]) -> 
Iterable[Tuple[\x1b[36mb\x1b[0m\n\x1b[2;37m│   \x1b[0m\x1b[33m"""Iterate and 
generate a tuple with a flag for first an\x1b[0m\n\x1b[2m│   \x1b[0miter_values 
= \x1b[36miter\x1b[0m(values)\n\x1b[2m│   \x1b[0m\x1b[34mtry\x1b[0m:\n\x1b[2m│  
 │   \x1b[0mprevious_value = \x1b[36mnext\x1b[0m(iter_values)\n\x1b[2m│   
\x1b[0m\x1b[34mexcept\x1b[0m \x1b[36mStopIteration\x1b[0m:\n\x1b[2m│   │   
\x1b[0m\x1b[34mreturn\x1b[0m\n\x1b[2m│   \x1b[0mfirst = 
\x1b[34mTrue\x1b[0m\n\x1b[2m│   \x1b[0m\x1b[34mfor\x1b[0m value 
\x1b[35min\x1b[0m iter_values:\n\x1b[2m│   │   \x1b[0m\x1b[34myield\x1b[0m 
first, \x1b[34mFalse\x1b[0m, previous_value\n\x1b[2m│   │   \x1b[0mfirst = 
\x1b[34mFalse\x1b[0m\n\x1b[2m│   │   \x1b[0mprevious_value = value\n\x1b[2m│   
\x1b[0m\x1b[34myield\x1b[0m first, \x1b[34mTrue\x1b[0m, previous_value\n'
_ test_python_render_line_range_indent_guides __

def test_python_render_line_range_indent_guides():
syntax = Syntax(
CODE,
lexer="python",
line_numbers=False,
theme="ansi_light",
code_width=60,
word_wrap=False,
line_range=(2, 3),
indent_guides=True,
)
rendered_syntax = render(syntax)
print(repr(rendered_syntax))
expected = '\x1b[2m│   \x1b[0m\x1b[33m"""Iterate and generate a tuple 
with a flag for first an\x1b[0m\n\x1b[2m│   \x1b[0miter_values = 
\x1b[36miter\x1b[0m(values)\n'
>   assert rendered_syntax == expected
E   assert '\x1b[2;37m│ ...[0m(values)\n' == '\x1b[2m│   \...[0m(values)\n'
E - ␛[2m│   ␛[0m␛[33m"""Iterate and generate a tuple with a flag for 
first an␛[0m
E + ␛[2;37m│   ␛[0m␛[33m"""Iterate and generate a tuple with a flag for 
first an␛[0m
E ?+++
E   ␛[2m│   ␛[0miter_values = ␛[36miter␛[0m(values)

tests/test_syntax.py:131: AssertionError
- Captured stdout call -
'\x1b[2;37m│   \x1b[0m\x1b[33m"""Iterate and generate a tuple with a flag for 
first an\x1b[0m\n\x1b[2m│   \x1b[0miter_values = \x1b[36miter\x1b[0m(values)\n'
=== short test summary info 
FAILED tests/test_syntax.py::test_python_render_simple_indent_guides - assert...
FAILED tests/test_syntax.py::test_python_render_line_range_indent_guides - as...
== 2 failed, 765 passed, 23 skipped in 5.86s ===
E: pybuild pybuild:388: test: plugin pyproject failed with: exit code=1: cd