uvicorn
uvicorn copied to clipboard
use asyncio.run(..., loop_factory) to avoid asyncio.set_event_loop_policy
Summary
set_event_loop_policy will be deprecated in python 3.13 and uvloop.EventLoopPolicy is deprecated already, this backports and uses the preferred loop_factory keyword to configure asyncio.run
Checklist
- [x] I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
- [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
- [ ] I've updated the documentation accordingly.
This still needs a doc change
actually this doesn't need a doc change as --loop never allowed a custom loop setup function