Skip to content

Commit edda763

Browse files
committed
restore previous changes to mypy exclusions and fix mypy errors in example scripts
1 parent c297503 commit edda763

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ lint:
1717

1818
.PHONY: mypy
1919
mypy:
20-
uv run mypy .
20+
uv run mypy . --exclude site
2121

2222
.PHONY: tests
2323
tests:

examples/memory/advanced_sqlite_session_example.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ async def main():
132132
# Show current conversation
133133
print("Current conversation:")
134134
current_items = await session.get_items()
135-
for i, item in enumerate(current_items, 1):
135+
for i, item in enumerate(current_items, 1): # type: ignore[assignment]
136136
role = str(item.get("role", item.get("type", "unknown")))
137137
if item.get("type") == "function_call":
138138
content = f"{item.get('name', 'unknown')}({item.get('arguments', '{}')})"
@@ -151,8 +151,8 @@ async def main():
151151
# Show available turns for branching
152152
print("\nAvailable turns for branching:")
153153
turns = await session.get_conversation_turns()
154-
for turn in turns:
155-
print(f" Turn {turn['turn']}: {turn['content']}")
154+
for turn in turns: # type: ignore[assignment]
155+
print(f" Turn {turn['turn']}: {turn['content']}") # type: ignore[index]
156156

157157
# Create a branch from turn 2
158158
print("\nCreating new branch from turn 2...")
@@ -163,7 +163,7 @@ async def main():
163163
branch_items = await session.get_items()
164164
print(f"Items copied to new branch: {len(branch_items)}")
165165
print("New branch contains:")
166-
for i, item in enumerate(branch_items, 1):
166+
for i, item in enumerate(branch_items, 1): # type: ignore[assignment]
167167
role = str(item.get("role", item.get("type", "unknown")))
168168
if item.get("type") == "function_call":
169169
content = f"{item.get('name', 'unknown')}({item.get('arguments', '{}')})"
@@ -198,7 +198,7 @@ async def main():
198198
print("\n=== New Conversation Branch ===")
199199
new_conversation = await session.get_items()
200200
print("New conversation with branch:")
201-
for i, item in enumerate(new_conversation, 1):
201+
for i, item in enumerate(new_conversation, 1): # type: ignore[assignment]
202202
role = str(item.get("role", item.get("type", "unknown")))
203203
if item.get("type") == "function_call":
204204
content = f"{item.get('name', 'unknown')}({item.get('arguments', '{}')})"
@@ -224,8 +224,8 @@ async def main():
224224
# Show conversation turns in current branch
225225
print("\nConversation turns in current branch:")
226226
current_turns = await session.get_conversation_turns()
227-
for turn in current_turns:
228-
print(f" Turn {turn['turn']}: {turn['content']}")
227+
for turn in current_turns: # type: ignore[assignment]
228+
print(f" Turn {turn['turn']}: {turn['content']}") # type: ignore[index]
229229

230230
print("\n=== Branch Switching Demo ===")
231231
print("We can switch back to the main branch...")

examples/memory/dapr_session_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,8 @@ async def demonstrate_multi_store():
417417
r_items = await redis_session.get_items()
418418
p_items = await pg_session.get_items()
419419

420-
r_example = r_items[-1]["content"] if r_items else "empty"
421-
p_example = p_items[-1]["content"] if p_items else "empty"
420+
r_example = r_items[-1]["content"] if r_items else "empty" # type: ignore[typeddict-item]
421+
p_example = p_items[-1]["content"] if p_items else "empty" # type: ignore[typeddict-item]
422422

423423
print(f"{redis_store}: {len(r_items)} items; example: {r_example}")
424424
print(f"{pg_store}: {len(p_items)} items; example: {p_example}")

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ strict = true
117117
disallow_incomplete_defs = false
118118
disallow_untyped_defs = false
119119
disallow_untyped_calls = false
120-
exclude = ["examples/", "site/"]
121120

122121
[[tool.mypy.overrides]]
123122
module = "sounddevice.*"

0 commit comments

Comments
 (0)