darrylb123 / usbrelay

Control usb relay - based on hidapi
GNU General Public License v2.0
316 stars 98 forks source link

usbrelay_py installation & usage experience #105

Closed hovercraft-github closed 1 year ago

hovercraft-github commented 1 year ago
  1. Looks like it is not compatible with python setuptools>=50, resulting in "ImportError: cannot import name 'setuptools' from 'setuptools'" error, so I had to edit usbrelay_py/pyproject.toml file and replace "setuptools>=42" with "setuptools==42" to be able to build the python library.
  2. Appear that call to usbrelay_py.board_count() is mandatory to initialize the library, may be mention this in the doc?
darrylb123 commented 1 year ago

I have confirmed your bug report. I don't know enough about python to 'fix' the issue. A fix would be that it works with newer versions of setuptools. Your workaround will suffice until I can find an answer. It appears that you need to call count() or details() first to initialise things. I'll add it to the doco.

darrylb123 commented 1 year ago

I've found the solution to building on later versions of setuptools. Trouble is, it is incompatible with versions < 49. Setting is now >=49