Bug 2259534

Summary: python-attrs fails to build with Python 3.13: AssertionError caused by the indentation mismatch
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-attrsAssignee: Lumír Balhar <lbalhar>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 40CC: ksurma, lbalhar, mhroncok, python-packagers-sig, spacewar, torsava
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-03-13 10:11:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2244836    

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.