Skip to content
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

VSCode: Daemon crashed! pydantic related #18258

Closed
jpedrick opened this issue Dec 6, 2024 · 2 comments
Closed

VSCode: Daemon crashed! pydantic related #18258

jpedrick opened this issue Dec 6, 2024 · 2 comments
Labels

Comments

@jpedrick
Copy link

jpedrick commented Dec 6, 2024

Crash Report

In VSCode mypy keeps crashing w/ project that uses pydantic

Traceback

/home/mambauser/venvs/nmf_graphs/lib/python3.10/site-packages/fastapi/openapi/models.py: 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.13.0
Daemon crashed!
Traceback (most recent call last):
  File "mypy/dmypy_server.py", line 236, in serve
  File "mypy/dmypy_server.py", line 285, in run_command
  File "mypy/dmypy_server.py", line 353, in cmd_run
  File "mypy/dmypy_server.py", line 427, in check
  File "mypy/dmypy_server.py", line 466, in initialize_fine_grained
  File "mypy/build.py", line 194, in build
  File "mypy/build.py", line 269, in _build
  File "mypy/build.py", line 2935, in dispatch
  File "mypy/build.py", line 3333, in process_graph
  File "mypy/build.py", line 3434, in process_stale_scc
  File "mypy/build.py", line 2304, in type_check_first_pass
  File "mypy/checker.py", line 483, in check_first_pass
  File "mypy/checker.py", line 594, in accept
  File "mypy/errors.py", line 1269, in report_internal_error
  File "mypy/checker.py", line 592, in accept
  File "mypy/nodes.py", line 1183, in accept
  File "mypy/checker.py", line 2420, in visit_class_def
  File "mypy/checker.py", line 594, in accept
  File "mypy/errors.py", line 1269, in report_internal_error
  File "mypy/checker.py", line 592, in accept
  File "mypy/nodes.py", line 1264, in accept
  File "mypy/checker.py", line 2886, in visit_block
  File "mypy/checker.py", line 594, in accept
  File "mypy/errors.py", line 1269, in report_internal_error
  File "mypy/checker.py", line 592, in accept
  File "mypy/nodes.py", line 1351, in accept
  File "mypy/checker.py", line 2934, in visit_assignment_stmt
  File "mypy/checker.py", line 3112, in check_assignment
  File "mypy/checker.py", line 4271, in check_simple_assignment
  File "mypy/checkexpr.py", line 5850, in accept
  File "mypy/errors.py", line 1269, in report_internal_error
  File "mypy/checkexpr.py", line 5848, in accept
  File "mypy/nodes.py", line 1969, in accept
  File "mypy/checkexpr.py", line 480, in visit_call_expr
  File "mypy/checkexpr.py", line 614, in visit_call_expr_inner
  File "mypy/checkexpr.py", line 1471, in check_call_expr_with_callee_type
  File "mypy/checkexpr.py", line 1576, in check_call
  File "mypy/checkexpr.py", line 2697, in check_overload_call
  File "mypy/checkexpr.py", line 2856, in infer_overload_return_type
  File "mypy/checkexpr.py", line 1565, in check_call
  File "mypy/checkexpr.py", line 1811, in check_callable_call
  File "mypy/checkexpr.py", line 1245, in apply_function_plugin
  File "/opt/conda/lib/python3.10/site-packages/pydantic/mypy.py", line 209, in _pydantic_field_callback
    assert ctx.callee_arg_names[0] == 'default', '"default" is no longer first argument in Field()'
AssertionError: "default" is no longer first argument in Field()

To Reproduce

Not sure. I think it may be due to conflicting versions of pydantic.

Your Environment

  • Mypy version used: 1.13.0
  • Mypy command-line flags:
  • Mypy configuration options from mypy.ini (and other config files): default
  • Python version used: python 3.10.15
  • Operating system and version: docker mambaorg/micromamba
@jpedrick jpedrick added the crash label Dec 6, 2024
@brianschubert
Copy link
Collaborator

I think it may be due to conflicting versions of pydantic.

What version of pydantic are you using? Can you check whether it supports mypy v1.13?

In any case, since the crash is occurring inside pydantic, this is likely an issue with pydantic and not mypy itself. If the version of pydantic you're using supports mypy v1.13, I'd recommend opening an issue on pydantic's tracker: https://github.com/pydantic/pydantic/issues.

@hauntsaninja
Copy link
Collaborator

Yeah, this is an issue with the pydantic plugin for mypy, so you should a) check whether it reproduces with latest pydantic and latest mypy, b) open on the pydantic issue tracker

@hauntsaninja hauntsaninja closed this as not planned Won't fix, can't repro, duplicate, stale Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants