Skip to content
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

Add optional Jupyter kernelspec options from the spec #55989

Merged
merged 2 commits into from Jul 11, 2019

Conversation

thomasjm
Copy link
Contributor

Motivation for this change

The documentation for Jupyter kernels specifies that a few more keys can optionally be added to a kernel spec than are currently supported. This PR adds support for them.

Documentation is here: https://jupyter-client.readthedocs.io/en/stable/kernels.html#kernel-specs

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • [N/A] Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • [N/A] Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • [N/A?] Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@FRidh
Copy link
Member

FRidh commented Feb 18, 2019

This can be done in a cleaner way, by removing from kernel the non-standard arguments, and then adding the computed ones. The result of this can be passed on to toJSON.

@thomasjm
Copy link
Contributor Author

How does this look? There's still a little messiness from converting Nix's camel-case to Jupyter's snake-case.

(I'm guessing there's a "list contains" function somewhere to use with the filtering but I couldn't find it. Is there a more idiomatic Nix way to do this?)

@thomasjm
Copy link
Contributor Author

@FRidh friendly ping on this, any chance it can be merged now?

@thomasjm
Copy link
Contributor Author

@FRidh another ping on this since you mentioned being free on Thursday :).

I think it's as nice and simple as it can get, the remaining complexity is from converting Nix-style camel-case parameters to snake case. Anyway, it shouldn't break any existing code.

@thomasjm
Copy link
Contributor Author

thomasjm commented Jul 2, 2019

@FRidh another ping here, can we land this one now?

@FRidh FRidh merged commit f72d7c4 into NixOS:master Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants