Skip to content

Commit

Permalink
Add pypy3 sample environment
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjm committed Oct 2, 2024
1 parent e37022e commit ea7ebb0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/kernels/python/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

, python3

, name

, settings
, settingsSchema
}:
Expand All @@ -22,7 +24,7 @@ let
hasPythonLspServer = python: (lib.hasAttr "python-lsp-server" python.pkgs) && (lib.versionAtLeast python.pythonVersion "3.7");
hasPythonLanguageServer = python: lib.hasAttr "python-language-server" python.pkgs;

displayName = "Python " + python3.version;
displayName = name + " " + python3.version;
kernelName = "python3";

packageOptions = python3.pkgs;
Expand Down
4 changes: 4 additions & 0 deletions modules/kernels/python/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ in
else lib.getAttr x config.pkgs;
in
config.pkgs.callPackage ./. {
name = "Python";

python3 = basePython;

settings = config.kernels.python3;
Expand All @@ -142,6 +144,8 @@ in
(mkIf config.kernels.pypy3.enable {
builtKernels.pypy3 =
config.pkgs.callPackage ./. {
name = "PyPy";

python3 = lib.getAttr config.kernels.pypy3.python3Package config.pkgs;

settings = config.kernels.pypy3;
Expand Down
1 change: 1 addition & 0 deletions sample_environments.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ args: {
mega = import ./sample_environments/mega.nix args;
octave = import ./sample_environments/octave.nix args;
postgres = import ./sample_environments/postgres.nix args;
pypy3 = import ./sample_environments/pypy3.nix args;
python3 = import ./sample_environments/python3.nix args;
r = import ./sample_environments/r.nix args;
ruby = import ./sample_environments/ruby.nix args;
Expand Down
13 changes: 13 additions & 0 deletions sample_environments/pypy3.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{ codedown
, channels ? {}
, ...
}:

codedown.makeEnvironment {
kernels.pypy3.enable = true;
kernels.pypy3.packages = [
"matplotlib"
"scipy"
"rope"
];
}

0 comments on commit ea7ebb0

Please sign in to comment.