Floor on released `pydantic-ai` 2.38.0
Summary
Prerequisite for #711. The three adoption PRs — #712 (filesystem events), #713 (compaction lifecycle
events) and #714 (callback deprecations) — all import CapabilityEvent at module scope, and it does
not exist on the floor we advertise. On pydantic-ai-slim>=2.37.0 every one of them fails at
collection:
ImportError: cannot import name 'CapabilityEvent' from 'pydantic_ai'. Did you mean: 'CapabilityFunc'?
Unlike #766's, this is not a straddle we can carry: the events are the feature, so there is no
2.37-compatible branch to fall back to. 2.38.0 is the release that has the family — CustomEvent,
CapabilityEvent, ctx.emit() and @on_event (pydantic-ai#6258, f8cc1d603).
- the six general
pydantic-ai-slimfloors go to>=2.38.0(the base dependency plus the five
pass-through extras). The>=2.18.0feature-specific floors are subsumed and unchanged; uv.lockmovespydantic-ai-slimandpydantic-graphfrom 2.37.0 to 2.38.0, and picks up
genai-prices0.1.6 with them;- the
[tool.uv]anthropicoverride goes to>=1.3.0, because 2.38.0 raised slim's own
anthropicfloor from 1.0.0 to 1.3.0. An override replaces every requirement on the package it
names, including slim's, so the entry exists to repeat whatever slim declares; its comment says to
move it whenever slim's moves. Left at>=1.0.0,lowest-directresolves slim 2.38.0 against an
anthropicbelow the floor it declares.
The comment paragraph that named the specific generation (anthropic>=1 is the HTTPX2 generation)
comes out. The override's job is to repeat whatever slim declares, whatever that is; naming one
generation dated the comment to a floor that has since moved twice.
Precedent: 3d0a7524 (#769) and 7c8aee30 (#743) before it.
Linked Issue
Fixes #779
Checklist
-
Linked issue exists and is referenced above
-
Tests added/updated for new behavior (no behavior change; the existing suite is the check)
-
make lint && make typecheck && make testpasses locally -
pyproject.tomlanduv.lockare unchanged, or a maintainer addeddependencies:approvedto the current headNeeds
dependencies:approved. Raising the floor is the point of the PR, sopyproject.toml
anduv.locknecessarily change. -
Docstrings use single backticks (not RST double backticks)
Verification
Ran locally against the resolutions the CI jobs use:
| resolution | pydantic-ai-slim | anthropic | result |
|---|---|---|---|
locked (uv sync --locked) | 2.38.0 | 1.3.0 | 5,594 passed, 63 skipped |
--resolution lowest-direct | 2.38.0 | 1.3.0 | 5,594 passed, 63 skipped |
The latest-version job resolves to the same pair: 2.38.0 is the newest release, so the lock is
already at it.
lowest-direct is where the anthropic override matters. Left at >=1.0.0 it resolves
anthropic==1.0.0 against slim 2.38.0, which declares >=1.3.0 — the override erases that
requirement, so uv resolves it happily and nothing complains until something reaches for an API
only the newer SDK has. At >=1.3.0 both halves of the pair land on the floor slim actually
advertises.
uv lock --locked is clean, and pre-commit's check toml passes.