home-assistant / developers.home-assistant

Developers website for Home Assistant.
https://developers.home-assistant.io
Other
314 stars 965 forks source link

Building integrations - command fails without first installing requirements #2430

Open chelming opened 1 month ago

chelming commented 1 month ago

When following the Building Integrations guide in VSC dev container, when running python3 -m script.scaffold integration and following the prompt, script.hassfest will run following the completion. If you don't first install the requirements, script.hassfest will fail with script.hassfest ModuleNotFoundError: No module named 'numpy'

I'm guessing there should be instructions for running pip install -r requirements_all.txt (or one of the other requirements files. I'm not familiar enough to say which is appropriate.

https://github.com/home-assistant/developers.home-assistant/blob/6d6ec9d7348c22456dcea804ddc4b777506c3089/docs/creating_component_index.md?plain=1#L5-L9

allenporter commented 4 weeks ago

My impression is that this is handled if you follow the steps in *Development Workflow > Set up development environment

allenporter commented 4 weeks ago

You mentioned using the devcontainer... so if the devcontainer is not properly being setup right then i think any fixes need to be part of the devcontainer setup to handles this up front? or updating the devcontainer docmentation under "Set up development environment" and not specific to the building integration step

chelming commented 4 weeks ago

Good call! I didn't think of the other build types and that it might happen in one of the other build setups. Instead of a docs issue is this potentially a core/dev container issue?

allenporter commented 4 weeks ago

Perhaps? My assumption is that the devcontainer should be doing this but this is not something i am an expert in.