FL550 / dwd_weather

Deutscher Wetterdienst integration for Home-Assistant
MIT License
197 stars 13 forks source link

Requirements for dwd_weather not found: ['simple_dwd_weatherforecast==2.1.5']. #152

Closed coreuter closed 1 month ago

coreuter commented 1 month ago

Version of home_assistant

The problem first occurred with 2024.10.0b1 and persists until now (2024.10.0b4).

Version of the custom_component

v2.1.10 and v2.1.11

Describe the bug

The integration no longer works/does not load at all. I'm not sure whether it's the integration, the simple_dwd_weatherforecast dependency, or the new dependency resolution method in 2024.10.0b that is causing the problem. I suspect the latter because the problem first appeared with dwd_weather v2.1.10 after installing HA 2024.10.0b1. No other custom integrations that are installed have reported a similar issue.

Debug log

custom_components.dwd_weather: debug was set, but no dwd_weather log output other than what is listed below was logged.


Logger: homeassistant.setup
Source: setup.py:269
First occurred: 12:14:09 PM (1 occurrences)
Last logged: 12:14:09 PM

Setup failed for custom integration 'dwd_weather': Requirements for dwd_weather not found: ['simple_dwd_weatherforecast==2.1.5'].

---

Logger: homeassistant.util.package
Source: util/package.py:150
First occurred: 12:13:55 PM (3 occurrences)
Last logged: 12:14:09 PM

Unable to install package simple_dwd_weatherforecast==2.1.5: error: Failed to prepare distributions Caused by: Failed to fetch wheel: stream-inflate==0.0.37 Caused by: Build backend failed to build wheel through `build_wheel()` with exit status: 1 --- stdout: Building... macros: [] compiler_directives: {} running bdist_wheel running build running build_py copying stream_inflate.py -> build/lib.linux-aarch64-cpython-312 running egg_info writing stream_inflate.egg-info/PKG-INFO writing dependency_links to stream_inflate.egg-info/dependency_links.txt writing requirements to stream_inflate.egg-info/requires.txt writing top-level names to stream_inflate.egg-info/top_level.txt reading manifest file 'stream_inflate.egg-info/SOURCES.txt' adding license file 'LICENSE' writing manifest file 'stream_inflate.egg-info/SOURCES.txt' running build_ext building 'stream_inflate' extension gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/root/.cache/uv/builds-v0/.tmp15Bt1f/include -I/usr/local/include/python3.12 -c stream_inflate.c -o build/temp.linux-aarch64-cpython-312/stream_inflate.o --- stderr: /root/.cache/uv/builds-v0/.tmp15Bt1f/lib/python3.12/site-packages/setuptools/dist.py:294: InformationOnly: Normalizing 'v0.0.37' to '0.0.37' self.metadata.version = self._normalize_version(self.metadata.version) error: command 'gcc' failed: No such file or directory ---
Unable to install package simple_dwd_weatherforecast==2.1.5: error: Failed to prepare distributions Caused by: Failed to fetch wheel: stream-inflate==0.0.37 Caused by: Build backend failed to build wheel through `build_wheel()` with exit status: 1 --- stdout: Building... macros: [] compiler_directives: {} running bdist_wheel running build running build_py copying stream_inflate.py -> build/lib.linux-aarch64-cpython-312 running egg_info writing stream_inflate.egg-info/PKG-INFO writing dependency_links to stream_inflate.egg-info/dependency_links.txt writing requirements to stream_inflate.egg-info/requires.txt writing top-level names to stream_inflate.egg-info/top_level.txt reading manifest file 'stream_inflate.egg-info/SOURCES.txt' adding license file 'LICENSE' writing manifest file 'stream_inflate.egg-info/SOURCES.txt' running build_ext building 'stream_inflate' extension gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/root/.cache/uv/builds-v0/.tmpbMSEIB/include -I/usr/local/include/python3.12 -c stream_inflate.c -o build/temp.linux-aarch64-cpython-312/stream_inflate.o --- stderr: /root/.cache/uv/builds-v0/.tmpbMSEIB/lib/python3.12/site-packages/setuptools/dist.py:294: InformationOnly: Normalizing 'v0.0.37' to '0.0.37' self.metadata.version = self._normalize_version(self.metadata.version) error: command 'gcc' failed: No such file or directory ---
Unable to install package simple_dwd_weatherforecast==2.1.5: error: Failed to prepare distributions Caused by: Failed to fetch wheel: stream-inflate==0.0.37 Caused by: Build backend failed to build wheel through `build_wheel()` with exit status: 1 --- stdout: Building... macros: [] compiler_directives: {} running bdist_wheel running build running build_py copying stream_inflate.py -> build/lib.linux-aarch64-cpython-312 running egg_info writing stream_inflate.egg-info/PKG-INFO writing dependency_links to stream_inflate.egg-info/dependency_links.txt writing requirements to stream_inflate.egg-info/requires.txt writing top-level names to stream_inflate.egg-info/top_level.txt reading manifest file 'stream_inflate.egg-info/SOURCES.txt' adding license file 'LICENSE' writing manifest file 'stream_inflate.egg-info/SOURCES.txt' running build_ext building 'stream_inflate' extension gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/root/.cache/uv/builds-v0/.tmpKfvpcF/include -I/usr/local/include/python3.12 -c stream_inflate.c -o build/temp.linux-aarch64-cpython-312/stream_inflate.o --- stderr: /root/.cache/uv/builds-v0/.tmpKfvpcF/lib/python3.12/site-packages/setuptools/dist.py:294: InformationOnly: Normalizing 'v0.0.37' to '0.0.37' self.metadata.version = self._normalize_version(self.metadata.version) error: command 'gcc' failed: No such file or directory ---
FL550 commented 1 month ago

There are a lot of updates recently in the httpx package which I use for loading the data. Some mirrors don't update them in due time which produces this error. This is therefore not a direct error in my integration I can however pin the version to a specific one to prevent this error.

coreuter commented 1 month ago

Thanks for your quick response!

Are you talking about this package? It was last updated on August 27, 2024. The issue first occurred on September 25, 2024 – after upgrading to 2024.10.0b0 – and still persists.

Although my knowledge in this area is limited, I just did a bit of experimenting and installed simple_dwd_weatherforecast manually inside the container with plain pip (ssh'ed into the Home Assistant OS server, exec'ed into the container, and ran pip install simple_dwd_weatherforecast). After a ha core restart, the dwd_weather integration worked again. However, after I did a ha core rebuild, it no longer worked and failed with above mentioned errors. What I noticed is that with pip stream_inflate-0.0.23 is installed. But with uv it tries to install stream-inflate==0.0.37, which fails.

FL550 commented 1 month ago

No, it is stream-inflate which is used by stream-unzip and not httpx, my error.

I'll release a new version, which hopefully pins the package to an older version, which is sufficient for now.

FL550 commented 1 month ago

I've pinned the version now.

coreuter commented 1 month ago

An update to v2.1.12 was provided via HACS, but I had to manually change the requirements in manifest.json from "simple_dwd_weatherforecast==2.1.5" to "simple_dwd_weatherforecast==2.1.6" after installing the update via HACS.

The integration now loads , but the following warning is logged:

Log output ``` Logger: py.warnings Source: custom_components/dwd_weather/connector.py:12 integration: Deutscher Wetterdienst ([documentation](https://github.com/FL550/dwd_weather), [issues](https://github.com/FL550/dwd_weather/issues)) First occurred: 5:32:11 PM (2 occurrences) Last logged: 5:32:11 PM /usr/local/lib/python3.12/site-packages/suntimes/suntimes.py:528: SyntaxWarning: invalid escape sequence '\ ' raise ValueError("Vérifiez le chemin : doit inclure / ou \ en fin de nom - Check the path: must include / or \ at the end of the name") /usr/local/lib/python3.12/site-packages/suntimes/suntimes.py:602: SyntaxWarning: invalid escape sequence '\ ' raise ValueError("Vérifiez le chemin : doit inclure / ou \ en fin de nom - Check the path: must include / or \ at the end of the name")```

However, it does not seem to affect the functionality of dwd_weather. Never mind. I don't know why, but after a few restarts the error disappeared.

Thanks a lot for the quick fix!