Closed rgbkrk closed 7 years ago
If you're happy with this, then I'd love to adapt install to set this as the kernelspec as well.
Neat solution!
@rgbkrk Sorry for the late response. This approach is a very nice solution.
As you mentioned above, the spec needs updating. To do so, change these lines to:
context.args.kernel = [
(process.platform === 'win32) ? 'ijskernel.cmd' : 'ijskernel',
];
Made the change you requested @n-riesco
I've tested this PR and I've run into problems when ijskernel
isn't installed in one of the folders listed in PATH
.
I've tried to use __dirname
, but it points to the IJavascript folder (it doesn't point to the .bin
folder where ijskernel
is installed).
This is how I suggest that we proceed:
--ijs-install=global
).If you don't have the time, I can do this second PR.
If you want to add commits on to this one, that's a-ok with me (allow edits from maintainers is checked). I can also tackle this - commit c44c074 was introduced based on your feedback. I'd love to see the ijskernel
in the kernelspec when kernel installed globally part, haven't looked into how that would work here.
@rgbkrk To be clear, I'm not opposed to merging this PR. I'm only trying to avoid regressions.
After some more thought, I don't think overloading the meaning of --ijs-install=global
is a good a idea, because installing a kernel spec globally doesn't ensure the kernel binary has also been installed globally.
This is what I'm planning to do:
--ijs-spec-path=[none|full]
. Since in README.md I'm recommending a global installation (sudo npm install -g ijavascript
) and thus --ijs-spec-path=none
should work, I'm planning to use none
as a default.Before I publish a new release, I'd like to hear any arguments against using --ijs-spec-path=none
as a default.
At the moment, these are the only arguments I've thought of:
--ijs-spec-path=none
doesn't work for local installations (i.e. npm install ijavascript
)--ijs-spec-path=full
requires the re-installation of IJavascript's kernel spec (i.e. re-running ijs
), whenever the location of node
changes.I haven't been using any of these options, though it seems I've needed them -- I've been running ijs then closing the notebook server that comes up to install the kernel.
Thanks for the discussion on this and paving a path forward.
@rgbkrk Another flag that it's very convenient to preload libraries in Node session is --ijs-startup-script=[file.js|folder]
This makes it so that
ijskernel
can be used directly as a bin script, which makes my local kernel.json much easier to work with when I'm changing node versions:For me, this makes #67 much easier to deal with. Now, every time I upgrade node with
nvm
, I globally installijavascript
again and it just works because it's not reliant on a hardcoded path to my node version + the library location.On windows, the kernelspec is:
/cc @thisgeek @c22