Skip to content

Commit 0c02fbc

Browse files
fix: resolve all type checking issues
- Add type: ignore comments to tiktoken import in openai.py - Add type: ignore comments to handler imports in test files - Fix import resolution errors for dynamic path manipulation - All type checking now passes with 0 errors, 0 warnings Resolves pyright type checking issues: - tiktoken import error in src/contextforge_memory/summarize/openai.py - handlers.json_handler import error in tests/test_json_handler.py - handlers.toml_handler import error in tests/test_toml_handler.py
1 parent 8db5765 commit 0c02fbc

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/contextforge_memory/summarize/openai.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717

1818
# Optional tiktoken import for accurate token counting
1919
try:
20-
import tiktoken
20+
import tiktoken # type: ignore[import-untyped]
2121

2222
TIKTOKEN_AVAILABLE = True
2323
except ImportError:
24-
tiktoken = None
24+
tiktoken = None # type: ignore[assignment]
2525
TIKTOKEN_AVAILABLE = False
2626

2727

tests/test_json_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# Add the scripts directory to the path
1212
sys.path.insert(0, str(Path(__file__).parent.parent / "scripts"))
1313

14-
from handlers.json_handler import (
14+
from handlers.json_handler import ( # type: ignore[import-untyped]
1515
apply_json_suggestion,
1616
has_duplicate_keys,
1717
validate_json_suggestion,

tests/test_toml_handler.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
# Add the scripts directory to the path
1212
sys.path.insert(0, str(Path(__file__).parent.parent / "scripts"))
1313

14-
from handlers.toml_handler import apply_toml_suggestion, validate_toml_suggestion
14+
from handlers.toml_handler import ( # type: ignore[import-untyped]
15+
apply_toml_suggestion,
16+
validate_toml_suggestion,
17+
)
1518

1619

1720
def test_toml_suggestion_application():

0 commit comments

Comments
 (0)