Skip to content

fix(deps): cap httpx<1.0 — prerelease 1.0.dev3 drops the top-level Auth re-export#262

Merged
fede-kamel merged 1 commit into
mainfrom
fix/252-httpx-1.0-cap
May 23, 2026
Merged

fix(deps): cap httpx<1.0 — prerelease 1.0.dev3 drops the top-level Auth re-export#262
fede-kamel merged 1 commit into
mainfrom
fix/252-httpx-1.0-cap

Conversation

@fede-kamel
Copy link
Copy Markdown
Contributor

Closes #252.

Why

httpx 1.0.dev3 drops the top-level httpx.Auth re-export. Two locus modules subclass httpx.Auth at module-import time:

  • src/locus/models/providers/oci/_signing.pyclass OCIRequestSigner(httpx.Auth)
  • src/locus/integrations/fastmcp.pyclass BearerAuth(httpx.Auth) (defined inside MCPClient.__init__)

Resolving with uv pip install --prerelease=allow locus-sdk picks 1.0.dev3 and breaks both imports with AttributeError: module 'httpx' has no attribute 'Auth'.

What changed

  • pyproject.toml: bumped pin to httpx>=0.27,<1.0 with a comment noting the port required before lifting the cap.
  • New tests/unit/test_httpx_compat_252.py — 7 regression tests:
    • Pyproject keeps the <1.0 cap (catches anyone removing it).
    • OCIRequestSigner still imports and is a real httpx.Auth subclass.
    • locus.integrations.fastmcp module loads cleanly.
    • OCIRequestSigner.auth_flow exercises the full httpx.Auth contract: signs the request, strips inbound Authorization / X-Api-Key, attaches opc-compartment-id.
    • 401 retry path with refresh callback fires exactly once.
    • Refresh-exception is swallowed; last_refresh_error exposes it for health checks.
    • Inline BearerAuth pattern still works under the resolved httpx.

Test plan

  • uv run pytest tests/unit/ — 4895 passing
  • Live OCI OpenAI-compat integration (OCIChatCompletionsModel drives OCIRequestSigner over real httpx to us-chicago-1) — 5/5 pass
  • pre-commit run --files <staged> — pass
  • CI green

Follow-up

When httpx 1.0 GAs, port OCIRequestSigner and the inline BearerAuth to the new auth API and lift the cap.

…th re-export

httpx 1.0.dev3 removes ``httpx.Auth`` from the module top level.
Two locus modules subclass ``httpx.Auth`` at import time:

- ``src/locus/models/providers/oci/_signing.py`` — ``OCIRequestSigner``
- ``src/locus/integrations/fastmcp.py`` — ``BearerAuth`` (inside
  ``MCPClient.__init__``)

Resolving ``locus-sdk`` with ``--prerelease=allow`` pulls 1.0.dev3 and
both fail with ``AttributeError`` at class-definition time. Cap the
constraint at ``<1.0`` until the two ``httpx.Auth`` subclasses are
ported to the 1.0 auth API.

Tests (``tests/unit/test_httpx_compat_252.py``):

- Regression: pyproject keeps the ``<1.0`` cap.
- Import smoke: ``OCIRequestSigner`` is a real ``httpx.Auth`` subclass;
  ``locus.integrations.fastmcp`` imports cleanly.
- ``OCIRequestSigner.auth_flow`` exercises the full ``httpx.Auth``
  contract: signs the request, strips inbound ``Authorization`` /
  ``X-Api-Key``, attaches ``opc-compartment-id``.
- 401 retry path with refresh callback fires exactly once.
- Refresh-exception is swallowed; ``last_refresh_error`` exposes it.
- Inline ``BearerAuth`` pattern still works under the resolved httpx.

Verified locally:

- ``uv run pytest tests/unit/`` — 4895 passing.
- Live OCI OpenAI-compat suite (``OCIChatCompletionsModel`` drives
  ``OCIRequestSigner`` over real httpx to ``us-chicago-1``) — 5/5 pass.

Follow-up: when httpx 1.0 GAs, port ``OCIRequestSigner`` and the inline
``BearerAuth`` to the new auth API and lift the cap.

Signed-off-by: Federico Kamelhar <federico.kamelhar@oracle.com>
@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label May 23, 2026
@fede-kamel fede-kamel merged commit 14679e6 into main May 23, 2026
10 checks passed
@fede-kamel fede-kamel deleted the fix/252-httpx-1.0-cap branch May 23, 2026 20:10
fede-kamel added a commit that referenced this pull request May 23, 2026
…gonomics + httpx 1.0 cap + trademark naming (#265)

Four PRs of fixes since b20. No new public APIs; tightens the SDK
on durability (StateGraph interrupt resume), ergonomics (OCIModel
aliases, AgentConfig.name, Tool.func), deps (httpx<1.0 cap), and
brings the docs site in line with the approved product name.

- #261 — StateGraph.interrupt_before now writes through the
  checkpointer at the pause boundary; resume advances past the gate
  instead of re-pausing. Inline interrupt() save crash with
  state=None fixed in the same pass. OCIModel gains region= and
  profile= ergonomic aliases. AgentConfig.name + Tool.func surface
  the names users naturally reach for.
- #262 — Capped httpx<1.0; pre-release 1.0.dev3 drops the top-level
  Auth re-export and broke OCIRequestSigner + BearerAuth at import.
- #257 — Applied the Oracle Trademark Legal-approved full name
  (wordmark above hero H1, persistent header) and short name (body
  prose / OG meta / tab title) across docs, README, and contributor
  markdown.
- #264 — OCI client read timeout default 60s→300s for reasoning
  models; integration fixture max_tokens 512→8192 so reasoning
  models have budget for both hidden chain-of-thought and visible
  output; eight stale integration tests refreshed against current
  catalogue / workbench layout.

See CHANGELOG.md for the full breakdown.

Signed-off-by: Federico Kamelhar <federico.kamelhar@oracle.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

httpx 1.0 incompatibility: httpx.Auth removed at top level breaks OCIRequestSigner

1 participant