Skip to content

User question: respx and the httpx forks #316

@rgant

Description

@rgant

Hi; I'm a respx user trying to make an informed decision about my own project and I'd appreciate any read you have on this.

Context

I've been moving an internal project off upstream httpx for supply-chain reasons — no release since November 2024, issues and discussions closed, focus moved to a private rewrite. A community-maintained stability fork called httpxyz has emerged and is actively shipping. It registers itself under the httpx import name via a sys.modules alias plus a pytest plugin, with the goal of being a transparent drop-in.

When I tried it with respx 0.23.1, HTTPCoreMocker-based mocks stopped intercepting — calls fell through to the real network. After some digging the cause turned out to be on the httpxyz side: their sys.modules alias only covers the top-level package names, and respx patches by submodule path (httpcore._sync.connection_pool.ConnectionPool, etc.), which causes Python to load a duplicate module under the alias name. I filed httpxyz#53 with a reproducer and a proposed fix; once that lands upstream, respx should work against httpxyz with no changes here.

What I'd value hearing

So this isn't a respx bug, and I'm not asking you to do anything about it. But as I've been working through it, I realised I don't actually know how you think about the broader situation. So figured I'd ask:

As more httpx users move to httpxyz (or stay on stagnating upstream), do you have a sense of where respx wants to sit?

Even an answer like "we track upstream httpx exclusively; users on forks are on their own" is genuinely useful — it helps me and others plan, and it's a reasonable position. I'm not advocating for any particular outcome.

What I'm not assuming

  • That you should care about httpxyz, support it, or change anything in respx. Each of those adds real maintenance load, and you're best placed to judge whether that's worth it.
  • That a "no" needs justification. "Not interested" or "we follow upstream only" is a complete answer.
  • That the technical compatibility issue I bumped into needs respx engagement; it's being handled upstream at httpxyz.

An offer, if it'd be welcome

If you'd find it useful, I'd be glad to put together a PR that makes respx work against either upstream httpx or httpxyz at the same install — i.e. respx detects which one the user has and mocks the right thing, with no behaviour change for users on plain httpx. The smallest version of that change looks small to me, but I want to flag plainly that even an accepted PR commits respx to a slightly larger surface (two packaging conventions to keep in mind when respx or httpcore internals change), so this is a real maintenance ask, not a free lunch. I don't want to presume — but if it'd be welcome, I'm here.

A "no, please don't" is just as useful an answer as a "yes, send it."

A standalone reproducer (only if curious)

If you ever want to verify the interaction yourself, there's a self-contained pytest reproducer (sync + async cases, one toggle that demonstrates a workaround). It also runs cleanly against current respx without modification — it just illustrates the failure mode.

Thanks for respx, and thanks for whatever read you can share on this. No reply needed if you'd rather not engage; closing this issue with no comment is also a perfectly fine answer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions