Replace httpx with httpx2 #101

Manually merged
marvin8 merged 3 commits from feat/issue-100-httpx-to-httpx2 into main 2026-08-07 23:57:13 +00:00
Collaborator

Swap the unmaintained httpx dependency for the actively maintained httpx2 (Pydantic team). httpx2 is already a transitive dependency via longwei and bump-my-version — this removes the duplicate HTTP stack.

  • Replace "httpx[http2]~=0.28.1" with "httpx2[http2]~=2.9.1"
  • Swap all from httpx import ... to from httpx2 import ...
  • Update _QUIET_LOGGERS (drop httpx, httpcore → httpcore2)
  • Drop now-unnecessary deptry ignores (h11, h2) and constraint (h2)

No behavioral changes — httpx2's API is a drop-in replacement for the subset feed2fedi uses. All 178 tests pass on Python 3.12–3.14.

Closes #100

Swap the unmaintained `httpx` dependency for the actively maintained `httpx2` (Pydantic team). httpx2 is already a transitive dependency via longwei and bump-my-version — this removes the duplicate HTTP stack. - Replace `"httpx[http2]~=0.28.1"` with `"httpx2[http2]~=2.9.1"` - Swap all `from httpx import ...` to `from httpx2 import ...` - Update `_QUIET_LOGGERS` (drop httpx, httpcore → httpcore2) - Drop now-unnecessary deptry ignores (h11, h2) and constraint (h2) No behavioral changes — httpx2's API is a drop-in replacement for the subset feed2fedi uses. All 178 tests pass on Python 3.12–3.14. Closes #100
🔧 Replace httpx imports with httpx2
All checks were successful
/ gitleaks (pull_request) Successful in 30s
/ pr-review (pull_request) Successful in 44s
/ checks (pull_request) Successful in 4m46s
/ publish (pull_request) Has been skipped
/ deploy-docs (pull_request) Has been skipped
58d4105e73
forgejo-actions left a comment

WuMing

Found 6 issue(s). See inline comments below.

## WuMing Found **6** issue(s). See inline comments below.
@ -8,3 +8,3 @@
from cyclopts import App
from cyclopts import Parameter
from httpx import AsyncClient
from httpx2 import AsyncClient

code [CRITICAL]

Importing from 'httpx2' which is not a known public package. This will cause an ImportError at runtime. If the intended package is 'httpx', revert the change. If 'httpx2' is an internal fork, ensure it is installed correctly, but still suspect.

**code** [CRITICAL] Importing from 'httpx2' which is not a known public package. This will cause an ImportError at runtime. If the intended package is 'httpx', revert the change. If 'httpx2' is an internal fork, ensure it is installed correctly, but still suspect. <!-- wuming:sha256:d008439c6de6cd535765c88e08388b6a20ead2cd783c639d8809b5089ca7adcd -->
marvin8 marked this conversation as resolved
@ -12,3 +12,1 @@
from httpx import AsyncClient
from httpx import HTTPError
from httpx import StreamError
from httpx2 import AsyncClient

code [CRITICAL]

Import from non-existent package 'httpx2' (AsyncClient). Will cause ImportError.

**code** [CRITICAL] Import from non-existent package 'httpx2' (AsyncClient). Will cause ImportError. <!-- wuming:sha256:e850cd1dc9bb585c3bc6c16ae5b16251cbef677632fda776af337c1a68678467 -->
marvin8 marked this conversation as resolved
@ -13,2 +12,2 @@
from httpx import HTTPError
from httpx import StreamError
from httpx2 import AsyncClient
from httpx2 import HTTPError

code [CRITICAL]

Import from non-existent package 'httpx2' (HTTPError). Will cause ImportError.

**code** [CRITICAL] Import from non-existent package 'httpx2' (HTTPError). Will cause ImportError. <!-- wuming:sha256:2002d5964685a69ae0e484bbfd73240ee5997ed55fee5fe31ea3b6af234a7b87 -->
marvin8 marked this conversation as resolved
@ -14,1 +12,3 @@
from httpx import StreamError
from httpx2 import AsyncClient
from httpx2 import HTTPError
from httpx2 import StreamError

code [CRITICAL]

Import from non-existent package 'httpx2' (StreamError). Will cause ImportError.

**code** [CRITICAL] Import from non-existent package 'httpx2' (StreamError). Will cause ImportError. <!-- wuming:sha256:02e44eb3425f04dfd8e6faa662d1304577cce7d7e4e73797da436e781905f133 -->
marvin8 marked this conversation as resolved
@ -12,3 +12,3 @@
# stdlib loggers that are too chatty at INFO
_QUIET_LOGGERS = ["httpx", "httpx2", "httpcore"]
_QUIET_LOGGERS = ["httpx2", "httpcore2"]

code [CRITICAL]

Logging quiet list references 'httpx2' and 'httpcore2', which are not known standard libraries. If 'httpx2' does not exist, these suppressors are unnecessary and may mask missing imports. Change back to 'httpx' and 'httpcore' if using the real httpx package.

**code** [CRITICAL] Logging quiet list references 'httpx2' and 'httpcore2', which are not known standard libraries. If 'httpx2' does not exist, these suppressors are unnecessary and may mask missing imports. Change back to 'httpx' and 'httpcore' if using the real httpx package. <!-- wuming:sha256:584eb4acffdd6e639ad947519d797aec3ae6c3149e221b3a70fc90a2a355d679 -->
marvin8 marked this conversation as resolved
@ -15,3 +15,3 @@
import yt_dlp.utils
from feedparser import FeedParserDict
from httpx import AsyncClient
from httpx2 import AsyncClient

code [CRITICAL]

Import from non-existent package 'httpx2' (AsyncClient). Will cause ImportError.

**code** [CRITICAL] Import from non-existent package 'httpx2' (AsyncClient). Will cause ImportError. <!-- wuming:sha256:db02c54a117f5924b554b3368022709b095ff7b26293471bbecfcbf26b0709ca -->
marvin8 marked this conversation as resolved
Author
Collaborator

src/feed2fedi/app.py line 0 · src/feed2fedi/collect.py line 0 · src/feed2fedi/collect.py line 0 · src/feed2fedi/collect.py line 0 · src/feed2fedi/publish.py line 0 · src/feed2fedi/logging_config.py line 0

Importing from httpx2 which is not a known public package. Will cause ImportError.

🔴 Not actioned — httpx2 is a real, actively maintained PyPI package (pypi.org/project/httpx2, by the Pydantic team). It is already a transitive dependency of this project via longwei and bump-my-version. All 178 tests pass across Python 3.12–3.14. These are false positives from an incomplete package database.

[`src/feed2fedi/app.py` line 0](https://forge.marvin8.zone/marvin8/feed2fedi/pulls/101#issuecomment-1146) · [`src/feed2fedi/collect.py` line 0](https://forge.marvin8.zone/marvin8/feed2fedi/pulls/101#issuecomment-1147) · [`src/feed2fedi/collect.py` line 0](https://forge.marvin8.zone/marvin8/feed2fedi/pulls/101#issuecomment-1148) · [`src/feed2fedi/collect.py` line 0](https://forge.marvin8.zone/marvin8/feed2fedi/pulls/101#issuecomment-1149) · [`src/feed2fedi/publish.py` line 0](https://forge.marvin8.zone/marvin8/feed2fedi/pulls/101#issuecomment-1150) · [`src/feed2fedi/logging_config.py` line 0](https://forge.marvin8.zone/marvin8/feed2fedi/pulls/101#issuecomment-1151) > Importing from httpx2 which is not a known public package. Will cause ImportError. 🔴 Not actioned — `httpx2` is a real, actively maintained PyPI package ([pypi.org/project/httpx2](https://pypi.org/project/httpx2/), by the Pydantic team). It is already a transitive dependency of this project via `longwei` and `bump-my-version`. All 178 tests pass across Python 3.12–3.14. These are false positives from an incomplete package database.
📝 update release notes
All checks were successful
/ gitleaks (pull_request) Successful in 24s
/ pr-review (pull_request) Successful in 39s
/ checks (pull_request) Successful in 4m44s
/ publish (pull_request) Has been skipped
/ deploy-docs (pull_request) Has been skipped
6d11a943ff
marvin8 approved these changes 2026-08-07 23:56:14 +00:00
marvin8 manually merged commit d3acd54c97 into main 2026-08-07 23:57:13 +00:00
marvin8 deleted branch feat/issue-100-httpx-to-httpx2 2026-08-07 23:58:27 +00:00
Sign in to join this conversation.
No description provided.