Skip to content

Commit b771dd5

Browse files
chore(langchain): disable pyright missing-import diagnostic in the optional test
LangChain is an optional integration and is not installed in the CI lint environment (`rye sync --all-features` does not pull it in), so pyright cannot resolve `langchain_core.*` imports in the test and fails with reportMissingImports. Disable that diagnostic for this test module; the runtime is already guarded by `pytest.importorskip("langchain_core")`. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 0a30374 commit b771dd5

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎tests/lib/integrations/test_langchain_callback.py‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@
1414
assistant message.
1515
"""
1616

17-
# The handler under test lives in ``src/openlayer/lib`` which is excluded from
18-
# pyright (see ``[tool.pyright] ignore`` in pyproject.toml), so its dynamic
19-
# LangChain-derived types surface here as ``Unknown`` under strict mode. Use
20-
# basic mode for this test, matching how the lib source itself is type-checked.
21-
# pyright: basic
17+
# The handler under test lives in ``src/openlayer/lib`` (excluded from pyright
18+
# via ``[tool.pyright] ignore``) and depends on LangChain, an OPTIONAL
19+
# integration that is not installed in the lint/type-check environment. So its
20+
# imports don't resolve there and its dynamic types surface as ``Unknown``. Use
21+
# basic mode and disable the missing-import diagnostic for this test module;
22+
# the runtime is guarded by ``pytest.importorskip`` below.
23+
# pyright: basic, reportMissingImports=false
2224

2325
from __future__ import annotations
2426

0 commit comments

Comments
 (0)