-
Notifications
You must be signed in to change notification settings - Fork 71
Test python library: dependencies not automatically imported? #484
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
Comments
Python dependencies used to be propagated into a nix-shell. If this no longer works than this is something nixpkgs needs to fix. nixpkgs-review hasn't changed about the way things are imported. |
The only caveat is if you have a lot of changed packages:
in which case we use buildEnv rather where propagation no longer works. |
Hum, weird, I tried and nix-shell (outside nixpkgs review) does propagate the dependencies:
EDIT: To be sure, I also tried with
Could it be related to how the python path is handled? See e.g. #194 |
You can compare your devshell inside nixpkgs-review with your own it's in the current directory. |
Multiple python version maybe cause issues, but it's unclear to me how to handle this use case. |
Oh, I think this is indeed the origin of the problem, as pointed by the other thread. In fact, just doing:
is enough to have a working python, since it will build picos for a single python version. But if we do simply
then it tries to build picos for 2 python versions at once (3.12 and 3.13 here), and then it gets confused. After a bit of search, I could go a bit further: the
while
However, if instead of running the 3.12 version I run the 3.13, it works out of the box!
Unsurprisingly, running instead the 3.12 version fails. Now, when creating a shell with:
the resulting python uses So one (non-working) idea could be to put in the PYTHONPATH the path of both libraries… Sadly, putting both versions in the PYTHONPATH fails, since if we put both, python will take the first library in the path that matches the library name, and then error if the python versions between the library and the binary is not correct:
On the other hand, if we use
then
ConclusionSo I can think of the following solutions:
|
I tried to review a python library (NixOS/nixpkgs#398351) by doing:
But I'm confused by this error since cvxopt is already included in the dependencies of this library:
The fix I found for now is to manually import cvxopt like:
and it works as expected. Yet, I don't understand why I need to do it manually.
The text was updated successfully, but these errors were encountered: