Skip to content

Commit 820ed8d

Browse files
committed
chore: bump inline-snapshot version to 0.28.0
1 parent 478a348 commit 820ed8d

File tree

6 files changed

+33
-16
lines changed

6 files changed

+33
-16
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ dependencies = [
1616
"sniffio",
1717
"tqdm > 4",
1818
"jiter>=0.4.0, <1",
19+
"inline-snapshot>=0.28.0",
1920
]
2021
requires-python = ">= 3.8"
2122
classifiers = [

requirements-dev.lock

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ idna==3.4
9090
importlib-metadata==7.0.0
9191
iniconfig==2.0.0
9292
# via pytest
93-
inline-snapshot==0.27.0
93+
inline-snapshot==0.28.0
94+
# via openai
9495
jiter==0.5.0
9596
# via openai
9697
markdown-it-py==3.0.0

requirements.lock

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ annotated-types==0.6.0
2222
anyio==4.1.0
2323
# via httpx
2424
# via openai
25+
asttokens==3.0.0
26+
# via inline-snapshot
2527
async-timeout==5.0.1
2628
# via aiohttp
2729
attrs==25.3.0
@@ -35,6 +37,9 @@ distro==1.8.0
3537
# via openai
3638
exceptiongroup==1.2.2
3739
# via anyio
40+
# via pytest
41+
executing==2.2.0
42+
# via inline-snapshot
3843
frozenlist==1.7.0
3944
# via aiohttp
4045
# via aiosignal
@@ -51,19 +56,31 @@ idna==3.4
5156
# via anyio
5257
# via httpx
5358
# via yarl
59+
iniconfig==2.1.0
60+
# via pytest
61+
inline-snapshot==0.28.0
62+
# via openai
5463
jiter==0.6.1
5564
# via openai
65+
markdown-it-py==3.0.0
66+
# via rich
67+
mdurl==0.1.2
68+
# via markdown-it-py
5669
multidict==6.5.0
5770
# via aiohttp
5871
# via yarl
5972
numpy==2.0.2
6073
# via openai
6174
# via pandas
6275
# via pandas-stubs
76+
packaging==25.0
77+
# via pytest
6378
pandas==2.2.3
6479
# via openai
6580
pandas-stubs==2.2.2.240807
6681
# via openai
82+
pluggy==1.6.0
83+
# via pytest
6784
propcache==0.3.2
6885
# via aiohttp
6986
# via yarl
@@ -73,17 +90,27 @@ pydantic==2.10.3
7390
# via openai
7491
pydantic-core==2.27.1
7592
# via pydantic
93+
pygments==2.19.2
94+
# via pytest
95+
# via rich
96+
pytest==8.4.1
97+
# via inline-snapshot
7698
python-dateutil==2.9.0.post0
7799
# via pandas
78100
pytz==2024.1
79101
# via pandas
102+
rich==14.1.0
103+
# via inline-snapshot
80104
six==1.16.0
81105
# via python-dateutil
82106
sniffio==1.3.0
83107
# via anyio
84108
# via openai
85109
sounddevice==0.5.1
86110
# via openai
111+
tomli==2.2.1
112+
# via inline-snapshot
113+
# via pytest
87114
tqdm==4.66.5
88115
# via openai
89116
types-pytz==2024.2.0.20241003

tests/lib/chat/test_completions_streaming.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
external,
1414
snapshot,
1515
outsource, # pyright: ignore[reportUnknownVariableType]
16+
get_snapshot_value,
1617
)
1718

1819
import openai
@@ -30,7 +31,7 @@
3031
)
3132
from openai.lib._parsing._completions import ResponseFormatT
3233

33-
from ..utils import print_obj, get_snapshot_value
34+
from ..utils import print_obj
3435
from ...conftest import base_url
3536

3637
_T = TypeVar("_T")

tests/lib/snapshots.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77

88
import httpx
99
from respx import MockRouter
10+
from inline_snapshot import get_snapshot_value
1011

1112
from openai import OpenAI, AsyncOpenAI
1213

13-
from .utils import get_snapshot_value
14-
1514
_T = TypeVar("_T")
1615

1716

tests/lib/utils.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,3 @@ def get_caller_name(*, stacklevel: int = 1) -> str:
5252
def clear_locals(string: str, *, stacklevel: int) -> str:
5353
caller = get_caller_name(stacklevel=stacklevel + 1)
5454
return string.replace(f"{caller}.<locals>.", "")
55-
56-
57-
def get_snapshot_value(snapshot: Any) -> Any:
58-
if not hasattr(snapshot, "_old_value"):
59-
return snapshot
60-
61-
old = snapshot._old_value
62-
if not hasattr(old, "value"):
63-
return old
64-
65-
loader = getattr(old.value, "_load_value", None)
66-
return loader() if loader else old.value

0 commit comments

Comments
 (0)