Floor on released `pydantic-ai` 2.37.0 and drop the version straddle

Merged
DO
3mo ago
+23-45

Summary

Follow-up to #766, as discussed there.

2.37.0 is the release where a capability's @durable_operation methods pass through to the plain
function when the agent runs outside a durable container (pydantic-ai#7972, 8c5838dd3). Below it,
composing a durability capability with SpendLimits or StepPersistence and running outside a
workflow makes those operations attempt a workflow dispatch and raise Not in workflow event loop,
so that configuration was broken on the floor we advertised.

#766 straddled both versions in the spend composition test to get check green on main. This raises
the floor to the release that actually fixed the problem and deletes the straddle:

  • the six general pydantic-ai-slim floors go to >=2.37.0 (the base dependency plus the five
    pass-through extras). The >=2.18.0 feature-specific floors are subsumed and unchanged;
  • uv.lock moves pydantic-ai-slim and pydantic-graph from 2.36.0 to 2.37.0;
  • the test drops the importlib.metadata probe and the if/else, keeping the accrual assertion
    #766 added, and its docstring now states one invariant instead of describing two versions.

The # pragma: no cover - latest-version path goes with the straddle, which is worth calling out on
its own: it was sitting on the branch that every current install takes, so the behaviour we care
about was the uncovered one. Coverage of the changed method is now complete.

This also deletes the floor-rationale comment that had accumulated above the dependency, rather than
adding another paragraph to it. Why a given version is required belongs in the commit that raises the
floor, where git blame finds it, not in a comment that grows with every bump.

Precedent for handling a straddle this way: 7c8aee30 (#743), "Floor on released pydantic-ai
2.36.0 and drop the version straddle".

Linked Issue

Fixes #768

Checklist

  • Linked issue exists and is referenced above

  • Tests added/updated for new behavior (the straddled test collapses to a single contract)

  • make lint && make typecheck && make test passes locally

  • pyproject.toml and uv.lock are unchanged, or a maintainer added dependencies:approved to the current head

    Needs dependencies:approved. Raising the floor is the point of the PR, so pyproject.toml
    and uv.lock necessarily change.

  • Docstrings use single backticks (not RST double backticks)

Verification

Ran locally against all three resolutions the CI jobs use:

resolutionresult
locked (uv sync --locked)5,592 passed, 63 skipped
lowest-direct, resolving pydantic-ai-slim==2.37.05,592 passed, 63 skipped
latest (lock upgrade), pydantic-ai-slim==2.37.05,592 passed, 63 skipped

Plus ruff format (328 files), ruff lint, and pyright: 0 errors, 0 warnings. The later comment
deletion is TOML-only and was re-checked with check toml and uv lock --check.