Giter Club home page Giter Club logo

Comments (24)

home-assistant avatar home-assistant commented on June 25, 2024

Hey there @hunterjm, @uvjustin, @allenporter, mind taking a look at this issue as it has been labeled with an integration (stream) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of stream can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign stream Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


stream documentation
stream source
(message by IssueLinks)

from core.

allenporter avatar allenporter commented on June 25, 2024

Not sure I agree. This is attempting to load stream as camera depends on stream.

from core.

pascallj avatar pascallj commented on June 25, 2024

What part don't you agree with? You are correct it tries to load stream via camera, but because the stream integration is in default_config, which is not loaded, the dependencies from Stream aren't installed.

from core.

allenporter avatar allenporter commented on June 25, 2024

I don't think there is well defined behavior when default config is disabled. You are loading a camera so you need to load stream. I suggest just enabling stream.

from core.

allenporter avatar allenporter commented on June 25, 2024

I don't think there is well defined behavior when default config is disabled. You are loading a camera so you need to load stream. I suggest just enabling stream.

from core.

pascallj avatar pascallj commented on June 25, 2024

Ah alright, might be. I was under the impression that now that some core components have been moved into bootstrap (#105560), default_config can be safely omitted.

from core.

allenporter avatar allenporter commented on June 25, 2024

Ah alright, might be. I was under the impression that now that some core components have been moved into bootstrap (#105560), default_config can be safely omitted.

I think stream may be in the "has impact" category given the heavy dependencies on things like pyav and ffmpeg.

from core.

pascallj avatar pascallj commented on June 25, 2024

Which is exactly why I don't want it in my configuration if I don't have a need for it 😉

from core.

allenporter avatar allenporter commented on June 25, 2024

so camera is loaded, but you don't have a camera? (Therefore stream, etc...). I misunderstood and thought you were loading a camera. I see in the stack trace there is a selector that includes CameraEntityFeature which is pulling it in, so makes sense if this is unintentional and something we can look at.

from core.

allenporter avatar allenporter commented on June 25, 2024

so camera is loaded, but you don't have a camera? (Therefore stream, etc...). I misunderstood and thought you were loading a camera. I see in the stack trace there is a selector that includes CameraEntityFeature which is pulling it in, so makes sense if this is unintentional and something we can look at.

from core.

allenporter avatar allenporter commented on June 25, 2024

so camera is loaded, but you don't have a camera? (Therefore stream, etc...). I misunderstood and thought you were loading a camera. I see in the stack trace there is a selector that includes CameraEntityFeature which is pulling it in, so makes sense if this is unintentional and something we can look at.

from core.

pascallj avatar pascallj commented on June 25, 2024

Correct! Maybe I should have mentioned that more clearly. This is just with an empty configuration out of the box. So nothing else besides the core components inside bootstrap. That's why I initially didn't tag the stream integration, as I didn't think it was the cause.

I tried to figure out why it was loading camera, but this was far beyond my understanding of the home assistant architecture.

from core.

allenporter avatar allenporter commented on June 25, 2024

Coincidentally, I just got the same error doing the following steps:

  1. rebuild devcontainer from head
  2. run pre-commit
$ pre-commit
[INFO] Initializing environment for https://github.com/astral-sh/ruff-pre-commit.
[INFO] Initializing environment for https://github.com/codespell-project/codespell.
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/adrienverge/yamllint.git.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier:[email protected].
[INFO] Initializing environment for https://github.com/cdce8p/python-typing-update.
[INFO] Installing environment for https://github.com/astral-sh/ruff-pre-commit.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/codespell-project/codespell.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/adrienverge/yamllint.git.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/mirrors-prettier.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
ruff.................................................(no files to check)Skipped
ruff-format..........................................(no files to check)Skipped
codespell............................................(no files to check)Skipped
check json...............................................................Passed
don't commit to branch...................................................Passed
yamllint.............................................(no files to check)Skipped
prettier.................................................................Passed
mypy.................................................(no files to check)Skipped
pylint...............................................(no files to check)Skipped
gen_requirements_all.....................................................Failed
- hook id: gen_requirements_all
- files were modified by this hook

Warning: homeassistant/components/facebox/__init__.py and manifest.json missing, skipping directory. If this is your development environment, you can safely delete this folder.

hassfest.................................................................Failed
- hook id: hassfest
- exit code: 1

Warning: homeassistant/components/facebox/__init__.py and manifest.json missing, skipping directory. If this is your development environment, you can safely delete this folder.
Validating application_credentials... done in 0.03s
Validating bluetooth... done in 0.01s
Validating codeowners... done in 0.03s
Validating config_schema... done in 3.47s
Validating dependencies... done in 11.08s
Validating dhcp... done in 0.01s
Validating icons... done in 0.67s
Validating json... done in 0.00s
Validating manifest... done in 0.06s
Validating mqtt... done in 0.01s
Validating requirements... done in 0.01s
Validating services...Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/workspaces/home-assistant-core/script/hassfest/__main__.py", line 250, in <module>
    sys.exit(main())
             ^^^^^^
  File "/workspaces/home-assistant-core/script/hassfest/__main__.py", line 172, in main
    plugin.validate(integrations, config)
  File "/workspaces/home-assistant-core/script/hassfest/services.py", line 238, in validate
    validate_services(config, integration)
  File "/workspaces/home-assistant-core/script/hassfest/services.py", line 133, in validate_services
    services = CORE_INTEGRATION_SERVICES_SCHEMA(data)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict
    return base_validate(path, iteritems(data), out)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 387, in validate_mapping
    cval = cvalue(key_path, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 229, in _run
    return self._exec(self._compiled, value, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 274, in _exec
    return func(path, v)
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
    return schema(data)
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict
    return base_validate(path, iteritems(data), out)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 387, in validate_mapping
    cval = cvalue(key_path, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 229, in _run
    return self._exec(self._compiled, value, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 274, in _exec
    return func(path, v)
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
    return schema(data)
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict
    return base_validate(path, iteritems(data), out)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 387, in validate_mapping
    cval = cvalue(key_path, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 229, in _run
    return self._exec(self._compiled, value, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 353, in _exec
    v = func(path, v)
        ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 636, in validate_sequence
    cval = validate(index_path, value)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
    return schema(data)
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict
    return base_validate(path, iteritems(data), out)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 387, in validate_mapping
    cval = cvalue(key_path, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 636, in validate_sequence
    cval = validate(index_path, value)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 229, in _run
    return self._exec(self._compiled, value, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 353, in _exec
    v = func(path, v)
        ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
    return schema(data)
           ^^^^^^^^^^^^
  File "/workspaces/home-assistant-core/homeassistant/helpers/selector.py", line 161, in _validate_supported_features
    feature_mask |= _validate_supported_feature(supported_feature)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/home-assistant-core/homeassistant/helpers/selector.py", line 136, in _validate_supported_feature
    known_entity_features = _entity_features()
                            ^^^^^^^^^^^^^^^^^^
  File "/workspaces/home-assistant-core/homeassistant/helpers/selector.py", line 92, in _entity_features
    from homeassistant.components.camera import CameraEntityFeature
  File "/workspaces/home-assistant-core/homeassistant/components/camera/__init__.py", line 31, in <module>
    from homeassistant.components.stream import (
  File "/workspaces/home-assistant-core/homeassistant/components/stream/__init__.py", line 64, in <module>
    from .core import (
  File "/workspaces/home-assistant-core/homeassistant/components/stream/core.py", line 15, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

hassfest-metadata....................................(no files to check)Skipped
hassfest-mypy-config.................................(no files to check)Skipped

from core.

joostlek avatar joostlek commented on June 25, 2024

There were some attempts to add this to the general dependencies, but they all got declined but i never saw the reason why they got declined

from core.

allenporter avatar allenporter commented on June 25, 2024

History:
#81790 - Attempted to import numpy late to work around this binding. Not a good solution due to added complexity and unpredictability
#81841 - Declares numpy as a requirement for stream
#102215 - pre-commit error: claims it only happens when environment is not setup properly
#108070 - on pre-commit error: "before the dev environment works completely, you need to start hass -c config once and the default_config entry has to be in the configuration.yaml, so that all dependencies get set up."

Generally, i don't think we try super hard to support non-default config, but it seems like given some things were moved to bootstrap and some where not that it still seems like something we're trying to keep working.

I think its fine to say default_config: is needed for local development.

It seems less clear what the solution is for non-dev environment given the selectors imports the camera entity which imports stream. We definitely don't want to add hacks for this, so it may need to stay as the status quo

from core.

RogerSelwyn avatar RogerSelwyn commented on June 25, 2024

I certainly get this in my dev config. And I'm actually trying to sort a different issue in dev and got the same error with a new build of HA

from core.

Lucas-lyh avatar Lucas-lyh commented on June 25, 2024

I get same traceback when building dev container.

from core.

allenporter avatar allenporter commented on June 25, 2024

When building yourself in dev I recommend creating a config with default_config:

from core.

RogerSelwyn avatar RogerSelwyn commented on June 25, 2024

When building yourself in dev I recommend creating a config with default_config:

I think it happens when I add the mqtt integration. But yes I should include default_config, but I try to minimise what I load to reduce rebuild time.

from core.

cetex avatar cetex commented on June 25, 2024

I guess modularity is a goal and then the solution should be to restore modularity by disconnecting things and making dependencies optional, not adding more. :)

Maybe one of these two alternatives?

  1. Only return entities for actually-loaded-components in selector.py
  2. Make CameraEntityFeature importable without pulling in the rest of the component (camera.py).

from core.

allenporter avatar allenporter commented on June 25, 2024

The selector logic is validating features and is pre-loading a map. Maybe that map does not need to exist and the feature enums can be imported only as needed.

from core.

cetex avatar cetex commented on June 25, 2024

I modified those functions and made them "forgiving" by wrapping them in try / except statements:
homeassistant/helpers/selector.py:84 def _entity_features()
homeassistant/helpers/service.py:77 def _base_components()

I've been running it for two weeks and it works. Instead of failing, it just logs an exception and moves on without it. I've planned to make a proper PR but haven't gotten around to it yet.

The reason behind all this is that the node I'm running HA on is a relatively low-powered arm device. Compiling numpy, OpenCV etc takes a significant amount of time and HA is our main interface to manage our light-automation (24 shellys), heating+hot-water+ventilation (nibe), air conditioning (toshiba) and soon monitoring / managing solar + car-charger. Anything automatic which might break the functionality is unacceptable because there's no guarantee that I'm around or have time to spare to fix things when it breaks (and it has broken from time to time, not a great experience).

Maybe it would be best if the logic for these functions was 'flipped around'?
Instead of hard-coding dependencies and importing each component providing a dependency it could be changed so the component which provide a certain entity_feature would just register the feature to some registry when it's loaded.

from core.

caraar12345 avatar caraar12345 commented on June 25, 2024

FWIW - numpy really should be a dependency being as the scaffold script to create a new integration requires it, so the dev container doesn't work to create a new integration without installing numpy.

Scaffolding integration for the youtube_lounge integration...
Writing tests/components/youtube_lounge/__init__.py
Writing homeassistant/components/youtube_lounge/const.py
Writing homeassistant/components/youtube_lounge/__init__.py
Writing homeassistant/components/youtube_lounge/manifest.json
Updating youtube_lounge manifest: {'codeowners': ['@caraar12345'], 'iot_class': 'cloud_polling', 'requirements': ['pyytlounge==2.0.0']}

Scaffolding config_flow for the youtube_lounge integration...
Writing homeassistant/components/youtube_lounge/const.py
Writing homeassistant/components/youtube_lounge/__init__.py
Writing homeassistant/components/youtube_lounge/config_flow.py
Writing tests/components/youtube_lounge/test_config_flow.py
Writing tests/components/youtube_lounge/conftest.py
Updating youtube_lounge manifest: {'config_flow': True}
Updating youtube_lounge strings: ['config']

Running hassfest to pick up new information.
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/workspaces/home-assistant-core/script/hassfest/__main__.py", line 250, in <module>
    sys.exit(main())
             ^^^^^^
  File "/workspaces/home-assistant-core/script/hassfest/__main__.py", line 172, in main
    plugin.validate(integrations, config)
  File "/workspaces/home-assistant-core/script/hassfest/services.py", line 238, in validate
    validate_services(config, integration)
  File "/workspaces/home-assistant-core/script/hassfest/services.py", line 133, in validate_services
    services = CORE_INTEGRATION_SERVICES_SCHEMA(data)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict
    return base_validate(path, iteritems(data), out)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 387, in validate_mapping
    cval = cvalue(key_path, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 229, in _run
    return self._exec(self._compiled, value, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 274, in _exec
    return func(path, v)
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
    return schema(data)
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict
    return base_validate(path, iteritems(data), out)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 387, in validate_mapping
    cval = cvalue(key_path, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 229, in _run
    return self._exec(self._compiled, value, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 274, in _exec
    return func(path, v)
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
    return schema(data)
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict
    return base_validate(path, iteritems(data), out)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 387, in validate_mapping
    cval = cvalue(key_path, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 229, in _run
    return self._exec(self._compiled, value, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 353, in _exec
    v = func(path, v)
        ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 636, in validate_sequence
    cval = validate(index_path, value)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
    return schema(data)
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict
    return base_validate(path, iteritems(data), out)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 387, in validate_mapping
    cval = cvalue(key_path, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 636, in validate_sequence
    cval = validate(index_path, value)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 229, in _run
    return self._exec(self._compiled, value, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 353, in _exec
    v = func(path, v)
        ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
    return schema(data)
           ^^^^^^^^^^^^
  File "/workspaces/home-assistant-core/homeassistant/helpers/selector.py", line 163, in _validate_supported_features
    feature_mask |= _validate_supported_feature(supported_feature)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/home-assistant-core/homeassistant/helpers/selector.py", line 138, in _validate_supported_feature
    known_entity_features = _entity_features()
                            ^^^^^^^^^^^^^^^^^^
  File "/workspaces/home-assistant-core/homeassistant/helpers/selector.py", line 92, in _entity_features
    from homeassistant.components.camera import CameraEntityFeature
  File "/workspaces/home-assistant-core/homeassistant/components/camera/__init__.py", line 31, in <module>
    from homeassistant.components.stream import (
  File "/workspaces/home-assistant-core/homeassistant/components/stream/__init__.py", line 64, in <module>
    from .core import (
  File "/workspaces/home-assistant-core/homeassistant/components/stream/core.py", line 15, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/workspaces/home-assistant-core/script/scaffold/__main__.py", line 117, in <module>
    sys.exit(main())
             ^^^^^^
  File "/workspaces/home-assistant-core/script/scaffold/__main__.py", line 70, in main
    subprocess.run(["python", "-m", "script.hassfest"], **pipe_null, check=True)
  File "/usr/local/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['python', '-m', 'script.hassfest']' returned non-zero exit status 1.

from core.

Sibert avatar Sibert commented on June 25, 2024

FWIW - numpy really should be a dependency being as the scaffold script to create a new integration requires it, so the dev container doesn't work to create a new integration without installing numpy.

Scaffolding integration for the youtube_lounge integration...
Writing tests/components/youtube_lounge/__init__.py
Writing homeassistant/components/youtube_lounge/const.py
Writing homeassistant/components/youtube_lounge/__init__.py
Writing homeassistant/components/youtube_lounge/manifest.json
Updating youtube_lounge manifest: {'codeowners': ['@caraar12345'], 'iot_class': 'cloud_polling', 'requirements': ['pyytlounge==2.0.0']}

Scaffolding config_flow for the youtube_lounge integration...
Writing homeassistant/components/youtube_lounge/const.py
Writing homeassistant/components/youtube_lounge/__init__.py
Writing homeassistant/components/youtube_lounge/config_flow.py
Writing tests/components/youtube_lounge/test_config_flow.py
Writing tests/components/youtube_lounge/conftest.py
Updating youtube_lounge manifest: {'config_flow': True}
Updating youtube_lounge strings: ['config']

Running hassfest to pick up new information.
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/workspaces/home-assistant-core/script/hassfest/__main__.py", line 250, in <module>
    sys.exit(main())
             ^^^^^^
  File "/workspaces/home-assistant-core/script/hassfest/__main__.py", line 172, in main
    plugin.validate(integrations, config)
  File "/workspaces/home-assistant-core/script/hassfest/services.py", line 238, in validate
    validate_services(config, integration)
  File "/workspaces/home-assistant-core/script/hassfest/services.py", line 133, in validate_services
    services = CORE_INTEGRATION_SERVICES_SCHEMA(data)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict
    return base_validate(path, iteritems(data), out)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 387, in validate_mapping
    cval = cvalue(key_path, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 229, in _run
    return self._exec(self._compiled, value, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 274, in _exec
    return func(path, v)
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
    return schema(data)
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict
    return base_validate(path, iteritems(data), out)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 387, in validate_mapping
    cval = cvalue(key_path, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 229, in _run
    return self._exec(self._compiled, value, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 274, in _exec
    return func(path, v)
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
    return schema(data)
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict
    return base_validate(path, iteritems(data), out)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 387, in validate_mapping
    cval = cvalue(key_path, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 229, in _run
    return self._exec(self._compiled, value, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 353, in _exec
    v = func(path, v)
        ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 636, in validate_sequence
    cval = validate(index_path, value)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
    return schema(data)
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict
    return base_validate(path, iteritems(data), out)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 387, in validate_mapping
    cval = cvalue(key_path, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 636, in validate_sequence
    cval = validate(index_path, value)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 229, in _run
    return self._exec(self._compiled, value, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 353, in _exec
    v = func(path, v)
        ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
    return schema(data)
           ^^^^^^^^^^^^
  File "/workspaces/home-assistant-core/homeassistant/helpers/selector.py", line 163, in _validate_supported_features
    feature_mask |= _validate_supported_feature(supported_feature)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/home-assistant-core/homeassistant/helpers/selector.py", line 138, in _validate_supported_feature
    known_entity_features = _entity_features()
                            ^^^^^^^^^^^^^^^^^^
  File "/workspaces/home-assistant-core/homeassistant/helpers/selector.py", line 92, in _entity_features
    from homeassistant.components.camera import CameraEntityFeature
  File "/workspaces/home-assistant-core/homeassistant/components/camera/__init__.py", line 31, in <module>
    from homeassistant.components.stream import (
  File "/workspaces/home-assistant-core/homeassistant/components/stream/__init__.py", line 64, in <module>
    from .core import (
  File "/workspaces/home-assistant-core/homeassistant/components/stream/core.py", line 15, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/workspaces/home-assistant-core/script/scaffold/__main__.py", line 117, in <module>
    sys.exit(main())
             ^^^^^^
  File "/workspaces/home-assistant-core/script/scaffold/__main__.py", line 70, in main
    subprocess.run(["python", "-m", "script.hassfest"], **pipe_null, check=True)
  File "/usr/local/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['python', '-m', 'script.hassfest']' returned non-zero exit status 1.

I ran into this as well. Very frustrating that a dev container doesn't even support the most basic feature it's supposed to out of the box.

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.