sanic icon indicating copy to clipboard operation
sanic copied to clipboard

Upgrade dependency version constraint specification for `uvloop`

Open ancalita opened this issue 1 year ago • 0 comments

Describe the bug A manual integration test of a Rasa HTTP API endpoint was failing with this traceback:

[1] [ERROR] Exception occurred while handling uri: 'http://rasa-worker:5005/model/train?force=true&save_to_default_model_directory=true&callback_url=http://rasa-x:5002/api/projects/default/models/jobs/7/result?token%3Drasaxtoken&token=rasatoken'
Traceback (most recent call last):
  File "handle_request", line 83, in handle_request
    )
  File "/opt/venv/lib/python3.8/site-packages/rasa/server.py", line 238, in decorated
    result = await result
  File "/opt/venv/lib/python3.8/site-packages/rasa/server.py", line 600, in decorated_function
    request.app.add_task(wrapped())
  File "/opt/venv/lib/python3.8/site-packages/sanic/app.py", line 1609, in add_task
    return self._loop_add_task(
  File "/opt/venv/lib/python3.8/site-packages/sanic/app.py", line 1565, in _loop_add_task
    task = loop.create_task(prepped, name=name)
TypeError: create_task() takes no keyword arguments

Investigating further we discovered that this is because the version of uvloop that rasa is constrained to have was below 0.15.0 while Sanic 21.12 LTS requires uvloop above 0.15.0 to handle the name keyword argument given to loop.create_task method. This dependency version solving problem would have been flagged by poetry if Sanic had required uvloop to be above 0.15.0. In setup.py I see that uvloop is at >=0.5.3.

I'm submitting this issue to raise awareness about the potential issues the lower bound constraint on uvloop could have for Sanic users.

Code snippet Relevant source code, make sure to remove what is not necessary.

Expected behavior A clear and concise description of what you expected to happen.

Sanic 21.12 LTS requires uvloop to be >=0.15.0 version.

Environment (please complete the following information):

  • OS: Mac
  • Version [e.g. 0.8.3]: 21.12 LTS

Additional context Add any other context about the problem here.

ancalita avatar Jul 11 '22 11:07 ancalita