Bug 2245886 - python-toolz fails to build with Python 3.13: AssertionError in toolz/tests/test_functoolz.py (unexpected dedented docstring)
Summary: python-toolz fails to build with Python 3.13: AssertionError in toolz/tests/t...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-toolz
Version: 40
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Orion Poplawski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 2291948 (view as bug list)
Depends On:
Blocks: F41FTBFS F41FailsToInstall PYTHON3.13 2291476 2291617 2291619 2291647 2291664 2291665 2291719 2291899 2291925 2291980
TreeView+ depends on / blocked
 
Reported: 2023-10-24 13:22 UTC by Karolina Surma
Modified: 2024-06-15 21:40 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-06-15 06:10:34 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github pytoolz toolz issues 581 0 None open Test failures with Python 3.13 2024-06-14 13:55:15 UTC

Description Karolina Surma 2023-10-24 13:22:15 UTC
python-toolz fails to build with Python 3.13.0a1.


=================================== FAILURES ===================================
_________________________________ test_excepts _________________________________

    def test_excepts():
        # These are descriptors, make sure this works correctly.
        assert excepts.__name__ == 'excepts'
>       assert (
            'A wrapper around a function to catch exceptions and\n'
            '    dispatch to a handler.\n'
        ) in excepts.__doc__
E       AssertionError: assert 'A wrapper around a function to catch exceptions and\n    dispatch to a handler.\n' in 'A wrapper around a function to catch exceptions and\ndispatch to a handler.\n\nThis is like a functional try/except block, in the same way that\nifexprs are functional if/else blocks.\n\nExamples\n--------\n>>> excepting = excepts(\n...     ValueError,\n...     lambda a: [1, 2].index(a),\n...     lambda _: -1,\n... )\n>>> excepting(1)\n0\n>>> excepting(3)\n-1\n\nMultiple exceptions and default except clause.\n>>> excepting = excepts((IndexError, KeyError), lambda a: a[0])\n>>> excepting([])\n>>> excepting([1])\n1\n>>> excepting({})\n>>> excepting({0: 1})\n1\n'
E        +  where 'A wrapper around a function to catch exceptions and\ndispatch to a handler.\n\nThis is like a functional try/except block, in the same way that\nifexprs are functional if/else blocks.\n\nExamples\n--------\n>>> excepting = excepts(\n...     ValueError,\n...     lambda a: [1, 2].index(a),\n...     lambda _: -1,\n... )\n>>> excepting(1)\n0\n>>> excepting(3)\n-1\n\nMultiple exceptions and default except clause.\n>>> excepting = excepts((IndexError, KeyError), lambda a: a[0])\n>>> excepting([])\n>>> excepting([1])\n1\n>>> excepting({})\n>>> excepting({0: 1})\n1\n' = excepts.__doc__

toolz/tests/test_functoolz.py:741: AssertionError
=========================== short test summary info ============================
FAILED toolz/tests/test_functoolz.py::test_excepts - AssertionError: assert '...
================= 1 failed, 202 passed, 1 deselected in 4.14s ==================


https://docs.python.org/3.13/whatsnew/3.13.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/06546842-python-toolz/

For all our attempts to build python-toolz with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/python-toolz/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.13:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Miro Hrončok 2023-10-24 13:34:05 UTC
This is likely related to:

https://docs.python.org/3.13/whatsnew/3.13.html#other-language-changes

"""
Compiler now strip indents from docstrings. This will reduce the size of bytecode cache (e.g. .pyc file). For example, cache file size for sqlalchemy.orm.session in SQLAlchemy 2.0 is reduced by about 5%. This change will affect tools using docstrings, like doctest.
"""

https://github.com/python/cpython/issues/81283

The spaces before "dispatch" are stripped.

Comment 2 Aoife Moloney 2024-02-15 23:01:36 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 40 development cycle.
Changing version to 40.

Comment 3 Karolina Surma 2024-06-12 15:08:34 UTC
*** Bug 2291948 has been marked as a duplicate of this bug. ***

Comment 4 Adam Williamson 2024-06-15 06:10:34 UTC
Fixed in https://bodhi.fedoraproject.org/updates/FEDORA-2024-911758b9a6 .

Comment 5 Orion Poplawski 2024-06-15 21:40:57 UTC
Thank you!


Note You need to log in before you can comment on or make changes to this bug.