-
Notifications
You must be signed in to change notification settings - Fork 104
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
numpy is a dependency, but this is not declared #406
Comments
Soundfile can indeed be used without numpy, if you use the These were perhaps a bad idea, as almost all people no doubt use soundfile with numpy. But backwards compatibility is a thing, so that's how it is. |
Let me try again, I think I have a better repro. Say I create a brand new fresh venv, and then I install python-soundfile. I then run this ultra-simple script:
This fails with "ModuleNotFoundError: No module named 'numpy'". (So does read().) Looking in setup.py, I find that there is a "numpy" feature in extras_require, and that it does create a numpy dependency. But you only get this if you (?) install with So my "expected behavior" would be one of the following changes:
|
I agree. Let's require numpy for the next version of soundfile. The entire point of the library is to expose a numpy interface to libsndfile. |
python-soundfile requires numpy to run. If numpy is not installed in pip, in my testing python-soundfile will immediately crash on any function invocation with
I understand python-soundfile is usually used with numpy, however, the documentation claims it can be used without it.
My expected behavior is that the library should declare all dependencies in setup.py (soundfile does do this for cffi already) so that pip will install them automatically when installing python-soundfile.
Repro
I have a repro but it is not very convenient. You can check out https://github.com/mcclure/analogue-core-template-amaranth and check out revision cd7c72b. You will want to install "pdm" with pip, and then edit src/fpga/amaranth_core/pyproject.toml to include "soundfile" instead of "pysoundfile" and remove the dependency on numpy, then you can run with
(cd src/fpga/amaranth_core && python.exe -m pdm install && python.exe -m pdm capture_wav)
.The part that uses python-soundfile is here.
Note I only tested this installing numpy with pdm, but my understanding is that uses pip.
The text was updated successfully, but these errors were encountered: