Skip to content

MyPy plugin doesn't work with MyPy 0.750 #1057

@rafalp

Description

@rafalp

Bug

Please complete:

  • OS: Debian Linux & MacOS
  • Python version import sys; print(sys.version): 3.8
  • Pydantic version import pydantic; print(pydantic.VERSION): 1.1, 1.2

MyPy 0.750 has just been released and it looks like it has changed plugin system, causing plugin to error:

mypy misago --ignore-missing-imports --show-traceback
/Users/rafalpiton/github/misago-starlette/venv/lib/python3.8/site-packages/mypy/typeshed/stdlib/3/typing.pyi:146: error: INTERNAL ERROR -- Please try using mypy master on Github:
https://mypy.rtfd.io/en/latest/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 0.750
Traceback (most recent call last):
  File "mypy/semanal.py", line 4656, in accept
  File "mypy/nodes.py", line 939, in accept
  File "mypy/semanal.py", line 1029, in visit_class_def
  File "mypy/semanal.py", line 1106, in analyze_class
  File "mypy/semanal.py", line 1115, in analyze_class_body_common
  File "mypy/semanal.py", line 1173, in apply_class_plugin_hooks
  File "mypy/plugin.py", line 818, in get_base_class_hook
  File "mypy/plugin.py", line 830, in _find_hook
  File "mypy/plugin.py", line 818, in <lambda>
  File "mypy/plugin.py", line 743, in get_base_class_hook
  File "/Users/rafalpiton/github/misago-starlette/venv/lib/python3.8/site-packages/pydantic/mypy.py", line 79, in get_base_class_hook
    if any(base.fullname() == BASEMODEL_FULLNAME for base in sym.node.mro):
  File "/Users/rafalpiton/github/misago-starlette/venv/lib/python3.8/site-packages/pydantic/mypy.py", line 79, in <genexpr>
    if any(base.fullname() == BASEMODEL_FULLNAME for base in sym.node.mro):
TypeError: 'str' object is not callable
/Users/rafalpiton/github/misago-starlette/venv/lib/python3.8/site-packages/mypy/typeshed/stdlib/3/typing.pyi:146: : note: use --pdb to drop into pdb```

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug V1Bug related to Pydantic V1.X

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions