Skip to content

Commit 12ccc6e

Browse files
authored
Update deps (#1431)
1 parent 6655a47 commit 12ccc6e

File tree

7 files changed

+296
-351
lines changed

7 files changed

+296
-351
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ all: format lint test
6767
cf-pages-build:
6868
curl -LsSf https://astral.sh/uv/0.4.30/install.sh | sh
6969
${HOME}/.cargo/bin/uv python install 3.12
70-
${HOME}/.cargo/bin/uv sync --python 3.12 --frozen --group docs
70+
${HOME}/.cargo/bin/uv sync --python 3.12 --frozen --group docs --no-install-package madoka
7171
${HOME}/.cargo/bin/uv pip install --upgrade --extra-index-url $(PPPR_URL) mkdocs-material mkdocstrings-python griffe==0.48.0
7272
${HOME}/.cargo/bin/uv run --no-sync mkdocs build

logfire/_internal/integrations/llm_providers/openai.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,7 @@ def get_response_data(self) -> Any:
125125

126126
class OpenaiChatCompletionStreamState(StreamState):
127127
def __init__(self):
128-
self._stream_state = ChatCompletionStreamState(
129-
# We do not need the response to be parsed into Python objects so can skip
130-
# providing the `response_format` and `input_tools` arguments.
131-
input_tools=openai.NOT_GIVEN,
132-
response_format=openai.NOT_GIVEN,
133-
)
128+
self._stream_state = ChatCompletionStreamState()
134129

135130
def record_chunk(self, chunk: ChatCompletionChunk) -> None:
136131
try:

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ dev = [
155155
"sqlmodel>=0.0.15",
156156
"mypy>=1.10.0",
157157
"celery>=5.4.0",
158-
"testcontainers!=4.13.0",
158+
# https://github.com/testcontainers/testcontainers-python/issues/874
159+
"testcontainers!=4.13.*",
159160
"mysql-connector-python~=8.0",
160161
"pyarrow>=17.0.0; python_version < '3.13'",
161162
"pyarrow>=18.1.0; python_version >= '3.13'",

tests/otel_integrations/test_openai_agents_mcp.py

Lines changed: 8 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
import pydantic
1111
import pytest
12-
from dirty_equals import IsStr
12+
from dirty_equals import IsPartialDict
13+
from inline_snapshot import snapshot
1314

1415
import logfire
1516
from logfire._internal.exporters.test import TestExporter
@@ -19,7 +20,6 @@
1920
try:
2021
from agents import Agent, Runner, trace
2122
from agents.mcp.server import _MCPServerWithClientSession # type: ignore
22-
from inline_snapshot import snapshot
2323
from mcp import types
2424
from mcp.server.fastmcp import Context, FastMCP
2525
from mcp.shared.memory import create_client_server_memory_streams
@@ -103,38 +103,15 @@ def name(self):
103103
'code.lineno': 123,
104104
'request': {
105105
'method': 'initialize',
106-
'params': {
107-
'meta': None,
108-
'protocolVersion': IsStr(),
109-
'capabilities': {
110-
'experimental': None,
111-
'sampling': None,
112-
'elicitation': None,
113-
'roots': None,
114-
},
115-
'clientInfo': {'name': 'mcp', 'title': None, 'version': '0.1.0'},
116-
},
106+
'params': IsPartialDict(),
117107
},
118108
'rpc.system': 'jsonrpc',
119109
'rpc.jsonrpc.version': '2.0',
120110
'rpc.method': 'initialize',
121111
'logfire.msg_template': 'MCP request: initialize',
122112
'logfire.msg': 'MCP request: initialize',
123113
'logfire.span_type': 'span',
124-
'response': {
125-
'meta': None,
126-
'protocolVersion': IsStr(),
127-
'capabilities': {
128-
'experimental': {},
129-
'logging': None,
130-
'prompts': {'listChanged': False},
131-
'resources': {'subscribe': False, 'listChanged': False},
132-
'tools': {'listChanged': False},
133-
'completions': None,
134-
},
135-
'serverInfo': {'name': 'FastMCP', 'title': None, 'version': IsStr()},
136-
'instructions': None,
137-
},
114+
'response': IsPartialDict(),
138115
},
139116
},
140117
{
@@ -162,22 +139,7 @@ def name(self):
162139
'response': {
163140
'meta': None,
164141
'nextCursor': None,
165-
'tools': [
166-
{
167-
'name': 'random_number',
168-
'title': None,
169-
'description': '',
170-
'inputSchema': {'properties': {}, 'title': 'random_numberArguments', 'type': 'object'},
171-
'outputSchema': {
172-
'properties': {'result': {'title': 'Result', 'type': 'integer'}},
173-
'required': ['result'],
174-
'title': 'random_numberOutput',
175-
'type': 'object',
176-
},
177-
'annotations': None,
178-
'meta': None,
179-
}
180-
],
142+
'tools': [IsPartialDict()],
181143
},
182144
},
183145
},
@@ -204,22 +166,7 @@ def name(self):
204166
'response': {
205167
'meta': None,
206168
'nextCursor': None,
207-
'tools': [
208-
{
209-
'name': 'random_number',
210-
'title': None,
211-
'description': '',
212-
'inputSchema': {'properties': {}, 'title': 'random_numberArguments', 'type': 'object'},
213-
'outputSchema': {
214-
'properties': {'result': {'title': 'Result', 'type': 'integer'}},
215-
'required': ['result'],
216-
'title': 'random_numberOutput',
217-
'type': 'object',
218-
},
219-
'annotations': None,
220-
'meta': None,
221-
}
222-
],
169+
'tools': [IsPartialDict()],
223170
},
224171
},
225172
},
@@ -401,22 +348,7 @@ def name(self):
401348
'response': {
402349
'meta': None,
403350
'nextCursor': None,
404-
'tools': [
405-
{
406-
'name': 'random_number',
407-
'title': None,
408-
'description': '',
409-
'inputSchema': {'properties': {}, 'title': 'random_numberArguments', 'type': 'object'},
410-
'outputSchema': {
411-
'properties': {'result': {'title': 'Result', 'type': 'integer'}},
412-
'required': ['result'],
413-
'title': 'random_numberOutput',
414-
'type': 'object',
415-
},
416-
'annotations': None,
417-
'meta': None,
418-
}
419-
],
351+
'tools': [IsPartialDict()],
420352
},
421353
},
422354
},
@@ -440,22 +372,7 @@ def name(self):
440372
'response': {
441373
'meta': None,
442374
'nextCursor': None,
443-
'tools': [
444-
{
445-
'name': 'random_number',
446-
'title': None,
447-
'description': '',
448-
'inputSchema': {'properties': {}, 'title': 'random_numberArguments', 'type': 'object'},
449-
'outputSchema': {
450-
'properties': {'result': {'title': 'Result', 'type': 'integer'}},
451-
'required': ['result'],
452-
'title': 'random_numberOutput',
453-
'type': 'object',
454-
},
455-
'annotations': None,
456-
'meta': None,
457-
}
458-
],
375+
'tools': [IsPartialDict()],
459376
},
460377
},
461378
},

tests/otel_integrations/test_pydantic_ai_mcp.py

Lines changed: 4 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,7 @@ async def client_streams(self):
125125
'response': {
126126
'meta': None,
127127
'nextCursor': None,
128-
'tools': [
129-
{
130-
'name': 'joker',
131-
'title': None,
132-
'description': 'Poem generator',
133-
'inputSchema': IsPartialDict(),
134-
'outputSchema': IsPartialDict(),
135-
'annotations': None,
136-
'meta': None,
137-
}
138-
],
128+
'tools': [IsPartialDict()],
139129
},
140130
},
141131
},
@@ -156,17 +146,7 @@ async def client_streams(self):
156146
'response': {
157147
'meta': None,
158148
'nextCursor': None,
159-
'tools': [
160-
{
161-
'name': 'joker',
162-
'title': None,
163-
'description': 'Poem generator',
164-
'inputSchema': IsPartialDict(),
165-
'outputSchema': IsPartialDict(),
166-
'annotations': None,
167-
'meta': None,
168-
}
169-
],
149+
'tools': [IsPartialDict()],
170150
},
171151
},
172152
},
@@ -598,17 +578,7 @@ async def client_streams(self):
598578
'response': {
599579
'meta': None,
600580
'nextCursor': None,
601-
'tools': [
602-
{
603-
'name': 'joker',
604-
'title': None,
605-
'description': 'Poem generator',
606-
'inputSchema': IsPartialDict(),
607-
'outputSchema': IsPartialDict(),
608-
'annotations': None,
609-
'meta': None,
610-
}
611-
],
581+
'tools': [IsPartialDict()],
612582
},
613583
},
614584
},
@@ -629,17 +599,7 @@ async def client_streams(self):
629599
'response': {
630600
'meta': None,
631601
'nextCursor': None,
632-
'tools': [
633-
{
634-
'name': 'joker',
635-
'title': None,
636-
'description': 'Poem generator',
637-
'inputSchema': IsPartialDict(),
638-
'outputSchema': IsPartialDict(),
639-
'annotations': None,
640-
'meta': None,
641-
}
642-
],
602+
'tools': [IsPartialDict()],
643603
},
644604
},
645605
},

tests/test_logfire_api.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import importlib
44
import sys
5+
import warnings
56
from pathlib import Path
67
from types import ModuleType
78
from typing import Callable
@@ -195,12 +196,14 @@ def func() -> None: ...
195196

196197
assert hasattr(logfire_api, 'instrument_litellm')
197198
if not pydantic_pre_2_5:
198-
try:
199-
importlib.import_module('litellm')
200-
except AttributeError: # pragma: no cover # TODO figure this out
201-
pass
202-
else:
203-
logfire_api.instrument_litellm()
199+
with warnings.catch_warnings():
200+
warnings.simplefilter('ignore', category=DeprecationWarning)
201+
try:
202+
importlib.import_module('litellm')
203+
except AttributeError: # pragma: no cover # TODO figure this out
204+
pass
205+
else:
206+
logfire_api.instrument_litellm()
204207
logfire__all__.remove('instrument_litellm')
205208

206209
for member in [m for m in logfire__all__ if m.startswith('instrument_')]:

0 commit comments

Comments
 (0)