mykhailog / hacs_waveshare_ups_hat

Waveshare UPS Hat integration for Home Assistant.
MIT License
19 stars 9 forks source link

Integration broken in 2022.7.1 #5

Closed mayankraichura closed 2 years ago

mayankraichura commented 2 years ago

After updating to 2022.7.1, sensor.waveshare_ups_hat was gone. The logs has following error.

Unable to install package smbus-cffi==0.5.1: error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [18 lines of output] running bdist_wheel running build running build_py creating build creating build/lib.linux-aarch64-cpython-310 creating build/lib.linux-aarch64-cpython-310/smbus copying smbus/__about__.py -> build/lib.linux-aarch64-cpython-310/smbus copying smbus/smbus.py -> build/lib.linux-aarch64-cpython-310/smbus copying smbus/__init__.py -> build/lib.linux-aarch64-cpython-310/smbus copying smbus/util.py -> build/lib.linux-aarch64-cpython-310/smbus running build_ext generating cffi module 'build/temp.linux-aarch64-cpython-310/_smbus_cffi.c' creating build/temp.linux-aarch64-cpython-310 building '_smbus_cffi' extension creating build/temp.linux-aarch64-cpython-310/build creating build/temp.linux-aarch64-cpython-310/build/temp.linux-aarch64-cpython-310 gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DTHREAD_STACK_SIZE=0x100000 -fPIC -Iinclude -I/usr/local/include/python3.10 -c build/temp.linux-aarch64-cpython-310/_smbus_cffi.c -o build/temp.linux-aarch64-cpython-310/build/temp.linux-aarch64-cpython-310/_smbus_cffi.o error: command 'gcc' failed: No such file or directory [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for smbus-cffi error: subprocess-exited-with-error × Running setup.py install for smbus-cffi did not run successfully. │ exit code: 1 ╰─> [20 lines of output] running install /usr/local/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build running build_py creating build creating build/lib.linux-aarch64-cpython-310 creating build/lib.linux-aarch64-cpython-310/smbus copying smbus/__about__.py -> build/lib.linux-aarch64-cpython-310/smbus copying smbus/smbus.py -> build/lib.linux-aarch64-cpython-310/smbus copying smbus/__init__.py -> build/lib.linux-aarch64-cpython-310/smbus copying smbus/util.py -> build/lib.linux-aarch64-cpython-310/smbus running build_ext generating cffi module 'build/temp.linux-aarch64-cpython-310/_smbus_cffi.c' creating build/temp.linux-aarch64-cpython-310 building '_smbus_cffi' extension creating build/temp.linux-aarch64-cpython-310/build creating build/temp.linux-aarch64-cpython-310/build/temp.linux-aarch64-cpython-310 gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DTHREAD_STACK_SIZE=0x100000 -fPIC -Iinclude -I/usr/local/include/python3.10 -c build/temp.linux-aarch64-cpython-310/_smbus_cffi.c -o build/temp.linux-aarch64-cpython-310/build/temp.linux-aarch64-cpython-310/_smbus_cffi.o error: command 'gcc' failed: No such file or directory [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure × Encountered error while trying to install package. ╰─> smbus-cffi note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.
mayankraichura commented 2 years ago

Looks like smbus-cffi is not compatible with Python 3.10 that was introduced in 2022.7.1 which broke the update.

I came across this fork by @icaruseffect that has changed to smbus2 which seems to be drop-in replacement, albeit with minor changes, for smbus-cffi and works perfectly.

Maybe we can incorporate these changess in current repo so that whoever are using your repo can get an update notification in HACS.

fraserp commented 2 years ago

I'm using sensor.waveshare_ups_hat on 2022.7.2 and all appears to be fine for me - I cannot reproduce this issue. All functionality is working as intended and I can see all the UPS Hat sensors just fine (Hassos on RPi 4).

mayankraichura commented 2 years ago

Hi @fraserp,

I'll give it a shot one more time.

Thanks,

mayankraichura commented 2 years ago

Hi,

Yes it's working on 2022.7.2. On 2022.7.1, after the sensors were missing, I did check the logs and there were errors pertaining to smbus-cffi failing build on Python 3.10 which led me to assume it's lack of compatibility. However, even I've moved to 2022.7.2 it's working fine as of now.

Thanks once again, Mayank