-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Crash Report
When running mypy on my application code using Poetry (version 1.3.2) I get INTERNAL ERROR every time. To run mypy, I use the following command: poetry run mypy app, where app is the folder containing my application code.
Traceback
/Users/kamil.wozniak/code/halina/.venv/lib/python3.11/site-packages/pydantic/env_settings.py:22: 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.4.0
Traceback (most recent call last):
File "mypy/semanal.py", line 6451, in accept
File "mypy/nodes.py", line 1139, in accept
File "mypy/semanal.py", line 1582, in visit_class_def
File "mypy/semanal.py", line 1667, in analyze_class
File "mypy/semanal.py", line 1694, in analyze_class_body_common
File "mypy/semanal.py", line 1777, in apply_class_plugin_hooks
File "pydantic/mypy.py", line 154, in pydantic.mypy.PydanticPlugin._pydantic_model_class_maker_callback
File "pydantic/mypy.py", line 321, in pydantic.mypy.PydanticModelTransformer.transform
File "pydantic/mypy.py", line 500, in pydantic.mypy.PydanticModelTransformer.add_construct_method
TypeError: __init__() missing required argument 'default' (pos 6)
/Users/kamil.wozniak/code/halina/.venv/lib/python3.11/site-packages/pydantic/env_settings.py:22: : note: use --pdb to drop into pdb
To Reproduce
I'm using Poetry (version 1.3.2) and mypy version (1.4). Moreover I'm using mypy's plugin for pydantic defined in pyproject.toml:
# pyproject.toml
[tool.mypy]
ignore_missing_imports = true
strict_optional = true
show_error_codes = true
plugins = ['pydantic.mypy']
The pydantic version I'm using is 1.10.7. To run mypy, I use the following command: poetry run mypy app, where app is the folder containing my application code.
Please note, that all works fine for mypy version 1.3 without any errors.
Your Environment
- Mypy version used: 1.4
- Mypy command-line flags:
- Mypy configuration options from
mypy.ini(and other config files):
# pyproject.toml
[tool.mypy]
ignore_missing_imports = true
strict_optional = true
show_error_codes = true
plugins = ['pydantic.mypy']- Python version used: 3.11.3
- Operating system and version: MacOS Ventura 13.0 M1