Bug 2259534 - python-attrs fails to build with Python 3.13: AssertionError caused by the indentation mismatch
Summary: python-attrs fails to build with Python 3.13: AssertionError caused by the in...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-attrs
Version: 40
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lumír Balhar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2024-01-22 08:58 UTC by Karolina Surma
Modified: 2024-03-13 10:11 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-03-13 10:11:50 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github python-attrs attrs issues 1228 0 None open Test failures with Python 3.13: stripped indentation from docstrings 2024-01-29 16:08:42 UTC
Github python-attrs attrs issues 1229 0 None open Test failure with Python 3.13: TestUpdateAbstractMethods.test_remain_abstract[False] does not raise the expected TypeEr... 2024-01-29 16:08:42 UTC

Description Karolina Surma 2024-01-22 08:58:27 UTC
python-attrs fails to build with Python 3.13.0a3.

=================================== FAILURES ===================================
____________ TestUpdateAbstractMethods.test_remain_abstract[False] _____________

self = <tests.test_abc.TestUpdateAbstractMethods object at 0x7ff15a9ac650>
slots = False

    def test_remain_abstract(self, slots):
        """
        If an attrs class inherits from an abstract class but doesn't implement
        abstract methods, it remains abstract.
        """
    
        class A(abc.ABC):
            @abc.abstractmethod
            def foo(self):
                pass
    
        @attrs.define(slots=slots)
        class StillAbstract(A):
            pass
    
        assert inspect.isabstract(StillAbstract)
        expected_exception_message = (
            "^Can't instantiate abstract class StillAbstract without an "
            "implementation for abstract method 'foo'$"
            if PY_3_12_PLUS
            else "class StillAbstract with abstract method foo"
        )
>       with pytest.raises(TypeError, match=expected_exception_message):
E       Failed: DID NOT RAISE <class 'TypeError'>

tests/test_abc.py:59: Failed
_______________________ TestDundersUnnamedClass.test_ne ________________________

self = <tests.test_cmp.TestDundersUnnamedClass object at 0x7ff15aa153d0>

    def test_ne(self):
        """
        __ne__ docstring and qualified name should be well behaved.
        """
        method = self.cls.__ne__
>       assert method.__doc__.strip() == (
            "Check equality and either forward a NotImplemented or\n"
            "        return the result negated."
        )
E       AssertionError: assert 'Check equali...sult negated.' == 'Check equali...sult negated.'
E         Skipping 44 identical leading characters in diff, use -v to show
E           mented or
E         -         return the result negated.
E         ? --------
E         + return the result negated.

tests/test_cmp.py:326: AssertionError
______________________ TestDundersPartialOrdering.test_ne ______________________

self = <tests.test_cmp.TestDundersPartialOrdering object at 0x7ff15aa14bf0>

    def test_ne(self):
        """
        __ne__ docstring and qualified name should be well behaved.
        """
        method = self.cls.__ne__
>       assert method.__doc__.strip() == (
            "Check equality and either forward a NotImplemented or\n"
            "        return the result negated."
        )
E       AssertionError: assert 'Check equali...sult negated.' == 'Check equali...sult negated.'
E         Skipping 44 identical leading characters in diff, use -v to show
E           mented or
E         -         return the result negated.
E         ? --------
E         + return the result negated.

tests/test_cmp.py:394: AssertionError
_______________________ TestDundersFullOrdering.test_ne ________________________

self = <tests.test_cmp.TestDundersFullOrdering object at 0x7ff15aa148f0>

    def test_ne(self):
        """
        __ne__ docstring and qualified name should be well behaved.
        """
        method = self.cls.__ne__
>       assert method.__doc__.strip() == (
            "Check equality and either forward a NotImplemented or\n"
            "        return the result negated."
        )
E       AssertionError: assert 'Check equali...sult negated.' == 'Check equali...sult negated.'
E         Skipping 44 identical leading characters in diff, use -v to show
E           mented or
E         -         return the result negated.
E         ? --------
E         + return the result negated.

tests/test_cmp.py:466: AssertionError

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/06930350-python-attrs/

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

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 Karolina Surma 2024-01-29 16:08:43 UTC
Reported upstream

Comment 2 Tomas Orsava 2024-02-14 13:21:32 UTC
Upstream issue: https://github.com/python-attrs/attrs/issues/1229

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


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