mitch-dc / volkswagen_we_connect_id

Apache License 2.0
195 stars 51 forks source link

Not able to configure integration #37

Closed terual closed 2 years ago

terual commented 2 years ago

Version of the custom_component

Latest git

Installation method (hacs / manual)

manual

Installation method of hass (venv, docker, hassio,...)

hassio

Configuration

Not yet able to configure

Describe the bug

Integration is not able to install weconnect python package

Debug log

Logger: homeassistant.util.package
Source: util/package.py:99
First occurred: 07:56:52 (3 occurrences)
Last logged: 07:57:09

Unable to install package weconnect==0.42.0: ERROR: Cannot install weconnect==0.42.0 because these package versions have conflicting dependencies. ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts WARNING: You are using pip version 22.0.3; however, version 22.1.2 is available. You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.

Logger: aiohttp.server
Source: requirements.py:194
First occurred: 07:57:09 (1 occurrences)
Last logged: 07:57:09

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 222, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 79, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 220, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 173, in post
    return await super().post(request)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 70, in post
    result = await self._flow_mgr.async_init(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 205, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 223, in _async_init
    flow = await self.async_create_flow(handler, context=context, data=data)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 744, in async_create_flow
    await async_process_deps_reqs(self.hass, self._hass_config, integration)
  File "/usr/src/homeassistant/homeassistant/setup.py", line 360, in async_process_deps_reqs
    await requirements.async_get_integration_with_requirements(
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 83, in async_get_integration_with_requirements
    await _async_process_integration(hass, integration, done)
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 99, in _async_process_integration
    await async_process_requirements(
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 162, in async_process_requirements
    await _async_process_requirements(
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 194, in _async_process_requirements
    raise RequirementsNotFound(name, [req])
homeassistant.requirements.RequirementsNotFound: Requirements for volkswagen_we_connect_id not found: ['weconnect==0.42.0'].
tsg21 commented 2 years ago

I've seen this too. I'm not totally sure why as I am new to this, but my hunch is that the problem lies with the fact that https://github.com/tillsteinbach/WeConnect-python specifies a dependency on requests, which apparently is not allowed:

https://developers.home-assistant.io/docs/creating_integration_manifest/#custom-integration-requirements

Custom integrations should only include requirements that are not required by the Core requirements.txt.

Is there some way to suppress/override that?

Upgrading to the latest version of WeConnect-python fixes the issues, because the upstream maintainer has upgraded requests.

terual commented 2 years ago

Thanks! Bumping weconnect to 0.44.2 fixes the problem.

mitch-dc commented 2 years ago

Should be fixed in latest version https://github.com/mitch-dc/volkswagen_we_connect_id/releases/tag/v0.0.11

JelleKoster commented 2 years ago

Note this solution seems to have caused errors for me.

I'm using HA OS, and I am a few major versions behind on HA core. (2022.3.8)

`Logger: homeassistant.util.package Source: util/package.py:99 First occurred: July 8, 2022 at 9:25:21 PM (3 occurrences) Last logged: July 8, 2022 at 9:26:46 PM

Unable to install package weconnect==0.44.2: ERROR: Cannot install weconnect==0.44.2 because these package versions have conflicting dependencies. ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts WARNING: You are using pip version 22.0.3; however, version 22.1.2 is available. You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.`

In the HA core 2022.7.0 release notes (available 3 days ago...) I recall reading they bumped the python version. I suspect this is the cause of the above error, and I will look into upgrading to resolve. (Need to check if the blocker issue on another integration is resolved yet and find an appropriate moment) If this does not resolve the issue, I will of course raise a separate issue here. I still wanted to share this information in case anyone else encounters it and comes searching.

I'm not sure if the change log of this component can be updated retroactively, if so and if it's confirmed the python upgrade is a dependency, it would be appropriate to add a dependency warning.