-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
Description
Crash Report
Mypy crashed when changing the import path of the parent class.
The crash happens on checking
class BaseLanguageModel(
RunnableSerializable[LanguageModelInput, LanguageModelOutputVar], ABC
)when changing the RunnableSerializable import from
from langchain_core.runnables import Runnable, RunnableSerializableto
from langchain_core.runnables.base import Runnable, RunnableSerializable./langchain_core/language_models/base.py:116: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 1.19.1
Traceback
Traceback (most recent call last):
File "mypy/semanal.py", line 7568, in accept
File "mypy/nodes.py", line 995, in accept
File "mypy/semanal.py", line 978, in visit_func_def
File "mypy/semanal.py", line 1023, in analyze_func_def
File "mypy/semanal.py", line 7214, in defer
AssertionError: Must not defer during final iterationTo Reproduce
See langchain-ai/langchain#34520
- clone the project
git clone https://github.com/cbornet/langchain.git- checkout PR branch
git checkout fix-tc- go to
coresub-project
cd core
- run mypy (using uv)
uv run --all-groups mypy . --show-traceback
Your Environment
- Mypy version used: 1.18.2, 1.19.1
- Mypy command-line flags:
- Mypy configuration options from
pyproject.toml:
plugins = ["pydantic.mypy"]
strict = true
enable_error_code = "deprecated"
disallow_any_generics = false- Python version used: 3.10, 3.11, 3.12, 3.13, 3.14
- Operating system and version: macOS 15.1, Ubuntu 24.04