python-soundfile
python-soundfile copied to clipboard
why libsndfile is not packed into the Linux wheels
Hi!
What is the reason for libsndfile
system library not being packed into the wheels for Linux, as it is done for Mac and Windows?
We'd like to use new pysoundfile
mp3 support in the Hugging Face Datasets library, but currently it requires building libsndfile==1.1.0
from source as this version cannot be installed via a package manager. And building libsndfile
from source is not super convenient for most of the users.
@bastibe I probably misunderstood the idea before, for Mac and Windows you compile libsndfile binaries yourself and install them separately along with with pysoundfile
library, right? Isn't it possible to just put it in the python wheel prebuilt?
As far as I'm aware, building cross-distribution libraries is very easy to get wrong. If you show me how to build the libraries reliably and portably on Linux, I'll gladly add those binary wheels.
Maybe manylinux can help ? They have an example repository here to build wheels for many linux distros at the same time
https://github.com/pypa/python-manylinux-demo
I've found some explanation and instructions here: https://realpython.com/python-wheels/#bundling-shared-libraries As far as I understand, this is the way to put C binaries inside a python wheel for more or less any Linux variant, so that users don't need to bother with their installation via a package manager themselves.
Fascinating! Thank you! I'll have a look.
If you'd like to take a stab at it, I'd be extremely grateful for a pull request to https://github.com/bastibe/libsndfile-binaries/, either with pre-built libsndfile binaries, or better yet, with a CI script for generating them.
I am definitely not an expert in this area but isn't this a case where cibuildwheel
could help?
https://cibuildwheel.readthedocs.io/en/stable/#usage
Many examples here: https://cibuildwheel.readthedocs.io/en/stable/working-examples/
Just so you know, I probably won't have much time to devote to this in the near future. So if anyone wants to take a stab at the CI script over at https://github.com/bastibe/libsndfile-binaries/, I'd be more than grateful for a pull request.
Work for this is ongoing in https://github.com/bastibe/libsndfile-binaries/pull/17