Skip to content

feat: add uvloop dependency with version markers for compatibility#6754

Open
FarhanAliRaza wants to merge 1 commit into
reflex-dev:mainfrom
FarhanAliRaza:test-uvloop
Open

feat: add uvloop dependency with version markers for compatibility#6754
FarhanAliRaza wants to merge 1 commit into
reflex-dev:mainfrom
FarhanAliRaza:test-uvloop

Conversation

@FarhanAliRaza

Copy link
Copy Markdown
Contributor

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

New Feature Submission:

  • Does your submission pass the tests?
  • Have you linted your code locally prior to submission?

Changes To Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

After these steps, you're ready to open a pull request.

a. Give a descriptive title to your PR.

b. Describe your changes.

c. Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if such).

@FarhanAliRaza FarhanAliRaza requested a review from a team as a code owner July 13, 2026 11:32
@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds uvloop as an event-loop dependency for compatible environments. The main changes are:

  • Platform and Python version markers in pyproject.toml.
  • uvloop 0.22.1 package metadata and wheels in uv.lock.
  • Regenerated lockfile dependency markers.

Confidence Score: 5/5

No additional blocking issue was found for this review.

  • The remaining wheel-range concern is already covered by the existing review comment.
  • No separate failure requiring another code change was identified.

Important Files Changed

Filename Overview
pyproject.toml Adds uvloop dependencies gated by Python version, operating system, architecture, and Python implementation.
uv.lock Records uvloop 0.22.1 and regenerates related dependency markers.

Reviews (2): Last reviewed commit: "feat: add uvloop dependency with version..." | Re-trigger Greptile

Comment thread pyproject.toml
@codspeed-hq

codspeed-hq Bot commented Jul 13, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

βœ… 26 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing FarhanAliRaza:test-uvloop (9420524) with main (11f8a7a)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ’‘ 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".

Comment thread pyproject.toml
# 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'",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 πŸ‘Β / πŸ‘Ž.

@Alek99 Alek99 reopened this Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants