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

integration cannot have the same name as package #130

Closed
4 tasks done
lbbrhzn opened this issue Aug 20, 2023 · 3 comments · May be fixed by #205
Closed
4 tasks done

integration cannot have the same name as package #130

lbbrhzn opened this issue Aug 20, 2023 · 3 comments · May be fixed by #205
Labels

Comments

@lbbrhzn
Copy link

lbbrhzn commented Aug 20, 2023

System Health details

System Information

version core-2023.8.3
installation_type Unsupported Third Party Container
dev false
hassio false
docker true
user vscode
virtualenv false
python_version 3.11.4
os_name Linux
os_version 5.10.76-linuxkit
arch x86_64
timezone UTC
config_dir /workspaces/ocpp/config
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Dashboards
dashboards 1
resources 0
mode auto-gen
Recorder
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.1

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

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.

2023-08-20 21:51:17.452 ERROR (MainThread) [homeassistant.setup] 
Setup failed for custom integration ocpp: 
Unable to import component: No module named 'ocpp.v16'

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

  1. clone ocpp integration from https://github.com/lbbrhzn/ocpp
  2. run pip install < requirements_test.txt
  3. add and run setup and develop scripts
  4. add the OCPP integration in home assistant

Debug logs

2023-08-20 21:51:12.694 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration ocpp which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-08-20 21:51:12.832 INFO (MainThread) [homeassistant.setup] Setup of domain logger took 0.0 seconds
2023-08-20 21:51:12.836 INFO (MainThread) [homeassistant.bootstrap] Setting up frontend: {'frontend'}
2023-08-20 21:51:12.864 INFO (MainThread) [homeassistant.setup] Setting up device_automation
2023-08-20 21:51:12.865 INFO (MainThread) [homeassistant.setup] Setup of domain device_automation took 0.0 seconds
2023-08-20 21:51:13.023 INFO (MainThread) [homeassistant.setup] Setting up lovelace
2023-08-20 21:51:13.026 WARNING (MainThread) [asyncio] Executing <Task pending name='setup component lovelace' coro=<_async_setup_component() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/setup.py:288> wait_for=<Task pending name='Storage load lovelace_dashboards' coro=<Store._async_load() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/helpers/storage.py:133> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> took 0.158 seconds
2023-08-20 21:51:13.043 INFO (MainThread) [homeassistant.setup] Setting up http
2023-08-20 21:51:13.060 INFO (MainThread) [homeassistant.setup] Setup of domain lovelace took 0.0 seconds
2023-08-20 21:51:13.092 INFO (MainThread) [homeassistant.setup] Setup of domain http took 0.0 seconds
2023-08-20 21:51:13.130 INFO (MainThread) [homeassistant.setup] Setting up api
2023-08-20 21:51:13.137 INFO (MainThread) [homeassistant.setup] Setup of domain api took 0.0 seconds
2023-08-20 21:51:13.137 INFO (MainThread) [homeassistant.setup] Setting up auth
2023-08-20 21:51:13.140 INFO (MainThread) [homeassistant.setup] Setup of domain auth took 0.0 seconds
2023-08-20 21:51:13.176 INFO (MainThread) [homeassistant.setup] Setting up config
2023-08-20 21:51:13.219 INFO (MainThread) [homeassistant.setup] Setting up diagnostics
2023-08-20 21:51:13.263 INFO (MainThread) [homeassistant.setup] Setting up repairs
2023-08-20 21:51:13.269 INFO (MainThread) [homeassistant.setup] Setup of domain repairs took 0.0 seconds
2023-08-20 21:51:13.436 WARNING (MainThread) [asyncio] Executing <Task finished name='Task-93' coro=<async_setup.<locals>.setup_panel() done, defined at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/components/config/__init__.py:45> result=None created at /usr/local/lib/python3.11/asyncio/tasks.py:374> took 0.150 seconds
2023-08-20 21:51:13.476 INFO (MainThread) [homeassistant.setup] Setting up file_upload
2023-08-20 21:51:13.477 INFO (MainThread) [homeassistant.setup] Setup of domain file_upload took 0.0 seconds
2023-08-20 21:51:13.477 INFO (MainThread) [homeassistant.setup] Setup of domain config took 0.3 seconds
2023-08-20 21:51:13.478 INFO (MainThread) [homeassistant.setup] Setup of domain diagnostics took 0.3 seconds
2023-08-20 21:51:13.595 INFO (MainThread) [homeassistant.setup] Setting up image_upload
2023-08-20 21:51:13.597 WARNING (MainThread) [asyncio] Executing <Task pending name='setup component image_upload' coro=<_async_setup_component() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/setup.py:288> wait_for=<Task pending name='Storage load image' coro=<Store._async_load() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/helpers/storage.py:133> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> took 0.102 seconds
2023-08-20 21:51:13.604 INFO (MainThread) [homeassistant.setup] Setting up websocket_api
2023-08-20 21:51:13.605 INFO (MainThread) [homeassistant.setup] Setup of domain websocket_api took 0.0 seconds
2023-08-20 21:51:13.612 INFO (MainThread) [homeassistant.setup] Setup of domain image_upload took 0.0 seconds
2023-08-20 21:51:13.620 INFO (SyncWorker_1) [homeassistant.loader] Loaded group from homeassistant.components.group
2023-08-20 21:51:13.640 INFO (SyncWorker_2) [homeassistant.loader] Loaded device_tracker from homeassistant.components.device_tracker
2023-08-20 21:51:13.744 INFO (MainThread) [homeassistant.setup] Setting up search
2023-08-20 21:51:13.745 INFO (MainThread) [homeassistant.setup] Setup of domain search took 0.0 seconds
2023-08-20 21:51:13.746 WARNING (MainThread) [asyncio] Executing <Task pending name='setup component search' coro=<_async_setup_component() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/setup.py:321> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> took 0.108 seconds
2023-08-20 21:51:14.519 INFO (MainThread) [homeassistant.setup] Setting up analytics
2023-08-20 21:51:14.525 WARNING (MainThread) [asyncio] Executing <Task pending name='setup component analytics' coro=<_async_setup_component() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/setup.py:288> wait_for=<Task pending name='Storage load core.analytics' coro=<Store._async_load() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/helpers/storage.py:133> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> took 0.779 seconds
2023-08-20 21:51:14.540 INFO (MainThread) [homeassistant.setup] Setting up person
2023-08-20 21:51:14.546 INFO (MainThread) [homeassistant.setup] Setup of domain analytics took 0.0 seconds
2023-08-20 21:51:14.570 INFO (MainThread) [homeassistant.setup] Setup of domain person took 0.0 seconds
2023-08-20 21:51:14.581 INFO (SyncWorker_1) [homeassistant.loader] Loaded hassio from homeassistant.components.hassio
2023-08-20 21:51:14.585 INFO (MainThread) [homeassistant.setup] Setting up onboarding
2023-08-20 21:51:14.600 INFO (MainThread) [homeassistant.setup] Setup of domain onboarding took 0.0 seconds
2023-08-20 21:51:14.622 INFO (MainThread) [homeassistant.setup] Setting up frontend
2023-08-20 21:51:14.638 INFO (MainThread) [homeassistant.setup] Setup of domain frontend took 0.0 seconds
2023-08-20 21:51:14.646 INFO (MainThread) [homeassistant.bootstrap] Setting up recorder: {'recorder'}
2023-08-20 21:51:14.651 INFO (MainThread) [homeassistant.setup] Setting up recorder
2023-08-20 21:51:14.670 INFO (MainThread) [asyncio] <Server sockets=(<asyncio.TransportSocket fd=8, family=10, type=1, proto=6, laddr=('::', 8123, 0, 0)>, <asyncio.TransportSocket fd=10, family=2, type=1, proto=6, laddr=('0.0.0.0', 8123)>)> is serving
2023-08-20 21:51:14.670 INFO (MainThread) [homeassistant.components.http] Now listening on port 8123
2023-08-20 21:51:14.791 INFO (MainThread) [homeassistant.setup] Setup of domain recorder took 0.1 seconds
2023-08-20 21:51:14.792 INFO (MainThread) [homeassistant.bootstrap] Setting up stage 1: {'cloud', 'ssdp', 'usb', 'bluetooth', 'zeroconf', 'api', 'network', 'websocket_api', 'http', 'logger', 'webhook', 'dhcp'}
2023-08-20 21:51:14.831 INFO (MainThread) [homeassistant.setup] Setting up webhook
2023-08-20 21:51:14.833 INFO (MainThread) [homeassistant.setup] Setup of domain webhook took 0.0 seconds
2023-08-20 21:51:14.882 INFO (MainThread) [homeassistant.setup] Setting up usb
2023-08-20 21:51:14.883 INFO (MainThread) [homeassistant.setup] Setup of domain usb took 0.0 seconds
2023-08-20 21:51:14.956 INFO (MainThread) [homeassistant.setup] Setting up dhcp
2023-08-20 21:51:14.957 INFO (MainThread) [homeassistant.setup] Setup of domain dhcp took 0.0 seconds
2023-08-20 21:51:14.958 INFO (MainThread) [homeassistant.setup] Setting up network
2023-08-20 21:51:14.959 INFO (MainThread) [homeassistant.setup] Setup of domain network took 0.0 seconds
2023-08-20 21:51:14.976 INFO (SyncWorker_1) [homeassistant.loader] Loaded google_assistant from homeassistant.components.google_assistant
2023-08-20 21:51:14.977 INFO (SyncWorker_1) [homeassistant.loader] Loaded alexa from homeassistant.components.alexa
2023-08-20 21:51:14.989 INFO (SyncWorker_1) [homeassistant.loader] Loaded camera from homeassistant.components.camera
2023-08-20 21:51:15.096 INFO (MainThread) [homeassistant.setup] Setting up bluetooth
2023-08-20 21:51:15.108 WARNING (MainThread) [asyncio] Executing <Task pending name='setup component bluetooth' coro=<_async_setup_component() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/setup.py:288> wait_for=<Task pending name='Storage load bluetooth.remote_scanners' coro=<Store._async_load() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/helpers/storage.py:133> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> took 0.119 seconds
2023-08-20 21:51:15.227 INFO (MainThread) [homeassistant.setup] Setting up zeroconf
2023-08-20 21:51:15.242 INFO (MainThread) [homeassistant.setup] Setup of domain zeroconf took 0.0 seconds
2023-08-20 21:51:15.258 INFO (SyncWorker_0) [homeassistant.loader] Loaded media_player from homeassistant.components.media_player
2023-08-20 21:51:15.299 INFO (MainThread) [homeassistant.components.zeroconf] Starting Zeroconf broadcast
2023-08-20 21:51:15.307 INFO (MainThread) [homeassistant.setup] Setup of domain bluetooth took 0.2 seconds
2023-08-20 21:51:16.200 INFO (MainThread) [homeassistant.setup] Setting up cloud
2023-08-20 21:51:16.204 WARNING (MainThread) [asyncio] Executing <Task pending name='setup component cloud' coro=<_async_setup_component() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/setup.py:288> wait_for=<Task pending name='Storage load cloud' coro=<Store._async_load() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/helpers/storage.py:133> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> took 0.883 seconds
2023-08-20 21:51:16.283 INFO (MainThread) [homeassistant.setup] Setting up ssdp
2023-08-20 21:51:16.311 INFO (MainThread) [homeassistant.setup] Setup of domain cloud took 0.1 seconds
2023-08-20 21:51:16.316 INFO (MainThread) [homeassistant.setup] Setup of domain ssdp took 0.0 seconds
2023-08-20 21:51:16.324 INFO (MainThread) [homeassistant.bootstrap] Setting up stage 2: {'config', 'counter', 'analytics', 'schedule', 'default_config', 'timer', 'input_datetime', 'automation', 'script', 'input_button', 'history', 'diagnostics', 'repairs', 'application_credentials', 'trace', 'lovelace', 'search', 'mobile_app', 'sun', 'media_source', 'assist_pipeline', 'input_number', 'input_boolean', 'input_text', 'scene', 'stt', 'conversation', 'map', 'tag', 'homeassistant_alerts', 'logbook', 'onboarding', 'device_automation', 'input_select', 'file_upload', 'energy', 'image_upload', 'zone', 'radio_browser', 'tts', 'ocpp', 'stream', 'person', 'blueprint', 'hardware', 'my', 'system_health', 'auth'}
2023-08-20 21:51:16.345 INFO (MainThread) [homeassistant.setup] Setting up counter
2023-08-20 21:51:16.351 INFO (MainThread) [homeassistant.setup] Setting up schedule
2023-08-20 21:51:16.362 INFO (MainThread) [homeassistant.setup] Setting up timer
2023-08-20 21:51:16.367 INFO (MainThread) [homeassistant.setup] Setting up input_datetime
2023-08-20 21:51:16.373 INFO (MainThread) [homeassistant.setup] Setting up input_button
2023-08-20 21:51:16.485 INFO (MainThread) [homeassistant.setup] Setting up history
2023-08-20 21:51:16.486 INFO (MainThread) [homeassistant.setup] Setup of domain history took 0.0 seconds
2023-08-20 21:51:16.489 WARNING (MainThread) [asyncio] Executing <Task pending name='setup component history' coro=<_async_setup_component() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/setup.py:321> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> took 0.113 seconds
2023-08-20 21:51:16.493 INFO (MainThread) [homeassistant.setup] Setting up trace
2023-08-20 21:51:16.494 INFO (MainThread) [homeassistant.setup] Setup of domain trace took 0.0 seconds
2023-08-20 21:51:16.497 INFO (MainThread) [homeassistant.setup] Setting up sun
2023-08-20 21:51:16.502 INFO (MainThread) [homeassistant.setup] Setup of domain sun took 0.0 seconds
2023-08-20 21:51:16.607 INFO (MainThread) [homeassistant.setup] Setting up input_number
2023-08-20 21:51:16.613 INFO (MainThread) [homeassistant.setup] Setting up input_boolean
2023-08-20 21:51:16.623 INFO (MainThread) [homeassistant.setup] Setting up input_text
2023-08-20 21:51:16.641 INFO (MainThread) [homeassistant.setup] Setting up scene
2023-08-20 21:51:16.666 INFO (MainThread) [homeassistant.setup] Setting up stt
2023-08-20 21:51:16.668 INFO (MainThread) [homeassistant.setup] Setup of domain stt took 0.0 seconds
2023-08-20 21:51:16.669 INFO (MainThread) [homeassistant.setup] Setting up conversation
2023-08-20 21:51:16.675 INFO (MainThread) [homeassistant.setup] Setup of domain conversation took 0.0 seconds
2023-08-20 21:51:16.736 INFO (MainThread) [homeassistant.setup] Setting up tag
2023-08-20 21:51:16.778 INFO (MainThread) [homeassistant.setup] Setting up homeassistant_alerts
2023-08-20 21:51:16.781 INFO (MainThread) [homeassistant.setup] Setup of domain homeassistant_alerts took 0.0 seconds
2023-08-20 21:51:16.784 INFO (MainThread) [homeassistant.setup] Setting up input_select
2023-08-20 21:51:16.789 INFO (MainThread) [homeassistant.setup] Setting up zone
2023-08-20 21:51:16.792 INFO (MainThread) [homeassistant.setup] Setting up tts
2023-08-20 21:51:16.796 INFO (MainThread) [homeassistant.setup] Setting up blueprint
2023-08-20 21:51:16.800 INFO (MainThread) [homeassistant.setup] Setup of domain blueprint took 0.0 seconds
2023-08-20 21:51:16.842 INFO (MainThread) [homeassistant.setup] Setting up hardware
2023-08-20 21:51:16.965 INFO (MainThread) [homeassistant.setup] Setting up radio_browser
2023-08-20 21:51:16.966 INFO (MainThread) [homeassistant.setup] Setup of domain radio_browser took 0.0 seconds
2023-08-20 21:51:17.026 INFO (MainThread) [homeassistant.setup] Setting up application_credentials
2023-08-20 21:51:17.031 INFO (MainThread) [homeassistant.setup] Setting up media_source
2023-08-20 21:51:17.050 INFO (MainThread) [homeassistant.setup] Setup of domain hardware took 0.2 seconds
2023-08-20 21:51:17.103 INFO (MainThread) [homeassistant.setup] Setting up map
2023-08-20 21:51:17.112 INFO (MainThread) [homeassistant.setup] Setup of domain map took 0.0 seconds
2023-08-20 21:51:17.141 INFO (MainThread) [homeassistant.setup] Setting up logbook
2023-08-20 21:51:17.153 INFO (MainThread) [homeassistant.setup] Setting up energy
2023-08-20 21:51:17.155 INFO (MainThread) [homeassistant.setup] Setup of domain energy took 0.0 seconds
2023-08-20 21:51:17.201 INFO (MainThread) [homeassistant.setup] Setting up my
2023-08-20 21:51:17.202 INFO (MainThread) [homeassistant.setup] Setup of domain my took 0.0 seconds
2023-08-20 21:51:17.203 INFO (MainThread) [homeassistant.setup] Setting up system_health
2023-08-20 21:51:17.217 INFO (MainThread) [homeassistant.setup] Setup of domain counter took 0.9 seconds
2023-08-20 21:51:17.220 INFO (MainThread) [homeassistant.setup] Setup of domain timer took 0.9 seconds
2023-08-20 21:51:17.246 INFO (MainThread) [homeassistant.setup] Setup of domain tag took 0.5 seconds
2023-08-20 21:51:17.269 INFO (MainThread) [homeassistant.setup] Setting up automation
2023-08-20 21:51:17.274 INFO (MainThread) [homeassistant.setup] Setting up script
2023-08-20 21:51:17.314 INFO (SyncWorker_0) [homeassistant.loader] Loaded sensor from homeassistant.components.sensor
2023-08-20 21:51:17.331 INFO (MainThread) [homeassistant.setup] Setup of domain media_source took 0.3 seconds
2023-08-20 21:51:17.340 INFO (MainThread) [homeassistant.setup] Setup of domain logbook took 0.2 seconds
2023-08-20 21:51:17.346 INFO (MainThread) [homeassistant.setup] Setup of domain tts took 0.6 seconds
2023-08-20 21:51:17.350 INFO (MainThread) [homeassistant.setup] Setup of domain system_health took 0.1 seconds
2023-08-20 21:51:17.363 INFO (MainThread) [homeassistant.setup] Setup of domain schedule took 1.0 seconds
2023-08-20 21:51:17.371 INFO (MainThread) [homeassistant.setup] Setup of domain input_button took 1.0 seconds
2023-08-20 21:51:17.377 INFO (MainThread) [homeassistant.setup] Setup of domain input_datetime took 1.0 seconds
2023-08-20 21:51:17.384 INFO (MainThread) [homeassistant.setup] Setup of domain application_credentials took 0.4 seconds
2023-08-20 21:51:17.400 INFO (MainThread) [homeassistant.setup] Setup of domain zone took 0.6 seconds
2023-08-20 21:51:17.452 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration ocpp: Unable to import component: No module named 'ocpp.v16'
Traceback (most recent call last):
  File "/home/vscode/.local/lib/python3.11/site-packages/homeassistant/setup.py", line 215, in _async_setup_component
    component = integration.get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vscode/.local/lib/python3.11/site-packages/homeassistant/loader.py", line 813, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/workspaces/ocpp/custom_components/ocpp/__init__.py", line 12, in <module>
    from ocpp.v16.enums import AuthorizationStatus
  File "/workspaces/ocpp/custom_components/ocpp/__init__.py", line 12, in <module>
    from ocpp.v16.enums import AuthorizationStatus
ModuleNotFoundError: No module named 'ocpp.v16'

Diagnostics dump

not available.

@lbbrhzn lbbrhzn added the Bug label Aug 20, 2023
@ludeeus
Copy link
Owner

ludeeus commented Oct 8, 2023

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 ludeeus closed this as not planned Won't fix, can't repro, duplicate, stale Oct 8, 2023
@bj00rn
Copy link

bj00rn commented Oct 29, 2024

@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.

@bj00rn
Copy link

bj00rn commented Oct 29, 2024

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"
    ],
}

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