You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use Cython 3.0.6 in the Fedora's uvloop package updated to 0.19.0.
I'm getting:
tests/test_base.py::TestBaseUV::test_check_thread Unexpected calls to loop.call_exception_handler():
[{'exception': TypeError('wrap() takes exactly 2 positional arguments (3 given)'),
'handle': <Handle __Pyx_CFunc_object__lParenLoop__comma_bint__rParen_to_py_4self_7enabled.<locals>.wrap created at /builddir/build/BUILD/uvloop-0.19.0/_empty/tests/test_base.py:254>,
'message': 'Exception in callback <bound method '
'__Pyx_CFunc_object__lParenLoop__comma_bint__rParen_to_py_4self_7enabled.<locals>.wrap '
'of <uvloop.Loop running=True closed=False debug=True>>',
'source_traceback': [<FrameSummary file /usr/lib64/python3.12/threading.py, line 1030 in _bootstrap>,
<FrameSummary file /usr/lib64/python3.12/threading.py, line 1073 in _bootstrap_inner>,
<FrameSummary file /usr/lib64/python3.12/threading.py, line 1010 in run>,
<FrameSummary file /builddir/build/BUILD/uvloop-0.19.0/_empty/tests/test_base.py, line 283 in check_in_thread>,
<FrameSummary file /builddir/build/BUILD/uvloop-0.19.0/_empty/tests/test_base.py, line 254 in check_thread>]},
{'exception': TypeError('wrap() takes exactly 2 positional arguments (3 given)'),
'handle': <Handle __Pyx_CFunc_object__lParenLoop__comma_bint__rParen_to_py_4self_7enabled.<locals>.wrap>,
'message': 'Exception in callback <bound method '
'__Pyx_CFunc_object__lParenLoop__comma_bint__rParen_to_py_4self_7enabled.<locals>.wrap '
'of <uvloop.Loop running=True closed=False debug=False>>'},
{'exception': TypeError('wrap() takes exactly 2 positional arguments (3 given)'),
'handle': <Handle __Pyx_CFunc_object__lParenLoop__comma_bint__rParen_to_py_4self_7enabled.<locals>.wrap created at /builddir/build/BUILD/uvloop-0.19.0/_empty/tests/test_base.py:254>,
'message': 'Exception in callback <bound method '
'__Pyx_CFunc_object__lParenLoop__comma_bint__rParen_to_py_4self_7enabled.<locals>.wrap '
'of <uvloop.Loop running=True closed=False debug=True>>',
'source_traceback': [<FrameSummary file /usr/lib64/python3.12/threading.py, line 1030 in _bootstrap>,
<FrameSummary file /usr/lib64/python3.12/threading.py, line 1073 in _bootstrap_inner>,
<FrameSummary file /usr/lib64/python3.12/threading.py, line 1010 in run>,
<FrameSummary file /builddir/build/BUILD/uvloop-0.19.0/_empty/tests/test_base.py, line 278 in check_in_thread>,
<FrameSummary file /builddir/build/BUILD/uvloop-0.19.0/_empty/tests/test_base.py, line 254 in check_thread>]},
{'exception': TypeError('wrap() takes exactly 2 positional arguments (3 given)'),
'handle': <Handle __Pyx_CFunc_object__lParenLoop__comma_bint__rParen_to_py_4self_7enabled.<locals>.wrap>,
'message': 'Exception in callback <bound method '
'__Pyx_CFunc_object__lParenLoop__comma_bint__rParen_to_py_4self_7enabled.<locals>.wrap '
'of <uvloop.Loop running=True closed=False debug=False>>'}]
FAILED
...
tests/test_process.py::Test_UV_Process::test_process_double_close <frozen importlib._bootstrap>:488: UserWarning: enum class uv_fs_event not importable from uvloop.includes.uv. You are probably using a cpdef enum declared in a .pxd file that does not have a .py or .pyx file.
PASSED
And:
=================================== FAILURES ===================================
_________________________ TestBaseUV.test_check_thread _________________________
Traceback (most recent call last):
File "/usr/lib64/python3.12/unittest/case.py", line 58, in testPartExecutor
yield
File "/usr/lib64/python3.12/unittest/case.py", line 639, in run
self._callTearDown()
File "/usr/lib64/python3.12/unittest/case.py", line 594, in _callTearDown
self.tearDown()
File "/builddir/build/BUILDROOT/python-uvloop-0.19.0-1.fc40.x86_64/usr/lib64/python3.12/site-packages/uvloop/_testbase.py", line 106, in tearDown
self.fail('unexpected calls to loop.call_exception_handler()')
File "/usr/lib64/python3.12/unittest/case.py", line 717, in fail
raise self.failureException(msg)
AssertionError: unexpected calls to loop.call_exception_handler()
------------------------------ Captured log call -------------------------------
ERROR asyncio:_testbase.py:89 Exception in callback <bound method __Pyx_CFunc_object__lParenLoop__comma_bint__rParen_to_py_4self_7enabled.<locals>.wrap of <uvloop.Loop running=True closed=False debug=True>>
handle: <Handle __Pyx_CFunc_object__lParenLoop__comma_bint__rParen_to_py_4self_7enabled.<locals>.wrap created at /builddir/build/BUILD/uvloop-0.19.0/_empty/tests/test_base.py:254>
source_traceback: Object created at (most recent call last):
File "/usr/lib64/python3.12/threading.py", line 1030, in _bootstrap
self._bootstrap_inner()
File "/usr/lib64/python3.12/threading.py", line 1073, in _bootstrap_inner
self.run()
File "/usr/lib64/python3.12/threading.py", line 1010, in run
self._target(*self._args, **self._kwargs)
File "/builddir/build/BUILD/uvloop-0.19.0/_empty/tests/test_base.py", line 283, in check_in_thread
check_thread(loop, debug)
File "/builddir/build/BUILD/uvloop-0.19.0/_empty/tests/test_base.py", line 254, in check_thread
loop.set_debug(debug)
Traceback (most recent call last):
File "uvloop/cbhandles.pyx", line 63, in uvloop.loop.Handle._run
File "<stringsource>", line 67, in cfunc.to_py.__Pyx_CFunc_object__lParenLoop__comma_bint__rParen_to_py_4self_7enabled.wrap
TypeError: wrap() takes exactly 2 positional arguments (3 given)
ERROR asyncio:_testbase.py:89 Exception in callback <bound method __Pyx_CFunc_object__lParenLoop__comma_bint__rParen_to_py_4self_7enabled.<locals>.wrap of <uvloop.Loop running=True closed=False debug=False>>
handle: <Handle __Pyx_CFunc_object__lParenLoop__comma_bint__rParen_to_py_4self_7enabled.<locals>.wrap>
Traceback (most recent call last):
File "uvloop/cbhandles.pyx", line 63, in uvloop.loop.Handle._run
File "<stringsource>", line 67, in cfunc.to_py.__Pyx_CFunc_object__lParenLoop__comma_bint__rParen_to_py_4self_7enabled.wrap
TypeError: wrap() takes exactly 2 positional arguments (3 given)
ERROR asyncio:_testbase.py:89 Exception in callback <bound method __Pyx_CFunc_object__lParenLoop__comma_bint__rParen_to_py_4self_7enabled.<locals>.wrap of <uvloop.Loop running=True closed=False debug=True>>
handle: <Handle __Pyx_CFunc_object__lParenLoop__comma_bint__rParen_to_py_4self_7enabled.<locals>.wrap created at /builddir/build/BUILD/uvloop-0.19.0/_empty/tests/test_base.py:254>
source_traceback: Object created at (most recent call last):
File "/usr/lib64/python3.12/threading.py", line 1030, in _bootstrap
self._bootstrap_inner()
File "/usr/lib64/python3.12/threading.py", line 1073, in _bootstrap_inner
self.run()
File "/usr/lib64/python3.12/threading.py", line 1010, in run
self._target(*self._args, **self._kwargs)
File "/builddir/build/BUILD/uvloop-0.19.0/_empty/tests/test_base.py", line 278, in check_in_thread
check_thread(loop, debug)
File "/builddir/build/BUILD/uvloop-0.19.0/_empty/tests/test_base.py", line 254, in check_thread
loop.set_debug(debug)
Traceback (most recent call last):
File "uvloop/cbhandles.pyx", line 63, in uvloop.loop.Handle._run
File "<stringsource>", line 67, in cfunc.to_py.__Pyx_CFunc_object__lParenLoop__comma_bint__rParen_to_py_4self_7enabled.wrap
TypeError: wrap() takes exactly 2 positional arguments (3 given)
ERROR asyncio:_testbase.py:89 Exception in callback <bound method __Pyx_CFunc_object__lParenLoop__comma_bint__rParen_to_py_4self_7enabled.<locals>.wrap of <uvloop.Loop running=True closed=False debug=False>>
handle: <Handle __Pyx_CFunc_object__lParenLoop__comma_bint__rParen_to_py_4self_7enabled.<locals>.wrap>
Traceback (most recent call last):
File "uvloop/cbhandles.pyx", line 63, in uvloop.loop.Handle._run
File "<stringsource>", line 67, in cfunc.to_py.__Pyx_CFunc_object__lParenLoop__comma_bint__rParen_to_py_4self_7enabled.wrap
TypeError: wrap() takes exactly 2 positional arguments (3 given)
_____ Test_UV_Process_Delayed.test_process_delayed_stdio__paused__no_stdin _____
Traceback (most recent call last):
File "/usr/lib64/python3.12/unittest/case.py", line 58, in testPartExecutor
yield
File "/usr/lib64/python3.12/unittest/case.py", line 636, in run
self._callTestMethod(testMethod)
File "/usr/lib64/python3.12/unittest/case.py", line 589, in _callTestMethod
if method() is not None:
^^^^^^^^
File "/builddir/build/BUILD/uvloop-0.19.0/_empty/tests/test_process.py", line 929, in test_process_delayed_stdio__paused__no_stdin
transport, proto = self.loop.run_until_complete(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
File "/builddir/build/BUILD/uvloop-0.19.0/_empty/tests/test_process.py", line 904, in run_sub
return await self.loop.subprocess_shell(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "uvloop/loop.pyx", line 2808, in subprocess_shell
File "uvloop/loop.pyx", line 2734, in uvloop.loop.Loop._Loop__subprocess_run
TypeError: _Loop__subprocess_run() got an unexpected keyword argument '__uvloop_sleep_after_fork'
____ Test_UV_Process_Delayed.test_process_delayed_stdio__paused__stdin_pipe ____
Traceback (most recent call last):
File "/usr/lib64/python3.12/unittest/case.py", line 58, in testPartExecutor
yield
File "/usr/lib64/python3.12/unittest/case.py", line 636, in run
self._callTestMethod(testMethod)
File "/usr/lib64/python3.12/unittest/case.py", line 589, in _callTestMethod
if method() is not None:
^^^^^^^^
File "/builddir/build/BUILD/uvloop-0.19.0/_empty/tests/test_process.py", line 910, in test_process_delayed_stdio__paused__stdin_pipe
transport, proto = self.loop.run_until_complete(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
File "/builddir/build/BUILD/uvloop-0.19.0/_empty/tests/test_process.py", line 904, in run_sub
return await self.loop.subprocess_shell(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "uvloop/loop.pyx", line 2808, in subprocess_shell
File "uvloop/loop.pyx", line 2734, in uvloop.loop.Loop._Loop__subprocess_run
TypeError: _Loop__subprocess_run() got an unexpected keyword argument '__uvloop_sleep_after_fork'
From 8e5da4e53daf03089ad83e007d378a4888fca729 Mon Sep 17 00:00:00 2001
From: Anton Zhukharev <ancieg@altlinux.org>
Date: Tue, 19 Dec 2023 12:41:58 +0300
Subject: [PATCH] fix compatibility with cython>3
---
uvloop/loop.pyx | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/uvloop/loop.pyx b/uvloop/loop.pyx
index b0ffa8b..fb1d5e6 100644
--- a/uvloop/loop.pyx
+++ b/uvloop/loop.pyx
@@ -1397,7 +1397,7 @@ cdef class Loop:
self._debug = bool(enabled)
if self.is_running():
self.call_soon_threadsafe(
- self._set_coroutine_debug, self, self._debug)
+ self._set_coroutine_debug, self._debug)
def is_running(self):
"""Return whether the event loop is currently running."""
@@ -2749,8 +2749,7 @@ cdef class Loop:
start_new_session=False,
executable=None,
pass_fds=(),
- # For tests only! Do not use in your code. Ever.
- __uvloop_sleep_after_fork=False):
+ **kwargs):
# TODO: Implement close_fds (might not be very important in
# Python 3.5, since all FDs aren't inheritable by default.)
@@ -2770,7 +2769,8 @@ cdef class Loop:
if executable is not None:
args[0] = executable
- if __uvloop_sleep_after_fork:
+ # For tests only! Do not use in your code. Ever.
+ if kwargs.get('__uvloop_sleep_after_fork'):
debug_flags |= __PROCESS_DEBUG_SLEEP_AFTER_FORK
waiter = self._new_future()
--
2.42.1
Reacted by Miro Hrončok, Anton Bolshakov and Roman Inflianskas
Just tested proposed patch + my chunks and build passes .. however
pytest still fails
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-uvloop-0.19.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-uvloop-0.19.0-2.fc35.x86_64/usr/lib/python3.8/site-packages+ /usr/bin/pytest -ra -m 'not network' --import-mode importlib==================================================================================== test session starts ====================================================================================platform linux -- Python 3.8.18, pytest-7.4.3, pluggy-1.3.0rootdir: /home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0configfile: pyproject.tomltestpaths: testscollected 504 itemstests/test_aiohttp.py ....tests/test_base.py ...................................................................................s...tests/test_context.py ..................s....s......tests/test_cython.py .tests/test_dealloc.py Ftests/test_dns.py ....................s..............................tests/test_executors.py ....tests/test_fs_event.py ..tests/test_libuv_api.py ..tests/test_pipes.py ............tests/test_process.py ..Traceback (most recent call last): File "<string>", line 29, in <module> File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/uvloop/__init__.py", line 9, in <module> from uvloop.loop import Loop as __BaseLoop # NOQAModuleNotFoundError: No module named 'uvloop.loop'F...............................................................................tests/test_process_spawning.py .tests/test_regr1.py .tests/test_runner.py ..tests/test_signals.py F.Traceback (most recent call last): File "<string>", line 7, in <module> File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/uvloop/__init__.py", line 9, in <module> from uvloop.loop import Loop as __BaseLoop # NOQAModuleNotFoundError: No module named 'uvloop.loop'F..FFFFFFF.Traceback (most recent call last): File "<string>", line 7, in <module> File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/uvloop/__init__.py", line 9, in <module> from uvloop.loop import Loop as __BaseLoop # NOQAModuleNotFoundError: No module named 'uvloop.loop'F.FFFFFFtests/test_sockets.py ........................ss.......tests/test_sourcecode.py sstests/test_tcp.py ...............................................................s................s.s.ss.ssssssss.ss..sssssssstests/test_testbase.py ...tests/test_udp.py .......................tests/test_unix.py ..................................========================================================================================= FAILURES ==========================================================================================________________________________________________________________________________ TestDealloc.test_dealloc_1 _________________________________________________________________________________Traceback (most recent call last): File "/usr/lib64/python3.8/unittest/case.py", line 60, in testPartExecutor yield File "/usr/lib64/python3.8/unittest/case.py", line 676, in run self._callTestMethod(testMethod) File "/usr/lib64/python3.8/unittest/case.py", line 633, in _callTestMethod method() File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_dealloc.py", line 61, in test_dealloc_1 self.assertEqual(err, b'', 'stderr is not empty') File "/usr/lib64/python3.8/unittest/case.py", line 912, in assertEqual assertion_func(first, second, msg=msg) File "/usr/lib64/python3.8/unittest/case.py", line 905, in _baseAssertEqual raise self.failureException(msg)AssertionError: b'Traceback (most recent call last):\n Fil[235 chars]\'\n' != b'' : stderr is not empty_________________________________________________________________________ Test_UV_Process.test_process_double_close _________________________________________________________________________Traceback (most recent call last): File "/usr/lib64/python3.8/unittest/case.py", line 60, in testPartExecutor yield File "/usr/lib64/python3.8/unittest/case.py", line 676, in run self._callTestMethod(testMethod) File "/usr/lib64/python3.8/unittest/case.py", line 633, in _callTestMethod method() File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_process.py", line 863, in test_process_double_close subprocess.run([sys.executable, '-c', script], check=True) File "/usr/lib64/python3.8/subprocess.py", line 516, in run raise CalledProcessError(retcode, process.args,subprocess.CalledProcessError: Command '['/usr/bin/python3', '-c', '\nimport os\nimport sys\nfrom unittest import mock\n\nimport asyncio\n\npipes = []\noriginal_os_pipe = os.pipe\ndef log_pipes():\n pipe = original_os_pipe()\n pipes.append(pipe)\n return pipe\n\ndups = []\noriginal_os_dup = os.dup\ndef log_dups(*args, **kwargs):\n dup = original_os_dup(*args, **kwargs)\n dups.append(dup)\n return dup\n\nwith mock.patch(\n "os.close", wraps=os.close\n) as os_close, mock.patch(\n "os.pipe", new=log_pipes\n), mock.patch(\n "os.dup", new=log_dups\n):\n import uvloop\n\n\nasync def test():\n proc = await asyncio.create_subprocess_exec(\n sys.executable, "-c", "pass"\n )\n await proc.communicate()\n\nuvloop.run(test())\n\nstdin, stdout, stderr = dups\n(r, w), = pipes\nassert os_close.mock_calls == [\n mock.call(w),\n mock.call(r),\n mock.call(stderr),\n mock.call(stdout),\n mock.call(stdin),\n]\n']' returned non-zero exit status 1._____________________________________________________________________ Test_UV_Signals.test_signals_and_custom_handler_1 _____________________________________________________________________Traceback (most recent call last): File "/usr/lib64/python3.8/unittest/case.py", line 60, in testPartExecutor yield File "/usr/lib64/python3.8/unittest/case.py", line 676, in run self._callTestMethod(testMethod) File "/usr/lib64/python3.8/unittest/case.py", line 633, in _callTestMethod method() File "/usr/lib64/python3.8/contextlib.py", line 75, in inner return func(*args, **kwds) File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 296, in test_signals_and_custom_handler_1 self.loop.run_until_complete(runner()) File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete return future.result() File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 280, in runner proc.send_signal(signal.SIGUSR1) File "/usr/lib64/python3.8/asyncio/subprocess.py", line 138, in send_signal self._transport.send_signal(signal) File "uvloop/handles/process.pyx", line 667, in uvloop.loop.UVProcessTransport.send_signal self._check_proc() File "uvloop/handles/process.pyx", line 401, in uvloop.loop.UVProcessTransport._check_proc raise ProcessLookupError()ProcessLookupError________________________________________________________________________ Test_UV_Signals.test_signals_fork_in_thread ________________________________________________________________________Traceback (most recent call last): File "/usr/lib64/python3.8/unittest/case.py", line 60, in testPartExecutor yield File "/usr/lib64/python3.8/unittest/case.py", line 676, in run self._callTestMethod(testMethod) File "/usr/lib64/python3.8/unittest/case.py", line 633, in _callTestMethod method() File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 382, in test_signals_fork_in_thread subprocess.check_call([ File "/usr/lib64/python3.8/subprocess.py", line 364, in check_call raise CalledProcessError(retcode, cmd)subprocess.CalledProcessError: Command '['/usr/bin/python3', b'-W', b'ignore', b'-c', "\\\nimport asyncio\nimport multiprocessing\nimport signal\nimport sys\nimport threading\nimport uvloop\n\nmultiprocessing.set_start_method('fork')\n\ndef subprocess():\n loop = uvloop.new_event_loop()\n loop.add_signal_handler(signal.SIGINT, lambda *a: None)\n\ndef run():\n loop = uvloop.new_event_loop()\n loop.add_signal_handler(signal.SIGINT, lambda *a: None)\n p = multiprocessing.Process(target=subprocess)\n t = threading.Thread(target=p.start)\n t.start()\n t.join()\n p.join()\n sys.exit(p.exitcode)\n\nrun()\n"]' returned non-zero exit status 1.__________________________________________________________________ Test_UV_Signals.test_signals_sigint_and_custom_handler ___________________________________________________________________Traceback (most recent call last): File "/usr/lib64/python3.8/unittest/case.py", line 60, in testPartExecutor yield File "/usr/lib64/python3.8/unittest/case.py", line 676, in run self._callTestMethod(testMethod) File "/usr/lib64/python3.8/unittest/case.py", line 633, in _callTestMethod method() File "/usr/lib64/python3.8/contextlib.py", line 75, in inner return func(*args, **kwds) File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 229, in test_signals_sigint_and_custom_handler self.loop.run_until_complete(runner()) File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete return future.result() File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 221, in runner proc.send_signal(signal.SIGHUP) File "/usr/lib64/python3.8/asyncio/subprocess.py", line 138, in send_signal self._transport.send_signal(signal) File "uvloop/handles/process.pyx", line 667, in uvloop.loop.UVProcessTransport.send_signal self._check_proc() File "uvloop/handles/process.pyx", line 401, in uvloop.loop.UVProcessTransport._check_proc raise ProcessLookupError()ProcessLookupError____________________________________________________________________ Test_UV_Signals.test_signals_sigint_pycode_continue ____________________________________________________________________Traceback (most recent call last): File "/usr/lib64/python3.8/unittest/case.py", line 60, in testPartExecutor yield File "/usr/lib64/python3.8/unittest/case.py", line 676, in run self._callTestMethod(testMethod) File "/usr/lib64/python3.8/unittest/case.py", line 633, in _callTestMethod method() File "/usr/lib64/python3.8/contextlib.py", line 75, in inner return func(*args, **kwds) File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 98, in test_signals_sigint_pycode_continue self.loop.run_until_complete(runner()) File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete return future.result() File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 93, in runner proc.send_signal(signal.SIGINT) File "/usr/lib64/python3.8/asyncio/subprocess.py", line 138, in send_signal self._transport.send_signal(signal) File "uvloop/handles/process.pyx", line 667, in uvloop.loop.UVProcessTransport.send_signal self._check_proc() File "uvloop/handles/process.pyx", line 401, in uvloop.loop.UVProcessTransport._check_proc raise ProcessLookupError()ProcessLookupError______________________________________________________________________ Test_UV_Signals.test_signals_sigint_pycode_stop ______________________________________________________________________Traceback (most recent call last): File "/usr/lib64/python3.8/unittest/case.py", line 60, in testPartExecutor yield File "/usr/lib64/python3.8/unittest/case.py", line 676, in run self._callTestMethod(testMethod) File "/usr/lib64/python3.8/unittest/case.py", line 633, in _callTestMethod method() File "/usr/lib64/python3.8/contextlib.py", line 75, in inner return func(*args, **kwds) File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 53, in test_signals_sigint_pycode_stop self.loop.run_until_complete(runner()) File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete return future.result() File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 48, in runner proc.send_signal(signal.SIGINT) File "/usr/lib64/python3.8/asyncio/subprocess.py", line 138, in send_signal self._transport.send_signal(signal) File "uvloop/handles/process.pyx", line 667, in uvloop.loop.UVProcessTransport.send_signal self._check_proc() File "uvloop/handles/process.pyx", line 401, in uvloop.loop.UVProcessTransport._check_proc raise ProcessLookupError()ProcessLookupError________________________________________________________________________ Test_UV_Signals.test_signals_sigint_uvcode _________________________________________________________________________Traceback (most recent call last): File "/usr/lib64/python3.8/unittest/case.py", line 60, in testPartExecutor yield File "/usr/lib64/python3.8/unittest/case.py", line 676, in run self._callTestMethod(testMethod) File "/usr/lib64/python3.8/unittest/case.py", line 633, in _callTestMethod method() File "/usr/lib64/python3.8/contextlib.py", line 75, in inner return func(*args, **kwds) File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 137, in test_signals_sigint_uvcode self.loop.run_until_complete(runner()) File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete return future.result() File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 133, in runner proc.send_signal(signal.SIGINT) File "/usr/lib64/python3.8/asyncio/subprocess.py", line 138, in send_signal self._transport.send_signal(signal) File "uvloop/handles/process.pyx", line 667, in uvloop.loop.UVProcessTransport.send_signal self._check_proc() File "uvloop/handles/process.pyx", line 401, in uvloop.loop.UVProcessTransport._check_proc raise ProcessLookupError()ProcessLookupError_________________________________________________________________ Test_UV_Signals.test_signals_sigint_uvcode_two_loop_runs __________________________________________________________________Traceback (most recent call last): File "/usr/lib64/python3.8/unittest/case.py", line 60, in testPartExecutor yield File "/usr/lib64/python3.8/unittest/case.py", line 676, in run self._callTestMethod(testMethod) File "/usr/lib64/python3.8/unittest/case.py", line 633, in _callTestMethod method() File "/usr/lib64/python3.8/contextlib.py", line 75, in inner return func(*args, **kwds) File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 176, in test_signals_sigint_uvcode_two_loop_runs self.loop.run_until_complete(runner()) File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete return future.result() File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 172, in runner proc.send_signal(signal.SIGINT) File "/usr/lib64/python3.8/asyncio/subprocess.py", line 138, in send_signal self._transport.send_signal(signal) File "uvloop/handles/process.pyx", line 667, in uvloop.loop.UVProcessTransport.send_signal self._check_proc() File "uvloop/handles/process.pyx", line 401, in uvloop.loop.UVProcessTransport._check_proc raise ProcessLookupError()ProcessLookupError_____________________________________________________________________ Test_UV_Signals.test_signals_wakeup_fd_unchanged ______________________________________________________________________Traceback (most recent call last): File "/usr/lib64/python3.8/unittest/case.py", line 60, in testPartExecutor yield File "/usr/lib64/python3.8/unittest/case.py", line 676, in run self._callTestMethod(testMethod) File "/usr/lib64/python3.8/unittest/case.py", line 633, in _callTestMethod method() File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 348, in test_signals_wakeup_fd_unchanged self.loop.run_until_complete(runner()) File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete return future.result() File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 345, in runner self.assertEqual(err, b'') File "/usr/lib64/python3.8/unittest/case.py", line 912, in assertEqual assertion_func(first, second, msg=msg) File "/usr/lib64/python3.8/unittest/case.py", line 905, in _baseAssertEqual raise self.failureException(msg)AssertionError: b'Traceback (most recent call last):\n Fil[235 chars]\'\n' != b''____________________________________________________________________ Test_AIO_Signals.test_signals_and_custom_handler_1 _____________________________________________________________________Traceback (most recent call last): File "/usr/lib64/python3.8/unittest/case.py", line 60, in testPartExecutor yield File "/usr/lib64/python3.8/unittest/case.py", line 676, in run self._callTestMethod(testMethod) File "/usr/lib64/python3.8/unittest/case.py", line 633, in _callTestMethod method() File "/usr/lib64/python3.8/contextlib.py", line 75, in inner return func(*args, **kwds) File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 296, in test_signals_and_custom_handler_1 self.loop.run_until_complete(runner()) File "/usr/lib64/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 280, in runner proc.send_signal(signal.SIGUSR1) File "/usr/lib64/python3.8/asyncio/subprocess.py", line 138, in send_signal self._transport.send_signal(signal) File "/usr/lib64/python3.8/asyncio/base_subprocess.py", line 146, in send_signal self._proc.send_signal(signal) File "/usr/lib64/python3.8/subprocess.py", line 1949, in send_signal os.kill(self.pid, sig)ProcessLookupError: [Errno 3] No such process_______________________________________________________________________ Test_AIO_Signals.test_signals_fork_in_thread ________________________________________________________________________Traceback (most recent call last): File "/usr/lib64/python3.8/unittest/case.py", line 60, in testPartExecutor yield File "/usr/lib64/python3.8/unittest/case.py", line 676, in run self._callTestMethod(testMethod) File "/usr/lib64/python3.8/unittest/case.py", line 633, in _callTestMethod method() File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 382, in test_signals_fork_in_thread subprocess.check_call([ File "/usr/lib64/python3.8/subprocess.py", line 364, in check_call raise CalledProcessError(retcode, cmd)subprocess.CalledProcessError: Command '['/usr/bin/python3', b'-W', b'ignore', b'-c', "\\\nimport asyncio\nimport multiprocessing\nimport signal\nimport sys\nimport threading\nimport uvloop\n\nmultiprocessing.set_start_method('fork')\n\ndef subprocess():\n loop = asyncio.new_event_loop()\n loop.add_signal_handler(signal.SIGINT, lambda *a: None)\n\ndef run():\n loop = asyncio.new_event_loop()\n loop.add_signal_handler(signal.SIGINT, lambda *a: None)\n p = multiprocessing.Process(target=subprocess)\n t = threading.Thread(target=p.start)\n t.start()\n t.join()\n p.join()\n sys.exit(p.exitcode)\n\nrun()\n"]' returned non-zero exit status 1.__________________________________________________________________ Test_AIO_Signals.test_signals_sigint_and_custom_handler __________________________________________________________________Traceback (most recent call last): File "/usr/lib64/python3.8/unittest/case.py", line 60, in testPartExecutor yield File "/usr/lib64/python3.8/unittest/case.py", line 676, in run self._callTestMethod(testMethod) File "/usr/lib64/python3.8/unittest/case.py", line 633, in _callTestMethod method() File "/usr/lib64/python3.8/contextlib.py", line 75, in inner return func(*args, **kwds) File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 229, in test_signals_sigint_and_custom_handler self.loop.run_until_complete(runner()) File "/usr/lib64/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 221, in runner proc.send_signal(signal.SIGHUP) File "/usr/lib64/python3.8/asyncio/subprocess.py", line 138, in send_signal self._transport.send_signal(signal) File "/usr/lib64/python3.8/asyncio/base_subprocess.py", line 146, in send_signal self._proc.send_signal(signal) File "/usr/lib64/python3.8/subprocess.py", line 1949, in send_signal os.kill(self.pid, sig)ProcessLookupError: [Errno 3] No such process___________________________________________________________________ Test_AIO_Signals.test_signals_sigint_pycode_continue ____________________________________________________________________Traceback (most recent call last): File "/usr/lib64/python3.8/unittest/case.py", line 60, in testPartExecutor yield File "/usr/lib64/python3.8/unittest/case.py", line 676, in run self._callTestMethod(testMethod) File "/usr/lib64/python3.8/unittest/case.py", line 633, in _callTestMethod method() File "/usr/lib64/python3.8/contextlib.py", line 75, in inner return func(*args, **kwds) File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 98, in test_signals_sigint_pycode_continue self.loop.run_until_complete(runner()) File "/usr/lib64/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 93, in runner proc.send_signal(signal.SIGINT) File "/usr/lib64/python3.8/asyncio/subprocess.py", line 138, in send_signal self._transport.send_signal(signal) File "/usr/lib64/python3.8/asyncio/base_subprocess.py", line 146, in send_signal self._proc.send_signal(signal) File "/usr/lib64/python3.8/subprocess.py", line 1949, in send_signal os.kill(self.pid, sig)ProcessLookupError: [Errno 3] No such process_____________________________________________________________________ Test_AIO_Signals.test_signals_sigint_pycode_stop ______________________________________________________________________Traceback (most recent call last): File "/usr/lib64/python3.8/unittest/case.py", line 60, in testPartExecutor yield File "/usr/lib64/python3.8/unittest/case.py", line 676, in run self._callTestMethod(testMethod) File "/usr/lib64/python3.8/unittest/case.py", line 633, in _callTestMethod method() File "/usr/lib64/python3.8/contextlib.py", line 75, in inner return func(*args, **kwds) File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 53, in test_signals_sigint_pycode_stop self.loop.run_until_complete(runner()) File "/usr/lib64/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 48, in runner proc.send_signal(signal.SIGINT) File "/usr/lib64/python3.8/asyncio/subprocess.py", line 138, in send_signal self._transport.send_signal(signal) File "/usr/lib64/python3.8/asyncio/base_subprocess.py", line 146, in send_signal self._proc.send_signal(signal) File "/usr/lib64/python3.8/subprocess.py", line 1949, in send_signal os.kill(self.pid, sig)ProcessLookupError: [Errno 3] No such process________________________________________________________________________ Test_AIO_Signals.test_signals_sigint_uvcode ________________________________________________________________________Traceback (most recent call last): File "/usr/lib64/python3.8/unittest/case.py", line 60, in testPartExecutor yield File "/usr/lib64/python3.8/unittest/case.py", line 676, in run self._callTestMethod(testMethod) File "/usr/lib64/python3.8/unittest/case.py", line 633, in _callTestMethod method() File "/usr/lib64/python3.8/contextlib.py", line 75, in inner return func(*args, **kwds) File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 137, in test_signals_sigint_uvcode self.loop.run_until_complete(runner()) File "/usr/lib64/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 133, in runner proc.send_signal(signal.SIGINT) File "/usr/lib64/python3.8/asyncio/subprocess.py", line 138, in send_signal self._transport.send_signal(signal) File "/usr/lib64/python3.8/asyncio/base_subprocess.py", line 146, in send_signal self._proc.send_signal(signal) File "/usr/lib64/python3.8/subprocess.py", line 1949, in send_signal os.kill(self.pid, sig)ProcessLookupError: [Errno 3] No such process_________________________________________________________________ Test_AIO_Signals.test_signals_sigint_uvcode_two_loop_runs _________________________________________________________________Traceback (most recent call last): File "/usr/lib64/python3.8/unittest/case.py", line 60, in testPartExecutor yield File "/usr/lib64/python3.8/unittest/case.py", line 676, in run self._callTestMethod(testMethod) File "/usr/lib64/python3.8/unittest/case.py", line 633, in _callTestMethod method() File "/usr/lib64/python3.8/contextlib.py", line 75, in inner return func(*args, **kwds) File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 176, in test_signals_sigint_uvcode_two_loop_runs self.loop.run_until_complete(runner()) File "/usr/lib64/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 172, in runner proc.send_signal(signal.SIGINT) File "/usr/lib64/python3.8/asyncio/subprocess.py", line 138, in send_signal self._transport.send_signal(signal) File "/usr/lib64/python3.8/asyncio/base_subprocess.py", line 146, in send_signal self._proc.send_signal(signal) File "/usr/lib64/python3.8/subprocess.py", line 1949, in send_signal os.kill(self.pid, sig)ProcessLookupError: [Errno 3] No such process_____________________________________________________________________ Test_AIO_Signals.test_signals_wakeup_fd_unchanged _____________________________________________________________________Traceback (most recent call last): File "/usr/lib64/python3.8/unittest/case.py", line 60, in testPartExecutor yield File "/usr/lib64/python3.8/unittest/case.py", line 676, in run self._callTestMethod(testMethod) File "/usr/lib64/python3.8/unittest/case.py", line 633, in _callTestMethod method() File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 348, in test_signals_wakeup_fd_unchanged self.loop.run_until_complete(runner()) File "/usr/lib64/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_signals.py", line 345, in runner self.assertEqual(err, b'') File "/usr/lib64/python3.8/unittest/case.py", line 912, in assertEqual assertion_func(first, second, msg=msg) File "/usr/lib64/python3.8/unittest/case.py", line 905, in _baseAssertEqual raise self.failureException(msg)AssertionError: b'Traceback (most recent call last):\n Fil[235 chars]\'\n' != b''===================================================================================== warnings summary ======================================================================================<frozen importlib._bootstrap>:219 <frozen importlib._bootstrap>:219: UserWarning: enum class uv_fs_event not importable from uvloop.includes.uv. You are probably using a cpdef enum declared in a .pxd file that does not have a .py or .pyx file.tests/test_aiohttp.py::Test_UV_AioHTTP::test_aiohttp_graceful_shutdowntests/test_aiohttp.py::Test_AIO_AioHTTP::test_aiohttp_graceful_shutdown /home/tkloczko/rpmbuild/BUILD/uvloop-0.19.0/tests/test_aiohttp.py:81: NotAppKeyWarning: It is recommended to use web.AppKey instances for keys. https://docs.aiohttp.org/en/stable/web_advanced.html#application-s-config app['websockets'] = weakref.WeakSet()tests/test_aiohttp.py::Test_UV_AioHTTP::test_aiohttp_graceful_shutdowntests/test_aiohttp.py::Test_AIO_AioHTTP::test_aiohttp_graceful_shutdown /usr/lib64/python3.8/site-packages/aiohttp/web_runner.py:95: DeprecationWarning: shutdown_timeout should be set on BaseRunner super().__init__(-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html================================================================================== short test summary info ==================================================================================SKIPPED [1] tests/test_base.py:695: SkippedSKIPPED [1] tests/test_context.py:435: this seems to be a bug in asyncioSKIPPED [1] tests/test_context.py:578: this seems to be a bug in asyncioSKIPPED [1] tests/test_dns.py:210: SkippedSKIPPED [1] tests/test_sockets.py:162: SkippedSKIPPED [1] tests/test_sockets.py:218: SkippedSKIPPED [1] tests/test_sourcecode.py:13: flake8 module is missingSKIPPED [1] tests/test_sourcecode.py:40: mypy module is missingSKIPPED [2] tests/test_tcp.py:2649: SkippedSKIPPED [1] tests/test_tcp.py:3018: bpo-39951SKIPPED [1] tests/test_tcp.py:1764: SkippedSKIPPED [1] tests/test_tcp.py:1483: SkippedSKIPPED [1] tests/test_tcp.py:1447: SkippedSKIPPED [1] tests/test_tcp.py:2074: asyncio does not support SSL over SSLSKIPPED [1] tests/test_tcp.py:3100: SkippedSKIPPED [1] tests/test_tcp.py:2581: SkippedSKIPPED [1] tests/test_tcp.py:2811: SkippedSKIPPED [1] tests/test_tcp.py:2220: asyncio does not support renegotiationSKIPPED [1] tests/test_tcp.py:2438: SkippedSKIPPED [1] tests/test_tcp.py:2340: SkippedSKIPPED [1] tests/test_tcp.py:2878: SkippedSKIPPED [1] tests/test_tcp.py:2936: SkippedSKIPPED [1] tests/test_tcp.py:1535: SkippedSKIPPED [1] tests/test_tcp.py:1830: SkippedSKIPPED [1] tests/test_tcp.py:1651: SkippedSKIPPED [1] tests/test_tcp.py:1700: SkippedSKIPPED [1] tests/test_tcp.py:1992: SkippedSKIPPED [1] tests/test_tcp.py:1929: SkippedSKIPPED [1] tests/test_tcp.py:1520: SkippedSKIPPED [1] tests/test_tcp.py:2502: SkippedFAILED tests/test_dealloc.py::TestDealloc::test_dealloc_1 - AssertionError: b'Traceback (most recent call last):\n Fil[235 chars]\'\n' != b'' : stderr is not emptyFAILED tests/test_process.py::Test_UV_Process::test_process_double_close - subprocess.CalledProcessError: Command '['/usr/bin/python3', '-c', '\nimport os\nimport sys\nfrom unittest import mock\n\nimport asyncio\n\npipes = []\noriginal_os_pipe = os.pipe\ndef ...FAILED tests/test_signals.py::Test_UV_Signals::test_signals_and_custom_handler_1 - ProcessLookupErrorFAILED tests/test_signals.py::Test_UV_Signals::test_signals_fork_in_thread - subprocess.CalledProcessError: Command '['/usr/bin/python3', b'-W', b'ignore', b'-c', "\\\nimport asyncio\nimport multiprocessing\nimport signal\nimport sys\nimport threading\nimport u...FAILED tests/test_signals.py::Test_UV_Signals::test_signals_sigint_and_custom_handler - ProcessLookupErrorFAILED tests/test_signals.py::Test_UV_Signals::test_signals_sigint_pycode_continue - ProcessLookupErrorFAILED tests/test_signals.py::Test_UV_Signals::test_signals_sigint_pycode_stop - ProcessLookupErrorFAILED tests/test_signals.py::Test_UV_Signals::test_signals_sigint_uvcode - ProcessLookupErrorFAILED tests/test_signals.py::Test_UV_Signals::test_signals_sigint_uvcode_two_loop_runs - ProcessLookupErrorFAILED tests/test_signals.py::Test_UV_Signals::test_signals_wakeup_fd_unchanged - AssertionError: b'Traceback (most recent call last):\n Fil[235 chars]\'\n' != b''FAILED tests/test_signals.py::Test_AIO_Signals::test_signals_and_custom_handler_1 - ProcessLookupError: [Errno 3] No such processFAILED tests/test_signals.py::Test_AIO_Signals::test_signals_fork_in_thread - subprocess.CalledProcessError: Command '['/usr/bin/python3', b'-W', b'ignore', b'-c', "\\\nimport asyncio\nimport multiprocessing\nimport signal\nimport sys\nimport threading\nimport u...FAILED tests/test_signals.py::Test_AIO_Signals::test_signals_sigint_and_custom_handler - ProcessLookupError: [Errno 3] No such processFAILED tests/test_signals.py::Test_AIO_Signals::test_signals_sigint_pycode_continue - ProcessLookupError: [Errno 3] No such processFAILED tests/test_signals.py::Test_AIO_Signals::test_signals_sigint_pycode_stop - ProcessLookupError: [Errno 3] No such processFAILED tests/test_signals.py::Test_AIO_Signals::test_signals_sigint_uvcode - ProcessLookupError: [Errno 3] No such processFAILED tests/test_signals.py::Test_AIO_Signals::test_signals_sigint_uvcode_two_loop_runs - ProcessLookupError: [Errno 3] No such processFAILED tests/test_signals.py::Test_AIO_Signals::test_signals_wakeup_fd_unchanged - AssertionError: b'Traceback (most recent call last):\n Fil[235 chars]\'\n' != b''============================================================= 18 failed, 455 passed, 31 skipped, 5 warnings in 89.92s (0:01:29) =============================================================
If someone may help on resolve pytest issue please continue on #429
Activity
hroncok commentedon Dec 12, 2023
I'm trying to use Cython 3.0.6 in the Fedora's uvloop package updated to 0.19.0.
I'm getting:
And:
When running the tests.
blshkv commentedon Dec 13, 2023
ok, my bad about an artificial requirement. You must follow https://cython.readthedocs.io/en/latest/src/userguide/migrating_to_cy30.html
and fix the code
hroncok commentedon Dec 13, 2023
ancieg commentedon Dec 19, 2023
Notice that it doesn't work with older Cython (<3).
The following worked for me in ALT Linux Sisyphus (build log): https://git.altlinux.org/tasks/336746/build/100/x86_64/log.
hroncok commentedon Dec 19, 2023
Thank you, @ancieg! I can confirm this makes the tests pass with Cython 3.0.6.
uvloop: fork, add cython 3 support. See MagicStack/uvloop#586
dev-python/uvloop: add link to cython-3 bug
kloczek commentedon Dec 27, 2023
Above patch is not enough on use pep517 based build procedure
On top of that patch needs to be added:
(if proposed patch still works with
cython<3).kloczek commentedon Dec 27, 2023
Just tested proposed patch + my chunks and
buildpasses .. howeverpytest still fails
If someone may help on resolve pytest issue please continue on #429
dev-python/uvloop: fix cython-3 compat
thesamesam commentedon Jan 14, 2024
See #587.
jakirkham commentedon Oct 15, 2024
Think this can now be closed
jakirkham commentedon Nov 6, 2025
This was done in PR: #587