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

No stubs generated for HA 2024.8 #481

Closed
bramstroker opened this issue Aug 9, 2024 · 6 comments · Fixed by #482
Closed

No stubs generated for HA 2024.8 #481

bramstroker opened this issue Aug 9, 2024 · 6 comments · Fixed by #482

Comments

@bramstroker
Copy link

Just wanted to inform you stub generation is broken for HA 2024.8 looking at the Github actions:
https://github.com/KapJI/homeassistant-stubs/actions

@bramstroker
Copy link
Author

At least by process of elimination I found out the problem is in recorder.py.

 ~/code/homeassistant-stubs   poetry run stubgen -o /Users/bram/code/homeassistant-stubs /Users/bram/code/homeassistant-stubs/homeassistant_core/homeassistant/components/recorder
Found existing alias for "poetry run". You should use: "prun"
Traceback (most recent call last):
  File "/Users/bram/Library/Caches/pypoetry/virtualenvs/homeassistant-stubs-EP1-hr2J-py3.12/bin/stubgen", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "mypy/stubgen.py", line 1869, in main
  File "mypy/stubgen.py", line 1677, in generate_stubs
  File "mypy/stubgen.py", line 1647, in generate_stub_for_py_module
  File "mypy/nodes.py", line 369, in accept
  File "mypy/stubgen.py", line 452, in visit_mypy_file
  File "mypy/traverser.py", line 115, in visit_mypy_file
  File "mypy/nodes.py", line 1142, in accept
  File "mypy/stubgen.py", line 718, in visit_class_def
  File "mypy/stubgen.py", line 793, in get_base_types
TypeError: str object expected; got None

@bramstroker
Copy link
Author

Problem is in migration.py

stubgen /Users/bram/code/ha-core/homeassistant/components/recorder/migration.py

Did git bisect and found this commit to be the culprit.

home-assistant/core@a22e12d

Not sure which line yet to have a minimal reproduction case.
I'm struggling to get stubgen running locally so I can put in print statement or activate debugger in IDE.

@bramstroker
Copy link
Author

Made a bug report:
python/mypy#17661

@bramstroker
Copy link
Author

Might be an idea to exclude recorder/migration.py for stubgeneration, so at least we get the package generation working again. What do you think?

@KapJI
Copy link
Owner

KapJI commented Aug 12, 2024

Thanks for creating issue for mypy! I didn't have time to debug it properly but now it seems they have a fix and I'll wait before it gets merged to patch mypy in CI here.

@bramstroker
Copy link
Author

Thanks. everything working for me again as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants