Bug 2019856

Summary: python-rx fails to build with Python 3.11: AttributeError: module 'asyncio' has no attribute 'coroutine'
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: python-rxAssignee: Artem <ego.cordatus>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: ego.cordatus, gwync, mhroncok, python-sig, 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-07-06 14:37:18 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: 1992484, 2016048, 2045102, 2045109    

Description Tomáš Hrnčiar 2021-11-03 13:44:26 UTC
python-rx fails to build with Python 3.11.0a1.

  Traceback (most recent call last):
    File "/usr/lib64/python3.11/threading.py", line 1031, in _bootstrap_inner
      self.run()
      ^^^^^^^^^^
    File "/usr/lib64/python3.11/threading.py", line 968, in run
      self._target(*self._args, **self._kwargs)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/builddir/build/BUILD/RxPY-3.2.0/tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py", line 113, in thread_target
      @asyncio.coroutine
       ^^^^^^^^^^^^^^^^^
  AttributeError: module 'asyncio' has no attribute 'coroutine'
  
    warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))

tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py::TestAsyncIOThreadSafeScheduler::test_asyncio_threadsafe_schedule_action
  /builddir/build/BUILD/RxPY-3.2.0/tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py:27: DeprecationWarning: There is no current event loop
    loop = asyncio.get_event_loop()

tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py::TestAsyncIOThreadSafeScheduler::test_asyncio_threadsafe_schedule_action_cancel
  /builddir/build/BUILD/RxPY-3.2.0/tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py:74: DeprecationWarning: There is no current event loop
    loop = asyncio.get_event_loop()

tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py::TestAsyncIOThreadSafeScheduler::test_asyncio_threadsafe_schedule_action_cancel_same_loop
  /usr/lib/python3.11/site-packages/_pytest/threadexception.py:75: PytestUnhandledThreadExceptionWarning: Exception in thread Thread-116 (thread_target)
  
  Traceback (most recent call last):
    File "/usr/lib64/python3.11/threading.py", line 1031, in _bootstrap_inner
      self.run()
      ^^^^^^^^^^
    File "/usr/lib64/python3.11/threading.py", line 968, in run
      self._target(*self._args, **self._kwargs)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/builddir/build/BUILD/RxPY-3.2.0/tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py", line 113, in thread_target
      @asyncio.coroutine
       ^^^^^^^^^^^^^^^^^
  AttributeError: module 'asyncio' has no attribute 'coroutine'
  
    warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))

tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py::TestAsyncIOThreadSafeScheduler::test_asyncio_threadsafe_schedule_action_cancel_same_thread
  /usr/lib/python3.11/site-packages/_pytest/threadexception.py:75: PytestUnhandledThreadExceptionWarning: Exception in thread Thread-117 (thread_target)
  
  Traceback (most recent call last):
    File "/usr/lib64/python3.11/threading.py", line 1031, in _bootstrap_inner
      self.run()
      ^^^^^^^^^^
    File "/usr/lib64/python3.11/threading.py", line 968, in run
      self._target(*self._args, **self._kwargs)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/builddir/build/BUILD/RxPY-3.2.0/tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py", line 113, in thread_target
      @asyncio.coroutine
       ^^^^^^^^^^^^^^^^^
  AttributeError: module 'asyncio' has no attribute 'coroutine'
  
    warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))

tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py::TestAsyncIOThreadSafeScheduler::test_asyncio_threadsafe_schedule_action_due
  /builddir/build/BUILD/RxPY-3.2.0/tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py:49: DeprecationWarning: There is no current event loop
    loop = asyncio.get_event_loop()

tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py::TestAsyncIOThreadSafeScheduler::test_asyncio_threadsafe_schedule_now
  /builddir/build/BUILD/RxPY-3.2.0/tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py:13: DeprecationWarning: There is no current event loop
    loop = asyncio.get_event_loop()

tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py::TestAsyncIOThreadSafeScheduler::test_asyncio_threadsafe_schedule_now_units
  /usr/lib64/python3.11/unittest/case.py:646: DeprecationWarning: It is deprecated to return a value!=None from a test case (<bound method TestAsyncIOThreadSafeScheduler.test_asyncio_threadsafe_schedule_now_units of <tests.test_scheduler.test_eventloop.test_asynciothreadsafescheduler.TestAsyncIOThreadSafeScheduler testMethod=test_asyncio_threadsafe_schedule_now_units>>)
    return self.run(*args, **kwds)

-- Docs: https://docs.pytest.org/en/stable/warnings.html
=========================== short test summary info ============================
FAILED tests/test_observable/test_fromfuture.py::TestFromFuture::test_future_cancel
FAILED tests/test_observable/test_fromfuture.py::TestFromFuture::test_future_dispose
FAILED tests/test_observable/test_fromfuture.py::TestFromFuture::test_future_failure
FAILED tests/test_observable/test_fromfuture.py::TestFromFuture::test_future_success
FAILED tests/test_observable/test_start.py::TestStart::test_start_async - Att...
FAILED tests/test_observable/test_start.py::TestStart::test_start_async_error
FAILED tests/test_scheduler/test_eventloop/test_asyncioscheduler.py::TestAsyncIOScheduler::test_asyncio_schedule_action
FAILED tests/test_scheduler/test_eventloop/test_asyncioscheduler.py::TestAsyncIOScheduler::test_asyncio_schedule_action_cancel
FAILED tests/test_scheduler/test_eventloop/test_asyncioscheduler.py::TestAsyncIOScheduler::test_asyncio_schedule_action_due
FAILED tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py::TestAsyncIOThreadSafeScheduler::test_asyncio_threadsafe_schedule_action
FAILED tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py::TestAsyncIOThreadSafeScheduler::test_asyncio_threadsafe_schedule_action_cancel
FAILED tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py::TestAsyncIOThreadSafeScheduler::test_asyncio_threadsafe_schedule_action_cancel_same_loop
FAILED tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py::TestAsyncIOThreadSafeScheduler::test_asyncio_threadsafe_schedule_action_due
========== 13 failed, 1309 passed, 10 skipped, 27 warnings in 18.75s ===========

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/02910611-python-rx/

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

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 Gwyn Ciesla 2021-11-03 15:44:26 UTC
Filed upstream.

Comment 2 Ben Cotton 2022-02-08 21:34:47 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

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

Comment 4 Tomáš Hrnčiar 2022-06-30 05:52:39 UTC
PR: https://src.fedoraproject.org/rpms/python-rx/pull-request/4