Closed lbbrhzn closed 1 year ago
There are no packages in this example. Everything here are just examples, and you as as the maintainer of your repository need to adjust it to fit your needs.
@lbbrhzn did you manage to work around the issue? I have the same problem since upgrading my generated repo using the updated devcontainer.json. I've pinned the problem down to having a requirement
in the manifest with the same name as as the integration package. In your case that would be occp
. The package is downloaded by hass but it seems that hass cannot resolve the dependency correctly.
from your manifest
}
"issue_tracker": "https://github.com/lbbrhzn/ocpp/issues",
"requirements": [
"ocpp>=1.0.0",
"websockets>=12.0"
],
"version": "0.5.12"
}
@ludeeus I suspect this is related to adding the integration directory to PYTHONPATH due to precedence. Trying to import required package occp
in the example above will resolve to the integration itself. Since the directory is added to PYTHONPATH.
There are no packages in this example. Everything here are just examples, and you as as the maintainer of your repository need to adjust it to fit your needs.
@ludeeus Another approach might be using an additional mount in devcontainer.json avoiding the need for usage of both PYTHONPATH and symlinks. I believe it's quite common for integrations and their libs to share the same name in the wild.
{
// Mount the path to custom_components
// This let's us have the structure we want <root>/custom_components/integration_blueprint
// while at the same time have Home Assistant configuration inside <root>/config
// without resulting to symlinks.
"mounts": [
"source=${localWorkspaceFolder}/custom_components,target=${containerWorkspaceFolder}/config/custom_components,type=bind,consistency=cached"
],
}
System Health details
System Information
Home Assistant Cloud
logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | okDashboards
dashboards | 1 -- | -- resources | 0 mode | auto-genRecorder
oldest_recorder_run | August 20, 2023 at 12:22 PM -- | -- current_recorder_run | August 21, 2023 at 12:14 AM estimated_db_size | 0.31 MiB database_engine | sqlite database_version | 3.34.1Checklist
Describe the issue
i'm trying to modify an integration called ocpp to be in line with integration_blueprint. This integration has the same name as a python package it depends upon.
I have installed this package using pip, and verified that it is indeed installed.
When starting hass using the develop script provided in this template, I cannot add the integration because elements in the ocpp package cannot be found.
When the integration is installed through hacs, everything works fine.
When I rename the custom_components/ocpp to custom_components/ocpp_integration everything works fine.
I suspect the issue may be related to the modification of PYTHONPATH.
Reproduction steps
Debug logs
Diagnostics dump
not available.