-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migration to libusb1 and changes to make it compatible with Python on Windows #274
Migration to libusb1 and changes to make it compatible with Python on Windows #274
Conversation
Hi, thank you for your contribution :-) I'm going to have a look at it later.
|
Thank you, AUTHORS corrected. :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added some questions in the code.
All in all the changes look good to me, however I don't have a USB-device so maybe somebody could check it in person?
@br0th3r could you please explain the difference between pyusb and libusb1? As far as I see it, pyusb>=1 also uses libusb1.x as backend and should also work on Windows.
if check_driver is None or check_driver: | ||
try: | ||
self.device.detach_kernel_driver(0) | ||
except usb.core.USBError as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to also check for this exception in your code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if this is necesary with libusb1.
@@ -107,7 +107,7 @@ def run_tests(self): | |||
'Topic :: Office/Business :: Financial :: Point-Of-Sale', | |||
], | |||
install_requires=[ | |||
'pyusb>=1.0.0', | |||
'libusb1', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are all versions of this lib OK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't checked other versions of libusb1.
Pyusb didn't work on Windows for me after 10h trying on several ways. Reading on Internet I got to know that there several differences between the API v0.1 and v1.x of libusb1 and Pyusb is not compatible with the latest which happens to work properly on Windows. I have checked this library on Linux and Windows 7 for an EPSON TM-T20II (MODEL M267D) and it worked like a charm. :-) |
So if nobody opposes I would merge this in the coming days. |
Is possible to extend support for libusb1 without dropping pyusb? |
I will research how to set optional dependencies for a Python package. This way we could use both libraries. What bothers me a bit now is that I think I remember that pyusb allegedly supports libusbv1. |
It seems possible to specify platform-dependant requirements. https://stackoverflow.com/a/32955538/4244236 https://stackoverflow.com/a/42946495/4244236 |
… Windows
Contributor checklist
Description