You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running stubgen on home assistant codebase on the latest master, it crashes with the following error.
Traceback
Traceback (most recent call last):
File ".venv/bin/stubgen", line 10, in <module>
sys.exit(main())
~~~~^^
File ".venv/lib/python3.13/site-packages/mypy/stubgen.py", line 1984, in main
generate_stubs(options)
~~~~~~~~~~~~~~^^^^^^^^^
File ".venv/lib/python3.13/site-packages/mypy/stubgen.py", line 1787, in generate_stubs
generate_stub_for_py_module(
~~~~~~~~~~~~~~~~~~~~~~~~~~~^
mod,
^^^^
...<7 lines>...
all_modules=all_module_names,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File ".venv/lib/python3.13/site-packages/mypy/stubgen.py", line 1757, in generate_stub_for_py_module
mod.ast.accept(gen)
~~~~~~~~~~~~~~^^^^^
File ".venv/lib/python3.13/site-packages/mypy/nodes.py", line 361, in accept
return visitor.visit_mypy_file(self)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File ".venv/lib/python3.13/site-packages/mypy/stubgen.py", line 504, in visit_mypy_file
super().visit_mypy_file(o)
~~~~~~~~~~~~~~~~~~~~~~~^^^
File ".venv/lib/python3.13/site-packages/mypy/traverser.py", line 119, in visit_mypy_file
d.accept(self)
~~~~~~~~^^^^^^
File ".venv/lib/python3.13/site-packages/mypy/nodes.py", line 1200, in accept
return visitor.visit_class_def(self)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File ".venv/lib/python3.13/site-packages/mypy/stubgen.py", line 811, in visit_class_def
super().visit_class_def(o)
~~~~~~~~~~~~~~~~~~~~~~~^^^
File ".venv/lib/python3.13/site-packages/mypy/traverser.py", line 155, in visit_class_def
o.defs.accept(self)
~~~~~~~~~~~~~^^^^^^
File ".venv/lib/python3.13/site-packages/mypy/nodes.py", line 1281, in accept
return visitor.visit_block(self)
~~~~~~~~~~~~~~~~~~~^^^^^^
File ".venv/lib/python3.13/site-packages/mypy/stubgen.py", line 906, in visit_block
super().visit_block(o)
~~~~~~~~~~~~~~~~~~~^^^
File ".venv/lib/python3.13/site-packages/mypy/traverser.py", line 123, in visit_block
s.accept(self)
~~~~~~~~^^^^^^
File ".venv/lib/python3.13/site-packages/mypy/nodes.py", line 1368, in accept
return visitor.visit_assignment_stmt(self)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File ".venv/lib/python3.13/site-packages/mypy/stubgen.py", line 943, in visit_assignment_stmt
init = self.get_init(item.name, o.rvalue, annotation)
File ".venv/lib/python3.13/site-packages/mypy/stubgen.py", line 1254, in get_init
initializer = self.get_assign_initializer(rvalue)
File ".venv/lib/python3.13/site-packages/mypy/stubgen.py", line 1275, in get_assign_initializer
return f" = {rvalue.accept(p)}"
~~~~~~~~~~~~~^^^
File ".venv/lib/python3.13/site-packages/mypy/nodes.py", line 1990, in accept
return visitor.visit_call_expr(self)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File ".venv/lib/python3.13/site-packages/mypy/stubgen.py", line 296, in visit_call_expr
args.append(f"{name}={arg.accept(self)}")
~~~~~~~~~~^^^^^^
File ".venv/lib/python3.13/site-packages/mypy/nodes.py", line 2071, in accept
return visitor.visit_unary_expr(self)
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File ".venv/lib/python3.13/site-packages/mypy/visitor.py", line 527, in visit_unary_expr
raise NotImplementedError()
NotImplementedError
This is just a simple visitor method missing, will fix today. There are other missing methods (dicts/lists/tuples are handled, while sets are not, for example), let's try to add a few more.
Crash Report
When running stubgen on home assistant codebase on the latest master, it crashes with the following error.
Traceback
To Reproduce
Your Environment
67b70ce00ee9f2da1c49e75a044aad7ab7c137ff
stubgen test.py
mypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: