-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
pythonPackages.jupyterhub: Fix running locally #58542
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
Conversation
There's no |
@dotlambda Hmm it is in dev-requirements.txt |
I did find jupyterhub/jupyterhub@0414a0be which removed |
Ah yeah, they mention it in the readme:
So it's only an optional dependency for local servers |
Why it doesn't work by adding |
@jluttine Because it gets wrapped with a PYTHON_PATH that contains exactly the packages that were declared in the build. |
Ok. So one should write an overlay to modify the build inputs if running the notebook servers locally? That sounds like something that should perhaps be made a bit simpler because it's probably a typical usecase. Not sure how though. |
@jluttine Well this PR fixes it, so if this gets merged you don't have to do anything to get it running. If you want to get it running without this PR, you can use the following overlay, which looks totally ridiculous, but actually is the "proper" way to override stuff like that: self: super: {
python3 = super.python3.override (old: {
packageOverrides = super.lib.composeExtensions (old.packageOverrides or (pself: psuper: {}))
(pself: psuper: {
jupyterhub = psuper.jupyterhub.overrideAttrs (old: {
propagatedBuildInputs = old.propagatedBuildInputs or [] ++ [
pself.notebook
];
});
});
});
} |
Thanks! That's what I thought that proper overriding is probably a bit tedious for the typical usecase. But in a way this pull request isn't the "correct" fix either because |
Alright, seems sensible. Could we add a comment on why notebook is there so that it isn't removed in the future? |
We usually include optional dependencies if it's requested. |
To me, adding I tested and it indeed fixes the issue and now Jupyter Hub is running fine. About the alternative, if I understand correctly, the dependency of |
I've sometimes seen some optional arguments to derivations, something like: |
@jluttine These arguments would be overwritten with |
Sounds good. |
12f940b
to
0b31827
Compare
It isn't since when used as a library, |
@dotlambda Ah, true! Thanks for clarifying! I would merge this either as it is now, or add |
Backported to 19.03 in a05b0cf |
A bit related issue I now encountered: #58662 |
Motivation for this change
Fixes #58540
Ping @jluttine
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after) 277.8MB -> 325.1MB (+17%)