fix(deps): cap httpx<1.0 — prerelease 1.0.dev3 drops the top-level Auth re-export#262
Merged
Conversation
…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>
4 tasks
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #252.
Why
httpx 1.0.dev3drops the top-levelhttpx.Authre-export. Two locus modules subclasshttpx.Authat module-import time:src/locus/models/providers/oci/_signing.py—class OCIRequestSigner(httpx.Auth)src/locus/integrations/fastmcp.py—class BearerAuth(httpx.Auth)(defined insideMCPClient.__init__)Resolving with
uv pip install --prerelease=allow locus-sdkpicks 1.0.dev3 and breaks both imports withAttributeError: module 'httpx' has no attribute 'Auth'.What changed
pyproject.toml: bumped pin tohttpx>=0.27,<1.0with a comment noting the port required before lifting the cap.tests/unit/test_httpx_compat_252.py— 7 regression tests:<1.0cap (catches anyone removing it).OCIRequestSignerstill imports and is a realhttpx.Authsubclass.locus.integrations.fastmcpmodule loads cleanly.OCIRequestSigner.auth_flowexercises the fullhttpx.Authcontract: signs the request, strips inboundAuthorization/X-Api-Key, attachesopc-compartment-id.last_refresh_errorexposes it for health checks.BearerAuthpattern still works under the resolved httpx.Test plan
uv run pytest tests/unit/— 4895 passingOCIChatCompletionsModeldrivesOCIRequestSignerover real httpx tous-chicago-1) — 5/5 passpre-commit run --files <staged>— passFollow-up
When httpx 1.0 GAs, port
OCIRequestSignerand the inlineBearerAuthto the new auth API and lift the cap.