Skip to content

[HTTPXodus] migrate httpx to httpx2 (hard switch; closes #1614) - #1615

Open
ProgrammerPlus1998 wants to merge 2 commits into
supabase:mainfrom
ProgrammerPlus1998:httpxodus/httpx2-migration
Open

ProgrammerPlus1998 wants to merge 2 commits into
supabase:mainfrom
ProgrammerPlus1998:httpxodus/httpx2-migration

Conversation

@ProgrammerPlus1998

@ProgrammerPlus1998 ProgrammerPlus1998 commented Sep 4, 2026 •

Copy link
Copy Markdown

Closes #1614

🏷️ Part of HTTPXodus — a community effort to help major Python projects plan their path off the stalled httpx stable line onto httpx2, the actively maintained fork by Pydantic Services.

What this PR does

Complete hard switch from httpx to httpx2 across all five packages (auth, functions, postgrest, storage, supabase):

  • Removes every try/except ImportError dual-import block — direct from httpx2 import ... everywhere (sources and tests)
  • Drops the httpx runtime dependency from each sub-package; httpx2>=2.12.0 unconditional
  • requires-python bumped >=3.9 → >=3.10 in all five packages (httpx2's floor; Python 3.9 is EOL since 2025-10)
  • uv.lock re-locked (httpx2's own deps — truststore, httpcore2 — now included)

Test results

  • postgrest (offline-capable suite): 182 passed
  • All five packages import cleanly with httpx2 2.12.0 in an isolated env
  • The auth/functions/storage/supabase suites require the local supabase service stack (GoTrue on :9998 etc.) and fail identically on the base commit in this environment (verified by control run) — CI with the services running is the real check

Notes for reviewer

  • ⚠️ Python 3.9 dropped in all five packages (EOL since 2025-10); CI jobs on 3.9 will fail at install until the matrix is updated.
  • ⚠️ TLS behavior change: httpx2 verifies TLS against the OS trust store (via truststore) instead of the bundled certifi. Deployments that relied on certifi's CA bundle may need SSL_CERT_FILE / SSL_CERT_DIR. Worth a line in the changelog.

Happy to revise per review — and equally happy to close this PR if the maintainers would rather wait for httpx 1.0 stable. 🙏

Use the actively maintained httpx2 fork (Pydantic Services) when
available, falling back to httpx. 6 pyproject.toml files updated
(workspace members) and ~60 source files migrated with try/except
dual-import pattern. Public API surface unchanged.

Refs: supabase#1614
@ProgrammerPlus1998
ProgrammerPlus1998 requested review from a team and o-santi as code owners September 4, 2026 07:01
Remove all try/except ImportError dual-import blocks across the five
packages (auth, functions, postgrest, storage, supabase): direct
'from httpx2 import ...' everywhere. Drop the httpx runtime dep from
each sub-package; httpx2>=2.12.0 unconditional. requires-python
bumped >=3.9 -> >=3.10 in all five packages (httpx2's floor; 3.9 is
EOL since 2025-10). uv.lock re-locked.

Refs: supabase#1614
@ProgrammerPlus1998 ProgrammerPlus1998 changed the title [HTTPXodus] migrate httpx to httpx2 with dual import (closes #1614) [HTTPXodus] migrate httpx to httpx2 (hard switch; closes #1614) Sep 10, 2026

This branch has not been deployed

No deployments
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.

[HTTPXodus] Consider migrating from httpx to httpx2 (the actively maintained fork)

1 participant