feat: add uvloop dependency with version markers for compatibility#6754
feat: add uvloop dependency with version markers for compatibility#6754FarhanAliRaza wants to merge 1 commit into
Conversation
Greptile SummaryThis PR adds uvloop as an event-loop dependency for compatible environments. The main changes are:
Confidence Score: 5/5No additional blocking issue was found for this review.
Important Files Changed
Reviews (2): Last reviewed commit: "feat: add uvloop dependency with version..." | Re-trigger Greptile |
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9420524d42
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # Faster event loop, picked up automatically by granian (loop='auto') and uvicorn. | ||
| # Only where uvloop ships wheels (CPython on linux/macOS x86_64+arm64; 3.14 wheels | ||
| # start at 0.22.1) so installs never fall back to a source build. | ||
| "uvloop >=0.21.0; python_version < '3.14' and (sys_platform == 'linux' or sys_platform == 'darwin') and (platform_machine == 'x86_64' or platform_machine == 'aarch64' or platform_machine == 'arm64') and platform_python_implementation == 'CPython'", |
There was a problem hiding this comment.
Keep uvloop opt-in for existing asyncio apps
On Linux/macOS CPython <3.14 this installs uvloop for every Reflex app. The existing Uvicorn paths (reflex/utils/exec.py::run_uvicorn_backend and prod) do not pass a loop= override, so Uvicorn's default auto switches those processes to uvloop as soon as the dependency is present. uvloop 0.22 raises RuntimeError from asyncio.get_event_loop() when no loop is already set, while the stdlib policy on Python 3.10β3.13 still creates one; apps or imported libraries that do this during module import/startup can fail before the backend serves. Please make uvloop opt-in or explicitly select it only where this compatibility change is acceptable.
Useful? React with πΒ / π.
All Submissions:
Type of change
Please delete options that are not relevant.
New Feature Submission:
Changes To Core Features:
After these steps, you're ready to open a pull request.