-
-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
bash-kernel: fix and add smoke test #311507
Conversation
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.
Haven't tested.
|
||
# Evaluate a test notebook with papermill | ||
cd $(mktemp -d) | ||
${python.withPackages (ps: [ps.papermill])}/bin/papermill --kernel bash ${./test.ipynb} out.ipynb |
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.
so this would fail without bashInteractive ?
I wonder if it should go through passtru.tests or in checkPhase since papermill becomes a new dependency ? without your fixes, the kernel still works but with a funky prompt ? (sry I read a bit fast)
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.
The kernel is totally broken without bashInteractive
. It crashes right away with an error about being unable to parse the prompt.
I don't know about the current best practices regarding passthru.tests
. It seems like a good idea to always run a smoke check to prevent regressions like the one we currently have.
If we do the checkPhase
option, Papermill would only be a build-time dependency right? So users getting it from the Nixpkgs cache wouldn't experience any change.
Description of changes
The
bash-kernel
in Nixpkgs is currently broken due to takluyver/bash_kernel#142.The underlying issue is that
bash-kernel
uses invisible characters in its prompt, which are currently not being output.This PR fixes it by using
bashInteractive
instead ofbash
. I don't totally understand why this fix works--AFAICT, the main difference between the two is thatbashInteractive
has thereadline
library included. In any case, usingbashInteractive
is probably closer to how most people usebash-kernel
, as it just runs whateverbash
is on the PATH.This PR also adds a smoke test, in the form of a test notebook that gets evaluated by Papermill. If this succeeds, we know basic kernel evaluation works.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)CC @zimbatm @teto