adafruit / Adafruit_Blinka

Add CircuitPython hardware API and libraries to MicroPython & CPython devices
https://learn.adafruit.com/circuitpython-on-raspberrypi-linux
MIT License
439 stars 327 forks source link

Add better error message and explicity add to setup #714

Closed makermelissa closed 9 months ago

makermelissa commented 9 months ago

Fixes #599.

caternuson commented 9 months ago

Looks like there are two things here? The changes to setup.py look like they are adding Adafruit_BBIO as a dependency? That seems OK, and would hopefully eliminate the original ImportError? This is essentially fixing a missed dependency, which seems like the actual underlying issue here. (if i understand it correctly)

The changes to pin.py are OK I guess. But it's basically just capturing one exception and turning it into another and saying the same thing again? This message from original issue thread should be enough to indicate what the issue is:

ModuleNotFoundError: No module named 'Adafruit_BBIO'

It gives the module name and says it's not found. We can leave these changes to pin.py in if it seems like the extra info in the text message will help. But should the exception type be changed?

makermelissa commented 9 months ago

The reason I made the change to the error message is because multiple people got confused and had difficulty finding out how to fix the error, so the new message tells them how to fix it. The change to setup.py is to make it so they are less likely to run into issues in the first place.

caternuson commented 9 months ago

OK. I guess the additional from error will help keep it tied to the original underlying exception.