-
Notifications
You must be signed in to change notification settings - Fork 496
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
Make the use of libusb-package optional #1332
Conversation
Any idea for promoting users to install libusb upon the user doing |
Not from the top of my head. In systems packaging this is easy due to system-wide dependency management. |
@elfmimi That's basically what libusb-package was intended to solve. 😄 Users no longer need to worry about installing libusb. @dvzrv For distro packages, I totally understand the requirement to use the distro-installed libusb. It only makes sense. How to handle distros was actually something under consideration when designing libusb-package, at least at a high level. The distro version of libusb-package should return the distro libusb. (And if the user separately installs libusb-package from PyPI, the user gets the prebuilt wheel containing libusb.) This is the path I'd much prefer to take. libusb-package supports being installed without a contained copy of libusb, a so-called "empty install". In this case, it will always fall back to asking for the system libusb via The part that's missing is a way to force an empty install. But is this even needed? How do you generate a distro package of a Python package? If you can just take the libusb-package source from the repo, then there's nothing additional needed—it will be an empty install by default. A more advanced option would be to install a symlink to the distro libusb .so in order to explicitly pin libusb-package to that libusb version. |
I know. I know, kind of, I asked for it. |
Yes, we do not want to rely on precompiled shared libraries, but on system libraries that can be built reproducibly and be used by more than one application.
We usually go the PEP517 route these days. Packaging guidelines for python on Arch Linux can be found in the wiki. |
When I tried to install It would mean new dependency for |
As there is only limited time to deal with packages, I wonder what there is left to do with this PR. Operating systems which require the bundling of libusb to make this work can still rely on @flit This means libusb-package could become a dependency only for specific operating systems (e.g. windows and/or macOS). However, at this point I am still asking myself why this is needed at all. Have you tried to reach out to https://github.com/pyusb/pyusb, as that project has been around for a long time and libusb-package looks like duplicated effort if pyusb could just add wheels bundling libusb.
@diggit But this is precisely the point. I maintain over 700 packages for Arch Linux. Why would I want to package yet another wrapper around libusb if there is already pyusb? |
0b980cf
to
8b329d7
Compare
@flit I have rebased on latest default branch. Please have a look |
please |
Attempt to import libusb-package's `find()` function, else fall back to using pyusb's `find()` function. This allows to use pyusb by just removing the project's requirement on libusb-package, as python-pyusb and libusb packaging go hand-in-hand on Linux distributions.
8b329d7
to
38998a1
Compare
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.
woops, I forgot to give the ✅ before merging.
pyocd/probe/*:
Attempt to import libusb-package's
find()
function, else fall back to using pyusb'sfind()
function.This allows to use pyusb by just removing the project's requirement on libusb-package, as python-pyusb and libusb
packaging go hand-in-hand on Linux distributions.
Related to #1331