Source: rich
Version: 13.7.1-1
Severity: normal
User: [email protected]
Usertags: python3.13
Forwarded: https://github.com/Textualize/rich/pull/3229

This package failed build from source when test-built against a version of
python3-defaults that includes 3.13 as a supported version.

To reproduce this issue, build against python3-defaults (python3-all-dev etc.)
from Debian experimental.

What's new in Python 3.13:
https://docs.python.org/3.13/whatsnew/3.13.html
I think upstream has dealt with these in newer releases.
https://github.com/Textualize/rich/issues?q=3.13

Log snippet:

   debian/rules override_dh_auto_test
make[1]: Entering directory '/<<PKGBUILDDIR>>'
PYBUILD_SYSTEM=custom PYBUILD_TEST_ARGS="PYTHONPATH=/<<PKGBUILDDIR>> 
{interpreter} -m pytest" dh_auto_test
I: pybuild base:311: PYTHONPATH=/<<PKGBUILDDIR>> python3.13 -m pytest
============================= test session starts ==============================
platform linux -- Python 3.13.0rc2, pytest-8.3.3, pluggy-1.5.0
rootdir: /<<PKGBUILDDIR>>
configfile: pyproject.toml
testpaths: tests
plugins: typeguard-4.3.0
collected 826 items

tests/test_align.py ................                                     [  1%]
tests/test_ansi.py .......                                               [  2%]
tests/test_bar.py .......                                                [  3%]
tests/test_block_bar.py ....                                             [  4%]
tests/test_box.py ......                                                 [  4%]
tests/test_card.py .                                                     [  4%]
tests/test_cells.py .......                                              [  5%]
tests/test_color.py .................                                    [  7%]
tests/test_color_triplet.py ...                                          [  8%]
tests/test_columns.py .                                                  [  8%]
tests/test_columns_align.py .                                            [  8%]
tests/test_console.py .................................................. [ 14%]
..............................................                           [ 20%]
tests/test_constrain.py .                                                [ 20%]
tests/test_containers.py ....                                            [ 20%]
tests/test_control.py .......                                            [ 21%]
tests/test_emoji.py ......                                               [ 22%]
tests/test_file_proxy.py ...                                             [ 22%]
tests/test_filesize.py ..                                                [ 22%]
tests/test_getfileno.py ...                                              [ 23%]
tests/test_highlighter.py .............................................. [ 28%]
....................................                                     [ 33%]
tests/test_inspect.py ...F....FFF..................................      [ 38%]
tests/test_json.py .                                                     [ 38%]
tests/test_jupyter.py ...                                                [ 39%]
tests/test_layout.py ......                                              [ 39%]
tests/test_live.py ..........                                            [ 41%]
tests/test_live_render.py ....                                           [ 41%]
tests/test_log.py ...                                                    [ 41%]
tests/test_logging.py ....                                               [ 42%]
tests/test_markdown.py ......                                            [ 43%]
tests/test_markdown_no_hyperlinks.py .                                   [ 43%]
tests/test_markup.py .....................                               [ 45%]
tests/test_measure.py ....                                               [ 46%]
tests/test_null_file.py .                                                [ 46%]
tests/test_padding.py .....                                              [ 46%]
tests/test_palette.py .                                                  [ 47%]
tests/test_panel.py ..........                                           [ 48%]
tests/test_pick.py .                                                     [ 48%]
tests/test_pretty.py ........F.............F.....F..............FF.....  [ 54%]
tests/test_progress.py ......................................            [ 59%]
tests/test_prompt.py ......                                              [ 59%]
tests/test_protocol.py ......                                            [ 60%]
tests/test_ratio.py .......                                              [ 61%]
tests/test_repr.py ........                                              [ 62%]
tests/test_rich_print.py .......                                         [ 63%]
tests/test_rule.py ................                                      [ 65%]
tests/test_rule_in_table.py ....                                         [ 65%]
tests/test_screen.py .                                                   [ 65%]
tests/test_segment.py .................................................  [ 71%]
tests/test_spinner.py .....                                              [ 72%]
tests/test_stack.py .                                                    [ 72%]
tests/test_status.py ..                                                  [ 72%]
tests/test_style.py ..........................                           [ 75%]
tests/test_styled.py .                                                   [ 75%]
tests/test_syntax.py .......................                             [ 78%]
tests/test_table.py ...............                                      [ 80%]
tests/test_text.py ..................................................... [ 86%]
......................................................                   [ 93%]
tests/test_theme.py .....                                                [ 94%]
tests/test_tools.py ....                                                 [ 94%]
tests/test_traceback.py ...................                              [ 96%]
tests/test_tree.py .....s.s.                                             [ 97%]
tests/test_windows_renderer.py sssssssssssssssss                         [100%]

=================================== FAILURES ===================================
________________ test_inspect_builtin_function_except_python311 ________________

    @skip_py312
    @skip_py311
    @skip_pypy3
    def test_inspect_builtin_function_except_python311():
        # Pre-3.11 Python versions - print builtin has no signature available
        expected = (
            "╭────────── <built-in function print> ───────────╮\n"
            "│ def print(...)                                 │\n"
            "│                                                │\n"
            "│ print(value, ..., sep=' ', end='\\n',           │\n"
            "│ file=sys.stdout, flush=False)                  │\n"
            "│                                                │\n"
            "│ 29 attribute(s) not shown. Run                 │\n"
            "│ inspect(inspect) for options.                  │\n"
            "╰────────────────────────────────────────────────╯\n"
        )
>       assert render(print) == expected
E       AssertionError: assert '╭────────── ...──────────╯\n' == '╭────────── 
...──────────╯\n'
E         
E         Skipping 53 identical leading characters in diff, use -v to show
E         - def print(...)                                 │
E         + def print(*args, sep=' ', end='\n', file=None, │
E         + │ flush=False):                                  │
E           │                                                │
E         - │ print(value, ..., sep=' ', end='\n',           │...
E         
E         ...Full output truncated (10 lines hidden), use '-vv' to show

tests/test_inspect.py:159: AssertionError
___________ test_inspect_integer_with_methods_python38_and_python39 ____________

    @skip_py37
    @skip_py310
    @skip_py311
    @skip_py312
    def test_inspect_integer_with_methods_python38_and_python39():
        expected = (
            "╭──────────────── <class 'int'> ─────────────────╮\n"
            "│ int([x]) -> integer                            │\n"
            "│ int(x, base=10) -> integer                     │\n"
            "│                                                │\n"
            "│      denominator = 1                           │\n"
            "│             imag = 0                           │\n"
            "│        numerator = 1                           │\n"
            "│             real = 1                           │\n"
            "│ as_integer_ratio = def as_integer_ratio():     │\n"
            "│                    Return integer ratio.       │\n"
            "│       bit_length = def bit_length(): Number of │\n"
            "│                    bits necessary to represent │\n"
            "│                    self in binary.             │\n"
            "│        conjugate = def conjugate(...) Returns  │\n"
            "│                    self, the complex conjugate │\n"
            "│                    of any int.                 │\n"
            "│       from_bytes = def from_bytes(bytes,       │\n"
            "│                    byteorder, *,               │\n"
            "│                    signed=False): Return the   │\n"
            "│                    integer represented by the  │\n"
            "│                    given array of bytes.       │\n"
            "│         to_bytes = def to_bytes(length,        │\n"
            "│                    byteorder, *,               │\n"
            "│                    signed=False): Return an    │\n"
            "│                    array of bytes representing │\n"
            "│                    an integer.                 │\n"
            "╰────────────────────────────────────────────────╯\n"
        )
>       assert render(1, methods=True) == expected
E       AssertionError: assert '╭───────────...──────────╯\n' == 
'╭───────────...──────────╯\n'
E         
E         Skipping 477 identical leading characters in diff, use -v to show
E         -    Return integer ratio.       │
E         +    Return a pair of integers,  │
E         + │                    whose ratio is equal to the │
E         + │                    original int.               │
E         + │        bit_count = def bit_count(): Number of  │...
E         
E         ...Full output truncated (36 lines hidden), use '-vv' to show

tests/test_inspect.py:252: AssertionError
_______________ test_inspect_integer_with_methods_python310only ________________

    @skip_py37
    @skip_py38
    @skip_py39
    @skip_py311
    @skip_py312
    def test_inspect_integer_with_methods_python310only():
        expected = (
            "╭──────────────── <class 'int'> ─────────────────╮\n"
            "│ int([x]) -> integer                            │\n"
            "│ int(x, base=10) -> integer                     │\n"
            "│                                                │\n"
            "│      denominator = 1                           │\n"
            "│             imag = 0                           │\n"
            "│        numerator = 1                           │\n"
            "│             real = 1                           │\n"
            "│ as_integer_ratio = def as_integer_ratio():     │\n"
            "│                    Return integer ratio.       │\n"
            "│        bit_count = def bit_count(): Number of  │\n"
            "│                    ones in the binary          │\n"
            "│                    representation of the       │\n"
            "│                    absolute value of self.     │\n"
            "│       bit_length = def bit_length(): Number of │\n"
            "│                    bits necessary to represent │\n"
            "│                    self in binary.             │\n"
            "│        conjugate = def conjugate(...) Returns  │\n"
            "│                    self, the complex conjugate │\n"
            "│                    of any int.                 │\n"
            "│       from_bytes = def from_bytes(bytes,       │\n"
            "│                    byteorder, *,               │\n"
            "│                    signed=False): Return the   │\n"
            "│                    integer represented by the  │\n"
            "│                    given array of bytes.       │\n"
            "│         to_bytes = def to_bytes(length,        │\n"
            "│                    byteorder, *,               │\n"
            "│                    signed=False): Return an    │\n"
            "│                    array of bytes representing │\n"
            "│                    an integer.                 │\n"
            "╰────────────────────────────────────────────────╯\n"
        )
>       assert render(1, methods=True) == expected
E       AssertionError: assert '╭───────────...──────────╯\n' == 
'╭───────────...──────────╯\n'
E         
E         Skipping 477 identical leading characters in diff, use -v to show
E         -    Return integer ratio.       │
E         +    Return a pair of integers,  │
E         + │                    whose ratio is equal to the │
E         + │                    original int.               │
E           │        bit_count = def bit_count(): Number of  │...
E         
E         ...Full output truncated (36 lines hidden), use '-vv' to show

tests/test_inspect.py:294: AssertionError
_________________ test_inspect_integer_with_methods_python311 __________________

    @skip_py37
    @skip_py38
    @skip_py39
    @skip_py310
    @skip_py312
    def test_inspect_integer_with_methods_python311():
        # to_bytes and from_bytes methods on int had minor signature change -
        # they now, as of 3.11, have default values for all of their parameters
        expected = (
            "╭──────────────── <class 'int'> ─────────────────╮\n"
            "│ int([x]) -> integer                            │\n"
            "│ int(x, base=10) -> integer                     │\n"
            "│                                                │\n"
            "│      denominator = 1                           │\n"
            "│             imag = 0                           │\n"
            "│        numerator = 1                           │\n"
            "│             real = 1                           │\n"
            "│ as_integer_ratio = def as_integer_ratio():     │\n"
            "│                    Return integer ratio.       │\n"
            "│        bit_count = def bit_count(): Number of  │\n"
            "│                    ones in the binary          │\n"
            "│                    representation of the       │\n"
            "│                    absolute value of self.     │\n"
            "│       bit_length = def bit_length(): Number of │\n"
            "│                    bits necessary to represent │\n"
            "│                    self in binary.             │\n"
            "│        conjugate = def conjugate(...) Returns  │\n"
            "│                    self, the complex conjugate │\n"
            "│                    of any int.                 │\n"
            "│       from_bytes = def from_bytes(bytes,       │\n"
            "│                    byteorder='big', *,         │\n"
            "│                    signed=False): Return the   │\n"
            "│                    integer represented by the  │\n"
            "│                    given array of bytes.       │\n"
            "│         to_bytes = def to_bytes(length=1,      │\n"
            "│                    byteorder='big', *,         │\n"
            "│                    signed=False): Return an    │\n"
            "│                    array of bytes representing │\n"
            "│                    an integer.                 │\n"
            "╰────────────────────────────────────────────────╯\n"
        )
>       assert render(1, methods=True) == expected
E       AssertionError: assert '╭───────────...──────────╯\n' == 
'╭───────────...──────────╯\n'
E         
E         Skipping 477 identical leading characters in diff, use -v to show
E         -    Return integer ratio.       │
E         +    Return a pair of integers,  │
E         + │                    whose ratio is equal to the │
E         + │                    original int.               │
E           │        bit_count = def bit_count(): Number of  │...
E         
E         ...Full output truncated (27 lines hidden), use '-vv' to show

tests/test_inspect.py:338: AssertionError
____________________________ test_pretty_dataclass _____________________________

    def test_pretty_dataclass():
        dc = ExampleDataclass(1000, "Hello, World", 999, ["foo", "bar", "baz"])
        result = pretty_repr(dc, max_width=80)
        print(repr(result))
        assert (
            result
            == "ExampleDataclass(foo=1000, bar='Hello, World', baz=['foo', 
'bar', 'baz'])"
        )
        result = pretty_repr(dc, max_width=16)
        print(repr(result))
>       assert (
            result
            == "ExampleDataclass(\n    foo=1000,\n    bar='Hello, World',\n    
baz=[\n        'foo',\n        'bar',\n        'baz'\n    ]\n)"
        )
E       assert "ExampleDatac...bar', 'baz'])" == "ExampleDatac...az'\n    ]\n)"
E         
E         + ExampleDataclass(foo=1000, bar='Hello, World', baz=['foo', 'bar', 
'baz'])
E         - ExampleDataclass(
E         -     foo=1000,
E         -     bar='Hello, World',
E         -     baz=[
E         -         'foo',...
E         
E         ...Full output truncated (4 lines hidden), use '-vv' to show

tests/test_pretty.py:180: AssertionError
----------------------------- Captured stdout call -----------------------------
"ExampleDataclass(foo=1000, bar='Hello, World', baz=['foo', 'bar', 'baz'])"
"ExampleDataclass(foo=1000, bar='Hello, World', baz=['foo', 'bar', 'baz'])"
________________________ test_reference_cycle_dataclass ________________________

    def test_reference_cycle_dataclass():
        @dataclass
        class Example:
            x: int
            y: Any
    
        test = Example(1, None)
        test.y = test
        res = pretty_repr(test)
>       assert res == "Example(x=1, y=...)"
E       AssertionError: assert 'test_referen...e(x=1, y=...)' == 'Example(x=1, 
y=...)'
E         
E         - Example(x=1, y=...)
E         + test_reference_cycle_dataclass.<locals>.Example(x=1, y=...)

tests/test_pretty.py:352: AssertionError
___________________________ test_max_depth_dataclass ___________________________

    def test_max_depth_dataclass():
        @dataclass
        class Foo:
            foo: object
    
        @dataclass
        class Bar:
            bar: object
    
>       assert (
            pretty_repr(Foo(foo=Bar(bar=Foo(foo=[]))), max_depth=2)
            == "Foo(foo=Bar(bar=Foo(...)))"
        )
E       AssertionError: assert 'test_max_dep...Foo(foo=[])))' == 
'Foo(foo=Bar(bar=Foo(...)))'
E         
E         - Foo(foo=Bar(bar=Foo(...)))
E         + 
test_max_depth_dataclass.<locals>.Foo(foo=test_max_depth_dataclass.<locals>.Bar(bar=test_max_depth_dataclass.<locals>.Foo(foo=[])))

tests/test_pretty.py:483: AssertionError
______________________________ test_attrs_broken _______________________________

    @skip_py310
    @skip_py311
    @skip_py312
    def test_attrs_broken():
        @attr.define
        class Foo:
            bar: int
    
        foo = Foo(1)
        del foo.bar
        result = pretty_repr(foo)
        print(repr(result))
        expected = "Foo(bar=AttributeError('bar'))"
>       assert result == expected
E       assert 'Foo(\n    ba... \'bar\'")\n)' == "Foo(bar=Attr...Error('bar'))"
E         
E         - Foo(bar=AttributeError('bar'))
E         + Foo(
E         +     
bar=AttributeError("'tests.test_pretty.test_attrs_broken.<locals>.Foo' object 
has no attribute 'bar'")
E         + )

tests/test_pretty.py:624: AssertionError
----------------------------- Captured stdout call -----------------------------
'Foo(\n    
bar=AttributeError("\'tests.test_pretty.test_attrs_broken.<locals>.Foo\' object 
has no attribute \'bar\'")\n)'
____________________________ test_attrs_broken_310 _____________________________

    @skip_py37
    @skip_py38
    @skip_py39
    def test_attrs_broken_310():
        @attr.define
        class Foo:
            bar: int
    
        foo = Foo(1)
        del foo.bar
        result = pretty_repr(foo)
        print(repr(result))
        expected = "Foo(bar=AttributeError(\"'Foo' object has no attribute 
'bar'\"))"
>       assert result == expected
E       assert 'Foo(\n    ba... \'bar\'")\n)' == 'Foo(bar=Attr...te \'bar\'"))'
E         
E         - Foo(bar=AttributeError("'Foo' object has no attribute 'bar'"))
E         + Foo(
E         +     
bar=AttributeError("'tests.test_pretty.test_attrs_broken_310.<locals>.Foo' 
object has no attribute 'bar'")
E         + )

tests/test_pretty.py:640: AssertionError
----------------------------- Captured stdout call -----------------------------
'Foo(\n    
bar=AttributeError("\'tests.test_pretty.test_attrs_broken_310.<locals>.Foo\' 
object has no attribute \'bar\'")\n)'
=============================== warnings summary ===============================
tests/test_syntax.py:6
  /<<PKGBUILDDIR>>/tests/test_syntax.py:6: DeprecationWarning: pkg_resources is 
deprecated as an API. See 
https://setuptools.pypa.io/en/latest/pkg_resources.html
    import pkg_resources

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_inspect.py::test_inspect_builtin_function_except_python311
FAILED 
tests/test_inspect.py::test_inspect_integer_with_methods_python38_and_python39
FAILED tests/test_inspect.py::test_inspect_integer_with_methods_python310only
FAILED tests/test_inspect.py::test_inspect_integer_with_methods_python311 - A...
FAILED tests/test_pretty.py::test_pretty_dataclass - assert "ExampleDatac...b...
FAILED tests/test_pretty.py::test_reference_cycle_dataclass - AssertionError:...
FAILED tests/test_pretty.py::test_max_depth_dataclass - AssertionError: asser...
FAILED tests/test_pretty.py::test_attrs_broken - assert 'Foo(\n    ba... \'ba...
FAILED tests/test_pretty.py::test_attrs_broken_310 - assert 'Foo(\n    ba... ...
============= 9 failed, 798 passed, 19 skipped, 1 warning in 5.39s =============
E: pybuild pybuild:389: test: plugin custom failed with: exit code=1: 
PYTHONPATH=/<<PKGBUILDDIR>> python3.13 -m pytest
I: pybuild base:311: PYTHONPATH=/<<PKGBUILDDIR>> python3.12 -m pytest
============================= test session starts ==============================
platform linux -- Python 3.12.6, pytest-8.3.3, pluggy-1.5.0
rootdir: /<<PKGBUILDDIR>>
configfile: pyproject.toml
testpaths: tests
plugins: typeguard-4.3.0
collected 826 items

tests/test_align.py ................                                     [  1%]
tests/test_ansi.py .......                                               [  2%]
tests/test_bar.py .......                                                [  3%]
tests/test_block_bar.py ....                                             [  4%]
tests/test_box.py ......                                                 [  4%]
tests/test_card.py .                                                     [  4%]
tests/test_cells.py .......                                              [  5%]
tests/test_color.py .................                                    [  7%]
tests/test_color_triplet.py ...                                          [  8%]
tests/test_columns.py .                                                  [  8%]
tests/test_columns_align.py .                                            [  8%]
tests/test_console.py .................................................. [ 14%]
..............................................                           [ 20%]
tests/test_constrain.py .                                                [ 20%]
tests/test_containers.py ....                                            [ 20%]
tests/test_control.py .......                                            [ 21%]
tests/test_emoji.py ......                                               [ 22%]
tests/test_file_proxy.py ...                                             [ 22%]
tests/test_filesize.py ..                                                [ 22%]
tests/test_getfileno.py ...                                              [ 23%]
tests/test_highlighter.py .............................................. [ 28%]
....................................                                     [ 33%]
tests/test_inspect.py ...s....sss..................................      [ 38%]
tests/test_json.py .                                                     [ 38%]
tests/test_jupyter.py ...                                                [ 39%]
tests/test_layout.py ......                                              [ 39%]
tests/test_live.py ..........                                            [ 41%]
tests/test_live_render.py ....                                           [ 41%]
tests/test_log.py ...                                                    [ 41%]
tests/test_logging.py ....                                               [ 42%]
tests/test_markdown.py ......                                            [ 43%]
tests/test_markdown_no_hyperlinks.py .                                   [ 43%]
tests/test_markup.py .....................                               [ 45%]
tests/test_measure.py ....                                               [ 46%]
tests/test_null_file.py .                                                [ 46%]
tests/test_padding.py .....                                              [ 46%]
tests/test_palette.py .                                                  [ 47%]
tests/test_panel.py ..........                                           [ 48%]
tests/test_pick.py .                                                     [ 48%]
tests/test_pretty.py ...........................................s......  [ 54%]
tests/test_progress.py ......................................            [ 59%]
tests/test_prompt.py ......                                              [ 59%]
tests/test_protocol.py ......                                            [ 60%]
tests/test_ratio.py .......                                              [ 61%]
tests/test_repr.py ........                                              [ 62%]
tests/test_rich_print.py .......                                         [ 63%]
tests/test_rule.py ................                                      [ 65%]
tests/test_rule_in_table.py ....                                         [ 65%]
tests/test_screen.py .                                                   [ 65%]
tests/test_segment.py .................................................  [ 71%]
tests/test_spinner.py .....                                              [ 72%]
tests/test_stack.py .                                                    [ 72%]
tests/test_status.py ..                                                  [ 72%]
tests/test_style.py ..........................                           [ 75%]
tests/test_styled.py .                                                   [ 75%]
tests/test_syntax.py .......................                             [ 78%]
tests/test_table.py ...............                                      [ 80%]
tests/test_text.py ..................................................... [ 86%]
......................................................                   [ 93%]
tests/test_theme.py .....                                                [ 94%]
tests/test_tools.py ....                                                 [ 94%]
tests/test_traceback.py ...................                              [ 96%]
tests/test_tree.py .....s.s.                                             [ 97%]
tests/test_windows_renderer.py sssssssssssssssss                         [100%]

=============================== warnings summary ===============================
tests/test_syntax.py:6
  /<<PKGBUILDDIR>>/tests/test_syntax.py:6: DeprecationWarning: pkg_resources is 
deprecated as an API. See 
https://setuptools.pypa.io/en/latest/pkg_resources.html
    import pkg_resources

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================== 802 passed, 24 skipped, 1 warning in 5.40s ==================
dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p "3.13 
3.12" returned exit code 13
make[1]: *** [debian/rules:9: override_dh_auto_test] Error 25
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:6: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
--------------------------------------------------------------------------------
Build finished at 2024-09-19T11:14:08Z


If required, the full build log is available here (for the next 30 days):
https://debusine.debian.net/artifact/792472/

This bug has been filed at "normal" severity, as we haven't started the
transition to add 3.13 as a supported version, yet. This will be raised to RC
as soon as that happens, hopefully well before trixie.

Thanks,

Stefano

Reply via email to