Repository navigation
chore: Update Anthropic to 1.11 - #2521
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Confidence score: 4/5
test_mcp_version_detection.pyerrors during collection when MCP is not installed instead of skipping. CatchPackageNotFoundErrorand skip the module.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="tests/otel_integrations/test_mcp_version_detection.py">
<violation number="1" location="tests/otel_integrations/test_mcp_version_detection.py:20">
P2: `version('mcp')` raises `PackageNotFoundError` when MCP is not installed, so this test errors during collection instead of skipping as before; catch that error and skip the module.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
View guided diff | Re-trigger cubic
| pytest.importorskip('logfire._internal.integrations.mcp') | ||
| # The installed MCP 1 release requires Pydantic 2.11; check before importing its models. | ||
| pytest.importorskip('pydantic', minversion='2.11') | ||
| if get_version(version('mcp')) >= get_version('2'): |
There was a problem hiding this comment.
P2: version('mcp') raises PackageNotFoundError when MCP is not installed, so this test errors during collection instead of skipping as before; catch that error and skip the module.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At tests/otel_integrations/test_mcp_version_detection.py, line 20:
<comment>`version('mcp')` raises `PackageNotFoundError` when MCP is not installed, so this test errors during collection instead of skipping as before; catch that error and skip the module.</comment>
<file context>
@@ -6,15 +6,22 @@
-pytest.importorskip('logfire._internal.integrations.mcp', exc_type=ImportError)
+# The installed MCP 1 release requires Pydantic 2.11; check before importing its models.
+pytest.importorskip('pydantic', minversion='2.11')
+if get_version(version('mcp')) >= get_version('2'):
+ pytest.skip('Requires MCP 1', allow_module_level=True)
+
</file context>
There was a problem hiding this comment.
(AI) MCP is required by the dev dependency group through pydantic-ai-slim[mcp]>=2, and every job collecting this module installs that group. A missing distribution is therefore a broken development environment and intentionally fails collection. Minimal-install jobs run separate smoke scripts rather than collecting integration tests. The explicit version checks cover the deliberately incompatible Pydantic/MCP matrix combinations without hiding unexpected environment or import failures.
Updates Anthropic to 1.11 and its HTTP dependencies. Handles omitted request parameters and the new buffer for streamed tool-call JSON, with regression coverage for both current and legacy streaming APIs.
Split from #2519. This PR targets main independently. The shared CI change makes PR compatibility runs use the PR's lockfile; scheduled and manual runs still upgrade all dependencies.
Validation: 27 Anthropic tests passed locally; formatting, lint, and typing passed. Regular CI and the full dependency compatibility matrix are enabled.