-
Notifications
You must be signed in to change notification settings - Fork 137
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
dotnet kernel for C# and F# #547
Conversation
✅ Deploy Preview for tweag-jupyterwith ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@anpin Thanks for your contributing. once you solve the CI to be green, I will merge your PR. |
After merging this PR, we should have a plan to migrate the poetry to the dream2nix. like https://github.com/hardenedlinux/AISecurity-Research-Template/blob/main/flake.nix |
removed dotnet-sdk from |
that's weird. can't reproduce these failures locally. |
@anpin Did you run this command |
added openssl and zlib to runtimeDeps, maybe that will fix CI |
pname = "Microsoft.dotnet-interactive"; | ||
version = "1.0.556801"; | ||
|
||
nugetSha256 = "sha256-tABt/DltggX85SZaaZK7ZP+L3EqxEh0fZ1pfB4MOtxk="; |
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.
Eventually this should be upstreamed to nixpkgs and built from source
I just realized I have nix-ld on my machine. Maybe that’s why it doesn’t fail. Will try to run without it later.
|
I disabled nix-ld and reverted the last commit with runtimeDeps, but that did not make it fail. The kernel test executed successfully. I managed to use |
If running test.py in nix falke check is desired by maintainers I can submit separate PR or include it in this one. Here is the gist of it diff --git a/flake.nix b/flake.nix
index c5d35a5..3a4f4ed 100644
--- a/flake.nix
+++ b/flake.nix
@@ -133,6 +133,40 @@
exampleJupyterlabAllKernelsNew =
jupyterLib.mkJupyterlabNew (builtins.attrValues examples);
+
+ checkKernel = name: example:
+ with import (nixpkgs + "/nixos/lib/testing-python.nix") {inherit system;}; let
+ kernel = jupyterLib.mkJupyterlabNew example;
+ test_py = (builtins.dirOf example) + "/test.py";
+ in
+ makeTest {
+ inherit name;
+ nodes.machine = {config, ...}: {
+ config = {
+ environment.systemPackages = [kernel];
+ };
+ };
+ testScript = ''
+ machine.execute("${kernel}/bin/python ${test_py}")
+ '';
+ };
+ exampleCheck = (
+ lib.mapAttrs'
+ (
+ name: value:
+ lib.nameValuePair
+ ("check-" + name)
+ (checkKernel name value)
+ )
+ examples
+ );
in {
lib =
jupyterLib
@@ -163,9 +197,11 @@
${pre-commit.shellHook}
'';
};
- checks = {
- inherit pre-commit;
- };
+ checks =
+ {
+ inherit pre-commit;
+ }
+ // exampleCheck;
apps = {
update-poetry-lock =
flake-utils.lib.mkApp
|
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.
LGTM
thanks for merging it @GTrunSec! I've added another commit with above patch which allows to test any kernel via |
This PR adds dotnet kernel to C# and F# languages in jupyter notebooks.
This PR depends on refactorings made in #524
Closes #393