Bug 2080868

Summary: python-typing-extensions fails to build with Python 3.11: AttributeError: <module 'typing' from '/usr/lib64/python3.11/typing.py'> does not have the attribute '_overload_registry'
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: python-typing-extensionsAssignee: Jonny Heggheim <hegjon>
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: code, epel-packagers-sig, hegjon, mail, mhroncok, michel, thrnciar
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: 2022-06-13 09:11:56 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: 2016048    

Description Tomáš Hrnčiar 2022-05-02 08:15:01 UTC
python-typing-extensions fails to build with Python 3.11.0a7.

=================================== FAILURES ===================================
_____________________ OverloadTests.test_overload_registry _____________________
/usr/lib64/python3.11/unittest/mock.py:1356: in patched
    with self.decoration_helper(patched,
/usr/lib64/python3.11/contextlib.py:137: in __enter__
    return next(self.gen)
/usr/lib64/python3.11/unittest/mock.py:1338: in decoration_helper
    arg = exit_stack.enter_context(patching)
/usr/lib64/python3.11/contextlib.py:499: in enter_context
    result = _enter(cm)
/usr/lib64/python3.11/unittest/mock.py:1427: in __enter__
    original, local = self.get_original()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <unittest.mock._patch object at 0x7fb2d2b3a490>

    def get_original(self):
        target = self.getter()
        name = self.attribute
    
        original = DEFAULT
        local = False
    
        try:
            original = target.__dict__[name]
        except (AttributeError, KeyError):
            original = getattr(target, name, DEFAULT)
        else:
            local = True
    
        if name in _builtins and isinstance(target, ModuleType):
            self.create = True
    
        if not self.create and original is DEFAULT:
>           raise AttributeError(
                "%s does not have the attribute %r" % (target, name)
            )
E           AttributeError: <module 'typing' from '/usr/lib64/python3.11/typing.py'> does not have the attribute '_overload_registry'

/usr/lib64/python3.11/unittest/mock.py:1400: AttributeError
=========================== short test summary info ============================
FAILED src/test_typing_extensions.py::OverloadTests::test_overload_registry
=================== 1 failed, 224 passed, 1 skipped in 0.44s ===================

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

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/04351158-python-typing-extensions/

For all our attempts to build python-typing-extensions with Python 3.11, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/python-typing-extensions/

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.11:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/

Let us know here if you have any questions.

Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11.
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 Jonny Heggheim 2022-05-02 10:20:56 UTC
Reported upstream https://github.com/python/typing/issues/1173

Comment 2 Jonny Heggheim 2022-05-02 13:40:12 UTC
From upstream: It should work with beta 1, which is scheduled for Friday.