techman83 / Filament-Scale-Enhanced

GNU Affero General Public License v3.0
24 stars 11 forks source link

Missing dependencies RPi.GPIO and Mock #10

Closed ali1234 closed 3 years ago

ali1234 commented 3 years ago

When attempting to install plugin using the plugin manager on octopi 0.18 stable the following error happens:

2021-05-03 20:45:54,303   /home/pi/oprint/bin/python3 -m pip --disable-pip-version-check install file:///tmp/tmp_0eg9bt7/Filament_Scale_Enhanced.zip --no-cache-dir
2021-05-03 20:45:56,801 > Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
2021-05-03 20:45:56,802 > Processing /tmp/tmp_0eg9bt7/Filament_Scale_Enhanced.zip
2021-05-03 20:45:58,780 ! ERROR: Command errored out with exit status 1:
2021-05-03 20:45:58,781 ! command: /home/pi/oprint/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-hlp1on8u/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-hlp1on8u/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-iz4lm_4h
2021-05-03 20:45:58,781 ! cwd: /tmp/pip-req-build-hlp1on8u/
2021-05-03 20:45:58,781 ! Complete output (16 lines):
2021-05-03 20:45:58,782 ! Traceback (most recent call last):
2021-05-03 20:45:58,782 ! File "/tmp/pip-req-build-hlp1on8u/filament_scale_enhanced/hx711.py", line 5, in <module>
2021-05-03 20:45:58,782 ! import RPi.GPIO as GPIO
2021-05-03 20:45:58,782 ! ModuleNotFoundError: No module named 'RPi'
2021-05-03 20:45:58,783 ! 
2021-05-03 20:45:58,783 ! During handling of the above exception, another exception occurred:
2021-05-03 20:45:58,783 ! 
2021-05-03 20:45:58,784 ! Traceback (most recent call last):
2021-05-03 20:45:58,784 ! File "<string>", line 1, in <module>
2021-05-03 20:45:58,784 ! File "/tmp/pip-req-build-hlp1on8u/setup.py", line 5, in <module>
2021-05-03 20:45:58,785 ! from filament_scale_enhanced import __version__
2021-05-03 20:45:58,785 ! File "/tmp/pip-req-build-hlp1on8u/filament_scale_enhanced/__init__.py", line 7, in <module>
2021-05-03 20:45:58,785 ! from .hx711 import HX711
2021-05-03 20:45:58,785 ! File "/tmp/pip-req-build-hlp1on8u/filament_scale_enhanced/hx711.py", line 7, in <module>
2021-05-03 20:45:58,786 ! import Mock.GPIO as GPIO
2021-05-03 20:45:58,786 ! ModuleNotFoundError: No module named 'Mock'
2021-05-03 20:45:58,786 ! ----------------------------------------
2021-05-03 20:45:58,786 ! ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
techman83 commented 3 years ago

I know what's going on here. Issue was hidden from me as I have another plugin that depends on RPi.GPIO. I'll come up with something and release a fix today.

Basically, it's this line: https://github.com/techman83/Filament-Scale-Enhanced/blob/a67b217903f6a06be10aa75f1c516bcd848f3358/setup.py#L5

It is known that this can cause issues, I've just tended to get away with it. There are some common patterns that work around it.

techman83 commented 3 years ago

I've released a fix, v0.2.10. Thanks for reporting!