Skip to content

Commit 3c52184

Browse files
authored
Update dependencies, fix OpenAI tests (#423)
1 parent fae7737 commit 3c52184

File tree

5 files changed

+38
-29
lines changed

5 files changed

+38
-29
lines changed

logfire/_internal/auto_trace/import_hook.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from importlib.machinery import ModuleSpec
77
from importlib.util import spec_from_loader
88
from types import ModuleType
9-
from typing import TYPE_CHECKING, Callable, Iterator, Sequence
9+
from typing import TYPE_CHECKING, Callable, Iterator, Sequence, cast
1010

1111
from .rewrite_ast import exec_source
1212
from .types import AutoTraceModule
@@ -41,7 +41,7 @@ def find_spec(
4141
continue
4242

4343
try:
44-
source: str = get_source(fullname)
44+
source = cast(str, get_source(fullname))
4545
except Exception: # pragma: no cover
4646
continue
4747

logfire/integrations/pydantic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ def _build_wrapper(func: Callable[P, R], event_handlers: list[Any]) -> Callable[
453453
func = old_wrapped
454454
elif callable(handler): # no event handler methods found
455455
# Use the new API, especially _ValidateWrapper.__call__
456-
func = handler(func)
456+
func = handler(func) # type: ignore
457457

458458
return func
459459

requirements-dev.lock

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ eval-type-backport==0.2.0
9090
executing==2.1.0
9191
# via inline-snapshot
9292
# via logfire
93-
fastapi==0.112.3
94-
filelock==3.15.4
93+
fastapi==0.114.1
94+
filelock==3.16.0
9595
# via huggingface-hub
9696
# via virtualenv
9797
flask==3.0.3
@@ -114,7 +114,7 @@ httpcore==1.0.5
114114
httpx==0.27.2
115115
# via anthropic
116116
# via openai
117-
huggingface-hub==0.24.6
117+
huggingface-hub==0.24.7
118118
# via tokenizers
119119
identify==2.6.0
120120
# via pre-commit
@@ -128,7 +128,7 @@ importlib-metadata==8.4.0
128128
# via opentelemetry-instrumentation-flask
129129
iniconfig==2.0.0
130130
# via pytest
131-
inline-snapshot==0.12.1
131+
inline-snapshot==0.13.0
132132
itsdangerous==2.2.0
133133
# via flask
134134
jinja2==3.1.4
@@ -139,7 +139,7 @@ jinja2==3.1.4
139139
jiter==0.5.0
140140
# via anthropic
141141
# via openai
142-
kombu==5.4.0
142+
kombu==5.4.1
143143
# via celery
144144
loguru==0.7.2
145145
markdown==3.7
@@ -173,10 +173,10 @@ mkdocs-glightbox==0.4.0
173173
mkdocs-material==9.5.34
174174
mkdocs-material-extensions==1.3.1
175175
# via mkdocs-material
176-
mkdocstrings==0.26.0
176+
mkdocstrings==0.26.1
177177
# via mkdocstrings-python
178178
mkdocstrings-python==1.10.7
179-
multidict==6.0.5
179+
multidict==6.1.0
180180
# via aiohttp
181181
# via yarl
182182
mypy==1.11.2
@@ -190,7 +190,7 @@ nodeenv==1.9.1
190190
numpy==2.1.1
191191
# via pandas
192192
# via pyarrow
193-
openai==1.43.0
193+
openai==1.45.0
194194
opentelemetry-api==1.27.0
195195
# via opentelemetry-exporter-otlp-proto-http
196196
# via opentelemetry-instrumentation
@@ -312,7 +312,7 @@ pandas==2.2.2
312312
pathspec==0.12.1
313313
# via black
314314
# via mkdocs
315-
platformdirs==4.2.2
315+
platformdirs==4.3.2
316316
# via black
317317
# via mkdocs-get-deps
318318
# via mkdocstrings
@@ -333,12 +333,12 @@ psycopg-binary==3.2.1
333333
# via psycopg
334334
psycopg2-binary==2.9.9
335335
pyarrow==17.0.0
336-
pydantic @ git+https://github.com/pydantic/pydantic@447879b44ab8a9871193d6aef1b0846288929495
336+
pydantic @ git+https://github.com/pydantic/pydantic@a6dc87285f93f90c2d5c298ee7c52f5d7e878194
337337
# via anthropic
338338
# via fastapi
339339
# via openai
340340
# via sqlmodel
341-
pydantic-core==2.23.1
341+
pydantic-core==2.23.3
342342
# via pydantic
343343
pygments==2.18.0
344344
# via mkdocs-material
@@ -347,8 +347,8 @@ pymdown-extensions==10.9
347347
# via mkdocs-material
348348
# via mkdocstrings
349349
pymongo==4.8.0
350-
pyright==1.1.379
351-
pytest==8.3.2
350+
pyright==1.1.380
351+
pytest==8.3.3
352352
# via pytest-django
353353
# via pytest-pretty
354354
# via pytest-recording
@@ -359,7 +359,7 @@ python-dateutil==2.9.0.post0
359359
# via celery
360360
# via ghp-import
361361
# via pandas
362-
pytz==2024.1
362+
pytz==2024.2
363363
# via pandas
364364
pyyaml==6.0.2
365365
# via huggingface-hub
@@ -372,7 +372,7 @@ pyyaml==6.0.2
372372
pyyaml-env-tag==0.1
373373
# via mkdocs
374374
redis==5.0.8
375-
regex==2024.7.24
375+
regex==2024.9.11
376376
# via mkdocs-material
377377
requests==2.32.3
378378
# via docker
@@ -381,11 +381,11 @@ requests==2.32.3
381381
# via opentelemetry-exporter-otlp-proto-http
382382
# via requests-mock
383383
requests-mock==1.12.1
384-
rich==13.8.0
384+
rich==13.8.1
385385
# via inline-snapshot
386386
# via logfire
387387
# via pytest-pretty
388-
ruff==0.6.3
388+
ruff==0.6.4
389389
setuptools==74.1.2
390390
# via opentelemetry-instrumentation
391391
six==1.16.0
@@ -401,7 +401,7 @@ sqlalchemy==2.0.34
401401
sqlmodel==0.0.22
402402
sqlparse==0.5.1
403403
# via django
404-
starlette==0.38.4
404+
starlette==0.38.5
405405
# via fastapi
406406
structlog==24.4.0
407407
testcontainers==4.8.1
@@ -431,8 +431,7 @@ typing-extensions==4.12.2
431431
tzdata==2024.1
432432
# via celery
433433
# via pandas
434-
# via pydantic
435-
urllib3==2.2.2
434+
urllib3==2.2.3
436435
# via docker
437436
# via requests
438437
# via testcontainers
@@ -443,7 +442,7 @@ vine==5.1.0
443442
# via amqp
444443
# via celery
445444
# via kombu
446-
virtualenv==20.26.3
445+
virtualenv==20.26.4
447446
# via pre-commit
448447
watchdog==5.0.2
449448
# via mkdocs
@@ -460,7 +459,7 @@ wrapt==1.16.0
460459
# via opentelemetry-instrumentation-sqlalchemy
461460
# via testcontainers
462461
# via vcrpy
463-
yarl==1.9.11
462+
yarl==1.11.1
464463
# via aiohttp
465464
# via vcrpy
466465
zipp==3.20.1

requirements.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ pygments==2.18.0
5656
# via rich
5757
requests==2.32.3
5858
# via opentelemetry-exporter-otlp-proto-http
59-
rich==13.8.0
59+
rich==13.8.1
6060
# via logfire
6161
setuptools==74.1.2
6262
# via opentelemetry-instrumentation
6363
typing-extensions==4.12.2
6464
# via logfire
6565
# via opentelemetry-sdk
66-
urllib3==2.2.2
66+
urllib3==2.2.3
6767
# via requests
6868
wrapt==1.16.0
6969
# via deprecated

tests/otel_integrations/test_openai.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,12 @@ def test_sync_chat_completions(instrumented_client: openai.Client, exporter: Tes
286286
'function_call': None,
287287
'tool_calls': None,
288288
},
289-
'usage': {'completion_tokens': 1, 'prompt_tokens': 2, 'total_tokens': 3},
289+
'usage': {
290+
'completion_tokens': 1,
291+
'prompt_tokens': 2,
292+
'total_tokens': 3,
293+
'completion_tokens_details': None,
294+
},
290295
}
291296
),
292297
'logfire.json_schema': IsJson(
@@ -363,7 +368,12 @@ async def test_async_chat_completions(instrumented_async_client: openai.AsyncCli
363368
'function_call': None,
364369
'tool_calls': None,
365370
},
366-
'usage': {'completion_tokens': 1, 'prompt_tokens': 2, 'total_tokens': 3},
371+
'usage': {
372+
'completion_tokens': 1,
373+
'prompt_tokens': 2,
374+
'total_tokens': 3,
375+
'completion_tokens_details': None,
376+
},
367377
}
368378
),
369379
'logfire.json_schema': IsJson(

0 commit comments

Comments
 (0)