Bug 2265487

Summary: python-beartype fails to build with Python 3.13: AssertionError: assert {'AsyncContex...'is_protocol'} == set(); indentation docstring mistmatch
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-beartypeAssignee: Robert-André Mauchin 🐧 <eclipseo>
Status: CLOSED WORKSFORME QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: eclipseo, fti-bugs, ksurma, mhroncok, paul.wouters
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-06-21 00:11:05 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: 2260875, 2260877, 2244836    

Description Karolina Surma 2024-02-22 10:27:36 UTC
python-beartype fails to build with Python 3.13.0a4.

=================================== FAILURES ===================================
_______________________________ test_api_typing ________________________________

    def test_api_typing() -> None:
        <snip>
    
        # Set of the basenames of all public attributes declared by the "typing"
        # module whose values are identical to those declared by the
        # "beartype.typing" submodule.
        TYPING_ATTR_EQUAL_NAMES = (
            BEARTYPE_TYPING_ATTR_NAME_TO_VALUE.keys() - TYPING_ATTR_UNEQUAL_NAMES)
    
        # ..................{ ASSERTS                            }..................
        #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        # CAUTION: When this assertion fails, the culprit is *USUALLY* the "typing"
        # module for the active Python module, which has probably erroneously
        # publicized one or more public attributes. In this case, the names of these
        # attributes *MUST* be manually added to the
        # "OFFICIAL_TYPING_ATTR_PUBLIC_BAD_NAMES" set defined far above.
        #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        # Assert that these two modules expose the same number of public attributes.
        # Since a simple assertion statement would produce non-human-readable
        # output, we expand this assertion to identify all differing attributes.
>       assert DIFFERENT_TYPING_ATTR_NAMES == set()
E       AssertionError: assert {'AsyncContex...'is_protocol'} == set()
E         Extra items in the left set:
E         'is_protocol'
E         'AsyncContextManager'
E         'get_protocol_members'
E         Full diff:
E         - set()
E         + {'AsyncContextManager', 'is_protocol', 'get_protocol_members'}

BEARTYPE_TYPING_ATTR_NAMES = dict_keys(['AbstractSet', 'Annotated', 'Any', 'AnyStr', 'AsyncContextManager', 'AsyncGenerator', 'AsyncIterable', 'Asy...is_typeddict', 'no_type_check', 'no_type_check_decorator', 'overload', 'override', 'reveal_type', 'runtime_checkable'])
BEARTYPE_TYPING_ATTR_NAME_TO_VALUE = {'AbstractSet': <class 'collections.abc.Set'>, 'Annotated': typing.Annotated, 'Any': typing.Any, 'AnyStr': ~AnyStr, ...}
DIFFERENT_TYPING_ATTR_NAMES = {'AsyncContextManager', 'get_protocol_members', 'is_protocol'}
IS_PYTHON_AT_LEAST_3_9 = True
OFFICIAL_TYPING_ATTR_NAMES = dict_keys(['AbstractSet', 'Annotated', 'Any', 'AnyStr', 'AsyncGenerator', 'AsyncIterable', 'AsyncIterator', 'Awaitable...is_typeddict', 'no_type_check', 'no_type_check_decorator', 'overload', 'override', 'reveal_type', 'runtime_checkable'])
OFFICIAL_TYPING_ATTR_NAME_TO_VALUE = {'AbstractSet': typing.AbstractSet, 'Annotated': typing.Annotated, 'Any': typing.Any, 'AnyStr': ~AnyStr, ...}
OFFICIAL_TYPING_ATTR_PUBLIC_BAD_NAMES = frozenset({'ABCMeta', 'CT_co', 'CallableMeta', 'EXCLUDED_ATTRIBUTES', 'GenericAlias', 'GenericMeta', ...})
TYPING_ATTR_EQUAL_NAMES = {'Annotated', 'Any', 'AnyStr', 'BinaryIO', 'ClassVar', 'Concatenate', ...}
TYPING_ATTR_UNEQUAL_NAMES = {'AbstractSet', 'AsyncContextManager', 'AsyncGenerator', 'AsyncIterable', 'AsyncIterator', 'Awaitable', ...}
beartype_typing = <module 'beartype.typing' from '/builddir/build/BUILD/beartype-0.17.2/beartype/typing/__init__.py'>
official_typing = <module 'typing' from '/usr/lib64/python3.13/typing.py'>

beartype_test/a00_unit/a00_core/test_a90_typing.py:223: AssertionError
_______________________ test_wrappee_descriptor_builtin ________________________

    def test_wrappee_descriptor_builtin() -> None:
        <snip>
    
        # ....................{ LOCALS                         }....................
        # Instance of this class.
        the_race = OrDidASeaOfFire()
    
        # ....................{ PASS                           }....................
        # Assert this class method accessed on both this instance and this class
        # returns the expected value.
        assert (
            OrDidASeaOfFire.envelop_once_this_silent_snow() ==
            the_race.envelop_once_this_silent_snow() ==
            'None can reply—all seems eternal now.'
        )
    
        # Assert this class method docstring has been preserved as is.
        assert OrDidASeaOfFire.envelop_once_this_silent_snow.__doc__ is not None
>       assert OrDidASeaOfFire.envelop_once_this_silent_snow.__doc__.startswith('''
                Arbitrary class method''')
E       AssertionError: assert False
E        +  where False = <built-in method startswith of str object at 0x7fc8f3cbe3f0>('\n            Arbitrary class method')
E        +    where <built-in method startswith of str object at 0x7fc8f3cbe3f0> = '\nArbitrary class method decorated first by the builtin\n:class:`classmethod` descriptor and then by the\n:func:`beartype.beartype` decorator, exercising an edge case in the\n:func:`beartype.beartype` decorator.\n\nNote that reversing this order of decoration does *not* exercising\nan edge case in the :func:`beartype.beartype` decorator and is thus\nomitted from testing.\n'.startswith
E        +      where '\nArbitrary class method decorated first by the builtin\n:class:`classmethod` descriptor and then by the\n:func:`beartype.beartype` decorator, exercising an edge case in the\n:func:`beartype.beartype` decorator.\n\nNote that reversing this order of decoration does *not* exercising\nan edge case in the :func:`beartype.beartype` decorator and is thus\nomitted from testing.\n' = <bound method test_wrappee_descriptor_builtin.<locals>.OrDidASeaOfFire.envelop_once_this_silent_snow of <class 'beartype_test.a00_unit.a70_decor.test_decorwrappee.test_wrappee_descriptor_builtin.<locals>.OrDidASeaOfFire'>>.__doc__
E        +        where <bound method test_wrappee_descriptor_builtin.<locals>.OrDidASeaOfFire.envelop_once_this_silent_snow of <class 'beartype_test.a00_unit.a70_decor.test_decorwrappee.test_wrappee_descriptor_builtin.<locals>.OrDidASeaOfFire'>> = <class 'beartype_test.a00_unit.a70_decor.test_decorwrappee.test_wrappee_descriptor_builtin.<locals>.OrDidASeaOfFire'>.envelop_once_this_silent_snow

beartype_test/a00_unit/a70_decor/test_decorwrappee.py:230: AssertionError

FAILED beartype_test/a00_unit/a00_core/test_a90_typing.py::test_api_typing - ...
FAILED beartype_test/a00_unit/a70_decor/test_decorwrappee.py::test_wrappee_descriptor_builtin
================== 2 failed, 316 passed, 10 skipped in 8.28s ===================

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/07048942-python-beartype/

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

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-06-12 14:59:08 UTC
*** Bug 2291635 has been marked as a duplicate of this bug. ***

Comment 2 Fedora Fails To Install 2024-06-19 19:58:59 UTC
Hello,

Please note that this comment was generated automatically by https://pagure.io/releng/blob/main/f/scripts/ftbfs-fti/follow-policy.py
If you feel that this output has mistakes, please open an issue at https://pagure.io/releng/

This package fails to install and maintainers are advised to take one of the following actions:

 - Fix this bug and close this bugzilla once the update makes it to the repository.
   (The same script that posted this comment will eventually close this bugzilla
   when the fixed package reaches the repository, so you don't have to worry about it.)

or

 - Move this bug to ASSIGNED if you plan on fixing this, but simply haven't done so yet.

or

 - Orphan the package if you no longer plan to maintain it.


If you do not take one of these actions, the process at https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/#_package_removal_for_long_standing_ftbfs_and_fti_bugs will continue.
This package may be orphaned in 7+ weeks.
This is the first reminder (step 3) from the policy.

Don't hesitate to ask for help on https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/ if you are unsure how to fix this bug.

Comment 4 Fedora Fails To Install 2024-06-21 00:11:05 UTC
Hello,

Please note that this comment was generated automatically by https://pagure.io/releng/blob/main/f/scripts/ftbfs-fti/follow-policy.py
If you feel that this output has mistakes, please open an issue at https://pagure.io/releng/

All subpackages of a package against which this bug was filled are now installable or removed from Fedora 41.

Thanks for taking care of it!