-
Notifications
You must be signed in to change notification settings - Fork 1.8k
migrate httpx to httpx2 (dual import) #7040
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -234,7 +234,10 @@ def download_and_run(url: str, *args, show_status: bool = False, **env): | |
| Raises: | ||
| SystemExit: If the script fails to download. | ||
| """ | ||
| import httpx | ||
| try: | ||
| import httpx2 as httpx | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: This try/except dual-import block is duplicated verbatim in 7+ files (net.py has 4 copies). It is not a circular-import case, so it belongs in a shared helper, e.g. Prompt for AI agents |
||
| except ModuleNotFoundError: | ||
| import httpx | ||
|
|
||
| # Download the script | ||
| logger.debug(f"Downloading {url}") | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: httpx2 is added to the required
dependencies, but the dual-import code across net.py, telemetry.py, registry.py, and the download utilities relies on httpx2 being optional (except ModuleNotFoundError: import httpx). Because httpx2 is now always installed, that fallback is dead code, and every reflex install is forced to pull httpx2 — contradicting the PR's stated Option A of keeping it optional for apps that pin httpx. Move it to[project.optional-dependencies](or drop the fallback if httpx2 is meant to be mandatory).Prompt for AI agents