Bug 2026776

Summary: python-txaio fails to build with Python 3.11: ImportError: cannot import name 'coroutine' from 'asyncio'
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: python-txaioAssignee: Julien Enselme <jujens>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 36CC: jujens, mail, mhroncok, 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-29 09:28:29 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, 2045102, 2045109, 2098678, 2098877    

Description Tomáš Hrnčiar 2021-11-25 19:16:03 UTC
python-txaio fails to build with Python 3.11.0a2.

=================================== FAILURES ===================================
______________________ test_as_future_coroutine[asyncio] _______________________

framework = <module 'txaio.aio' from '/builddir/build/BUILDROOT/python-txaio-21.2.1-3.fc36.x86_64/usr/lib/python3.11/site-packages/txaio/aio.py'>

    def test_as_future_coroutine(framework):
        '''
        call a coroutine (asyncio)
        '''
        pytest.importorskip('asyncio')
        # can import asyncio on python3.4, but might still be using
        # twisted
        if not txaio.using_asyncio:
            return
    
        errors = []
        results = []
        calls = []
    
>       from asyncio import coroutine
    
        @coroutine
E       ImportError: cannot import name 'coroutine' from 'asyncio' (/usr/lib64/python3.11/asyncio/__init__.py)

test/test_as_future.py:105: ImportError
___________________ test_explicit_reactor_coroutine[asyncio] ___________________

framework = <module 'txaio.aio' from '/builddir/build/BUILDROOT/python-txaio-21.2.1-3.fc36.x86_64/usr/lib/python3.11/site-packages/txaio/aio.py'>

    def test_explicit_reactor_coroutine(framework):
        """
        If we set an event-loop, Futures + Tasks should use it.
        """
        pytest.importorskip('asyncio')
        if txaio.using_twisted:
            pytest.skip()
    
>       from asyncio import coroutine
    
        @coroutine
E       ImportError: cannot import name 'coroutine' from 'asyncio' (/usr/lib64/python3.11/asyncio/__init__.py)

test/test_call_later.py:174: ImportError
___________________________ test_is_future_coroutine ___________________________

framework_aio = <module 'txaio.aio' from '/builddir/build/BUILDROOT/python-txaio-21.2.1-3.fc36.x86_64/usr/lib/python3.11/site-packages/txaio/aio.py'>

    def test_is_future_coroutine(framework_aio):
        '''
        Returning an immediate value from as_future
        '''
        pytest.importorskip('asyncio')  # 'aio' might be using trollius
>       from asyncio import coroutine
    
        @coroutine
E       ImportError: cannot import name 'coroutine' from 'asyncio' (/usr/lib64/python3.11/asyncio/__init__.py)

test/test_is_future.py:45: ImportError
=============================== warnings summary ===============================
test/test_as_future.py: 4 warnings
test/test_callback.py: 3 warnings
test/test_cancel.py: 1 warning
test/test_create.py: 2 warnings
test/test_errback.py: 7 warnings
test/test_gather.py: 4 warnings
test/test_is_future.py: 2 warnings
  /builddir/build/BUILDROOT/python-txaio-21.2.1-3.fc36.x86_64/usr/lib/python3.11/site-packages/txaio/aio.py:323: DeprecationWarning: There is no current event loop
    return asyncio.get_event_loop()

test/test_as_future.py: 4 warnings
test/test_call_later.py: 3 warnings
test/test_callback.py: 3 warnings
test/test_cancel.py: 2 warnings
test/test_errback.py: 7 warnings
  /builddir/build/BUILD/txaio-21.2.1/test/util.py:52: DeprecationWarning: There is no current event loop
    return _run_once(txaio.config.loop or asyncio.get_event_loop())

test/test_gather.py::test_gather_two[asyncio]
test/test_gather.py::test_gather_two[asyncio]
test/test_gather.py::test_gather_two[asyncio]
test/test_gather.py::test_gather_no_consume[asyncio]
test/test_gather.py::test_gather_no_consume[asyncio]
test/test_gather.py::test_gather_no_consume[asyncio]
  /builddir/build/BUILD/txaio-21.2.1/test/util.py:85: DeprecationWarning: There is no current event loop
    asyncio.get_event_loop().run_until_complete(future)

-- Docs: https://docs.pytest.org/en/stable/warnings.html
=========================== short test summary info ============================
FAILED test/test_as_future.py::test_as_future_coroutine[asyncio] - ImportErro...
FAILED test/test_call_later.py::test_explicit_reactor_coroutine[asyncio] - Im...
FAILED test/test_is_future.py::test_is_future_coroutine - ImportError: cannot...
============ 3 failed, 47 passed, 67 skipped, 48 warnings in 0.32s =============

The @asyncio.coroutine decorator enabling legacy generator-based coroutines to be compatible with async/await code. The function has been deprecated since Python 3.8 and the removal was initially scheduled for Python 3.10. Use async def instead. (Contributed by Illia Volochii in bpo-43216.)

https://bugs.python.org/issue43216
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/02988865-python-txaio/

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

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 Ben Cotton 2022-02-08 21:25:27 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 2 Miro Hrončok 2022-06-20 10:20:20 UTC
*** Bug 2099135 has been marked as a duplicate of this bug. ***

Comment 3 Miro Hrončok 2022-06-27 14:52:47 UTC
Hello,

This is the first reminder (step 3 from https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/#_package_removal_for_long_standing_ftbfs_and_fti_bugs).

If you know about this problem and are planning on fixing it, please acknowledge so by setting the bug status to ASSIGNED. If you don't have time to maintain this package, consider orphaning it, so maintainers of dependent packages realize the problem.

Comment 4 Tomáš Hrnčiar 2022-06-29 07:02:38 UTC
PR: https://src.fedoraproject.org/rpms/python-txaio/pull-request/6