Skip to content

Commit 019c4d6

Browse files
committed
fix: add pyright ignores for deprecated imports and unknown types
1 parent 8fadecb commit 019c4d6

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/replicate/_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,9 @@ def stream(
348348
Returns:
349349
An iterator that yields output strings as they are generated by the model
350350
"""
351-
from .lib._stream import stream as _stream
351+
from .lib._stream import stream as _stream # pyright: ignore[reportDeprecated]
352352

353-
return _stream(type(self), ref, input=input) # type: ignore[return-value, arg-type] # pyright: ignore[reportDeprecated, reportGeneralTypeIssues]
353+
return _stream(type(self), ref, input=input) # type: ignore[return-value, arg-type]
354354

355355
def copy(
356356
self,
@@ -755,9 +755,9 @@ async def stream(
755755
Returns:
756756
An async iterator that yields output strings as they are generated by the model
757757
"""
758-
from .lib._stream import stream as _stream
758+
from .lib._stream import stream as _stream # pyright: ignore[reportDeprecated]
759759

760-
return _stream(type(self), ref, input=input) # type: ignore[return-value, arg-type] # pyright: ignore[reportDeprecated, reportGeneralTypeIssues]
760+
return _stream(type(self), ref, input=input) # type: ignore[return-value, arg-type]
761761

762762
def copy(
763763
self,

tests/lib/test_stream.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ def test_stream_works_same_as_use_with_streaming():
126126
mock_function.return_value = iter(expected_output.copy())
127127

128128
# Get output from use() with streaming=True
129-
model = client.use("test-model", streaming=True)
130-
use_output = list(model(prompt="test"))
129+
model = client.use("test-model", streaming=True) # pyright: ignore[reportUnknownVariableType]
130+
use_output = list(model(prompt="test")) # pyright: ignore[reportUnknownVariableType, reportUnknownArgumentType]
131131

132132
# Verify they produce the same output
133133
assert stream_output == use_output
@@ -183,7 +183,7 @@ async def async_gen():
183183
"anthropic/claude-4.5-sonnet",
184184
input={"prompt": "Hello"},
185185
):
186-
result.append(item)
186+
result.append(item) # pyright: ignore[reportUnknownMemberType]
187187

188188
# Check that deprecation warnings were raised
189189
assert len(w) > 0

0 commit comments

Comments
 (0)