Skip to content

Commit e3b139d

Browse files
authored
Update dependencies, handle change in importlib (#323)
1 parent 02e511e commit e3b139d

File tree

7 files changed

+43
-43
lines changed

7 files changed

+43
-43
lines changed

logfire/_internal/cli.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,12 +388,14 @@ def parse_info(_args: argparse.Namespace) -> None:
388388
related_packages: list[tuple[int, str, str]] = []
389389

390390
for dist in importlib_metadata.distributions():
391-
name = dist.metadata['Name']
391+
metadata = dist.metadata
392+
name = metadata.get('Name', '')
393+
version = metadata.get('Version', 'UNKNOWN')
392394
index = package_names.get(name)
393395
if index is not None:
394-
related_packages.append((index, name, dist.version))
396+
related_packages.append((index, name, version))
395397
if name.startswith('opentelemetry'):
396-
related_packages.append((otel_index, name, dist.version))
398+
related_packages.append((otel_index, name, version))
397399

398400
toml_lines = (
399401
f'logfire="{VERSION}"',

logfire/_internal/collect_system_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def collect_package_info() -> dict[str, str]:
1515
distributions = list(metadata.distributions())
1616
try:
1717
metas = [dist.metadata for dist in distributions]
18-
pairs = [(meta['Name'], meta['Version']) for meta in metas]
18+
pairs = [(meta['Name'], meta.get('Version', 'UNKNOWN')) for meta in metas if meta.get('Name')]
1919
except Exception: # pragma: no cover
2020
# Just in case `dist.metadata['Name']` stops working but `dist.name` still works,
2121
# not that this is expected.

requirements-dev.lock

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
# features: []
77
# all-features: false
88
# with-sources: false
9+
# generate-hashes: false
910

1011
-e file:.
1112
aiohttp==3.9.5
1213
aiosignal==1.3.1
1314
# via aiohttp
1415
annotated-types==0.7.0
1516
# via pydantic
16-
anthropic==0.30.0
17+
anthropic==0.31.2
1718
anyio==4.3.0
1819
# via anthropic
1920
# via httpx
@@ -34,7 +35,7 @@ black==24.4.2
3435
# via inline-snapshot
3536
blinker==1.8.2
3637
# via flask
37-
certifi==2024.6.2
38+
certifi==2024.7.4
3839
# via httpcore
3940
# via httpx
4041
# via requests
@@ -54,7 +55,7 @@ cloudpickle==3.0.0
5455
colorama==0.4.6
5556
# via griffe
5657
# via mkdocs-material
57-
coverage==7.5.4
58+
coverage==7.6.0
5859
deprecated==1.2.14
5960
# via opentelemetry-api
6061
# via opentelemetry-exporter-otlp-proto-http
@@ -64,7 +65,7 @@ distlib==0.3.8
6465
distro==1.9.0
6566
# via anthropic
6667
# via openai
67-
django==5.0.6
68+
django==5.0.7
6869
dnspython==2.6.1
6970
# via email-validator
7071
# via pymongo
@@ -74,7 +75,7 @@ eval-type-backport==0.2.0
7475
executing==2.0.1
7576
# via inline-snapshot
7677
# via logfire
77-
fastapi==0.111.0
78+
fastapi==0.111.1
7879
fastapi-cli==0.0.4
7980
# via fastapi
8081
filelock==3.15.4
@@ -90,7 +91,7 @@ ghp-import==2.1.0
9091
# via mkdocs
9192
googleapis-common-protos==1.63.2
9293
# via opentelemetry-exporter-otlp-proto-http
93-
griffe==0.47.0
94+
griffe==0.48.0
9495
# via mkdocstrings-python
9596
h11==0.14.0
9697
# via httpcore
@@ -103,9 +104,9 @@ httpx==0.27.0
103104
# via anthropic
104105
# via fastapi
105106
# via openai
106-
huggingface-hub==0.23.4
107+
huggingface-hub==0.24.0
107108
# via tokenizers
108-
identify==2.5.36
109+
identify==2.6.0
109110
# via pre-commit
110111
idna==3.7
111112
# via anyio
@@ -118,7 +119,7 @@ importlib-metadata==7.1.0
118119
# via opentelemetry-instrumentation-flask
119120
iniconfig==2.0.0
120121
# via pytest
121-
inline-snapshot==0.10.2
122+
inline-snapshot==0.11.0
122123
itsdangerous==2.2.0
123124
# via flask
124125
jinja2==3.1.4
@@ -158,7 +159,7 @@ mkdocs-autorefs==1.0.1
158159
mkdocs-get-deps==0.2.0
159160
# via mkdocs
160161
mkdocs-glightbox==0.4.0
161-
mkdocs-material==9.5.27
162+
mkdocs-material==9.5.29
162163
mkdocs-material-extensions==1.3.1
163164
# via mkdocs-material
164165
mkdocstrings==0.25.1
@@ -167,7 +168,7 @@ mkdocstrings-python==1.10.5
167168
multidict==6.0.5
168169
# via aiohttp
169170
# via yarl
170-
mypy==1.10.0
171+
mypy==1.10.1
171172
mypy-extensions==1.0.0
172173
# via black
173174
# via mypy
@@ -176,7 +177,7 @@ nodeenv==1.9.1
176177
# via pyright
177178
numpy==2.0.0
178179
# via pandas
179-
openai==1.35.7
180+
openai==1.35.14
180181
opentelemetry-api==1.25.0
181182
# via opentelemetry-exporter-otlp-proto-http
182183
# via opentelemetry-instrumentation
@@ -277,8 +278,6 @@ opentelemetry-util-http==0.46b0
277278
# via opentelemetry-instrumentation-requests
278279
# via opentelemetry-instrumentation-starlette
279280
# via opentelemetry-instrumentation-wsgi
280-
orjson==3.10.5
281-
# via fastapi
282281
packaging==24.1
283282
# via black
284283
# via huggingface-hub
@@ -306,16 +305,16 @@ protobuf==4.25.3
306305
# via opentelemetry-proto
307306
psutil==5.9.8
308307
# via opentelemetry-instrumentation-system-metrics
309-
psycopg==3.1.19
310-
psycopg-binary==3.1.19
308+
psycopg==3.2.1
309+
psycopg-binary==3.2.1
311310
# via psycopg
312311
psycopg2-binary==2.9.9
313-
pydantic==2.7.4
312+
pydantic==2.8.2
314313
# via anthropic
315314
# via fastapi
316315
# via openai
317316
# via sqlmodel
318-
pydantic-core==2.18.4
317+
pydantic-core==2.20.1
319318
# via pydantic
320319
pygments==2.18.0
321320
# via mkdocs-material
@@ -324,7 +323,7 @@ pymdown-extensions==10.8.1
324323
# via mkdocs-material
325324
# via mkdocstrings
326325
pymongo==4.8.0
327-
pyright==1.1.369
326+
pyright==1.1.372
328327
pytest==8.2.2
329328
# via pytest-django
330329
# via pytest-pretty
@@ -364,8 +363,8 @@ rich==13.7.1
364363
# via logfire
365364
# via pytest-pretty
366365
# via typer
367-
ruff==0.5.0
368-
setuptools==70.1.1
366+
ruff==0.5.2
367+
setuptools==71.0.1
369368
# via opentelemetry-instrumentation
370369
shellingham==1.5.4
371370
# via typer
@@ -379,12 +378,12 @@ sniffio==1.3.1
379378
# via openai
380379
sqlalchemy==2.0.31
381380
# via sqlmodel
382-
sqlmodel==0.0.19
383-
sqlparse==0.5.0
381+
sqlmodel==0.0.20
382+
sqlparse==0.5.1
384383
# via django
385384
starlette==0.37.2
386385
# via fastapi
387-
structlog==24.2.0
386+
structlog==24.4.0
388387
tokenizers==0.19.1
389388
# via anthropic
390389
toml==0.10.2
@@ -411,8 +410,6 @@ typing-extensions==4.12.2
411410
# via typer
412411
tzdata==2024.1
413412
# via pandas
414-
ujson==5.10.0
415-
# via fastapi
416413
urllib3==2.2.2
417414
# via requests
418415
uvicorn==0.30.1

requirements.lock

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
# features: []
77
# all-features: false
88
# with-sources: false
9+
# generate-hashes: false
910

1011
-e file:.
11-
certifi==2024.6.2
12+
certifi==2024.7.4
1213
# via requests
1314
charset-normalizer==3.3.2
1415
# via requests
@@ -56,7 +57,7 @@ requests==2.32.3
5657
# via opentelemetry-exporter-otlp-proto-http
5758
rich==13.7.1
5859
# via logfire
59-
setuptools==70.1.1
60+
setuptools==71.0.1
6061
# via opentelemetry-instrumentation
6162
typing-extensions==4.12.2
6263
# via logfire

tests/otel_integrations/test_anthropic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from logfire._internal.integrations.llm_providers.anthropic import get_endpoint_config
2828
from logfire.testing import TestExporter
2929

30-
ANY_ADAPTER = pydantic.TypeAdapter(Any)
30+
ANY_ADAPTER = pydantic.TypeAdapter(Any) # type: ignore
3131

3232

3333
def request_handler(request: httpx.Request) -> httpx.Response:
@@ -74,7 +74,7 @@ def request_handler(request: httpx.Request) -> httpx.Response:
7474
),
7575
MessageStopEvent(type='message_stop'),
7676
]
77-
chunks_dicts = ANY_ADAPTER.dump_python(chunks)
77+
chunks_dicts = ANY_ADAPTER.dump_python(chunks) # type: ignore
7878
return httpx.Response(
7979
200, text=''.join(f'event: {chunk["type"]}\ndata: {json.dumps(chunk)}\n\n' for chunk in chunks_dicts)
8080
)

tests/otel_integrations/test_psycopg.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ def test_check_version():
2323

2424

2525
def test_instrument_psycopg():
26-
original_connect = psycopg.connect # type: ignore
26+
original_connect = psycopg.connect
2727

2828
instrument_psycopg(psycopg)
29-
assert original_connect is not psycopg.connect # type: ignore
29+
assert original_connect is not psycopg.connect
3030
PsycopgInstrumentor().uninstrument() # type: ignore
31-
assert original_connect is psycopg.connect # type: ignore
31+
assert original_connect is psycopg.connect
3232

3333
instrument_psycopg('psycopg')
34-
assert original_connect is not psycopg.connect # type: ignore
34+
assert original_connect is not psycopg.connect
3535
PsycopgInstrumentor().uninstrument() # type: ignore
36-
assert original_connect is psycopg.connect # type: ignore
36+
assert original_connect is psycopg.connect
3737

3838

3939
def test_instrument_psycopg2():
@@ -51,15 +51,15 @@ def test_instrument_psycopg2():
5151

5252

5353
def test_instrument_both():
54-
original_connect = psycopg.connect # type: ignore
54+
original_connect = psycopg.connect
5555
original_connect2 = psycopg2.connect
5656

5757
instrument_psycopg()
58-
assert original_connect is not psycopg.connect # type: ignore
58+
assert original_connect is not psycopg.connect
5959
assert original_connect2 is not psycopg2.connect
6060
PsycopgInstrumentor().uninstrument() # type: ignore
6161
Psycopg2Instrumentor().uninstrument() # type: ignore
62-
assert original_connect is psycopg.connect # type: ignore
62+
assert original_connect is psycopg.connect
6363
assert original_connect2 is psycopg2.connect
6464

6565

tests/test_pydantic_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ def double(v: Any) -> Any:
10551055
MyNumber = Annotated[int, AfterValidator(double)]
10561056

10571057
config = ConfigDict(plugin_settings={'logfire': {'record': 'all'}})
1058-
MyNumberAdapter = TypeAdapter(MyNumber, config=config)
1058+
MyNumberAdapter = TypeAdapter(MyNumber, config=config) # type: ignore
10591059

10601060
assert MyNumberAdapter.validate_python(3) == 6
10611061

0 commit comments

Comments
 (0)