Mypy Support?
I've got a WIP implementation of mypy type stubs for this package in https://github.com/adbpy/transports/commit/43a26a801bfd7582a9da964e9806191ff6b8a3aa.
I haven't finished them yet but I'm opening this issue to get the conversation going. Is this something you would be interested in taking upstream once complete? Otherwise, I'll look into breaking them out into a separate stubs-only package.
I am interested in taking these here, yes.
I am not sure whether I would prefer separate .pyi files or comment-style annotations though: I would tend to prefer the type declarations to be immediately visible while editing the code. But this means doing (part of) the work 3 times: the work you are already doing (where stubs make perfect sense), then converting to comments when upstreaming, then eventually converting them to py3 annotations once 2.7 support goes away (I believe I should still keep it around some more).
I am not familiar with mypy, though, so I am not used to its best-practices, or maybe there is some tool to convert between annotation types.
I know https://github.com/ilevkivskyi/com2ann exists for converting py2 comment types to py3 but I am unaware of a tool that does the reverse.
For reference, support for comment based types is oulined in https://mypy.readthedocs.io/en/stable/python2.html. I would have to do some research but I am currently unaware of how we would use comment based types for all of the dynamic exports defined in __all__, e.g. converting LIBUSB_CLASS_PER_INTERFACE to CLASS_PER_INTERFACE and dynamically creating the USBErrorXYZ exceptions classes.
In any case, I'll continue work to finish up the stubs as best I can and we can go from there.
Maybe it is time to drop Python 2.7 support now (as well as Python 3.5 or older).