Skip to content

[HTTPXodus] migrate httpx to httpx2 (hard switch; closes #2154) - #2155

Open
ProgrammerPlus1998 wants to merge 3 commits into
weaviate:mainfrom
ProgrammerPlus1998:httpxodus/httpx2-migration
Open

ProgrammerPlus1998 wants to merge 3 commits into
weaviate:mainfrom
ProgrammerPlus1998:httpxodus/httpx2-migration

Conversation

@ProgrammerPlus1998

@ProgrammerPlus1998 ProgrammerPlus1998 commented Sep 4, 2026

Copy link
Copy Markdown

Closes #2154

🏷️ 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:

  • Removes all 21 try/except ImportError dual-import blocks — direct httpx2 imports everywhere (connect/v4.py, util.py, embedded.py, exceptions.py, client_executor.py, etc.)
  • setup.cfg: drops httpx>=0.26.0,<0.29.0; httpx2>=2.12.0 unconditional (python_requires is already >=3.10, matching httpx2's floor)

Test results

  • Unit suite (test/, excluding test/collection which needs a live server): 91 passed with httpx2 2.12.0 in an isolated env

Notes for reviewer

  • ⚠️ 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 (minimal containers, corporate proxies) may need SSL_CERT_FILE / SSL_CERT_DIR after the switch. 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. setup.cfg updated; 22 source
files migrated with try/except dual-import. Public API unchanged.

Refs: weaviate#2154
@ProgrammerPlus1998
ProgrammerPlus1998 force-pushed the httpxodus/httpx2-migration branch from a5cde23 to d496df2 Compare September 4, 2026 07:10

@orca-security-eu orca-security-eu 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.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@weaviate-git-bot

Copy link
Copy Markdown

To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge.

beep boop - the Weaviate bot 👋🤖

PS:
Are you already a member of the Weaviate Forum?

@ProgrammerPlus1998

Copy link
Copy Markdown
Author

I agree to the Weaviate Contributor License Agreement (CLA). Thanks!

Remove all try/except ImportError dual-import blocks (21 modules);
direct httpx2 imports everywhere. setup.cfg: drop httpx, httpx2>=2.12.0
unconditional (python_requires is already >=3.10).

Refs: weaviate#2154
@ProgrammerPlus1998 ProgrammerPlus1998 changed the title [HTTPXodus] migrate httpx to httpx2 with dual import (closes #2154) [HTTPXodus] migrate httpx to httpx2 (hard switch; closes #2154) Sep 10, 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.

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

2 participants