-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mypy plugin crashes with explicit_package_bases
set as true
#5191
Comments
See #5192 |
@marcelopgc I'm looking at this now — do you have example code you can share that causes this issue when you run mypy on it? At the very least I will make it produce an error that we can debug as opposed to crashing mypy, but if I can reproduce the issue I should be able to resolve it. |
@marcelopgc if you can't easily share code that I could use to reproduce the failure — if you checkout the branch in the pull request #5208 and install it locally ( |
@dmontagu here it is the link to the code that we were able to reproduce this error: https://github.com/marcelopgc/pydantic1.10.6_debug |
@marcelopgc thank you — I was able to figure out what was going on by analyzing that codebase. Turns out the circular imports were causing something called a PlaceholderNode to be produced which I hadn't seen before. #5208 should resolve this issue for you. |
The fix for this will be released in 1.10.7 today. |
Initial Checks
Description
After updating mypy to v1.1.1, I added the following
pyproject.toml
config, as descripted in the documentation, to prevent mypy errors on classes with Optional attributes:Using that config, I found an internal error while running mypy
If remove the
explicit_package_bases
configuration, mypy is able to run without this setting.mypy version:
Example Code
No response
Python, Pydantic & OS Version
Affected Components
.dict()
and.json()
construct()
, pickling, private attributes, ORM modeThe text was updated successfully, but these errors were encountered: