-
-
Notifications
You must be signed in to change notification settings - Fork 510
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
Rewrite jupyter kernel installation code using KernelSpecManager, create kernel install script (entry point) #30298
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Dependencies: #30299 |
comment:6
If I recall correctly, the main issue that arises if you want to install the sagemath kernel in the default way is that files are copied. That includes the "doc" directory, which is huge. Making it a symlink works much better. Or perhaps the documentation shouldn't be part of the kernelspec in |
This comment has been minimized.
This comment has been minimized.
comment:8
Replying to @nbruin:
Thanks. I see the symlink |
comment:9
I think it gets linked in the help menu. By the looks of it, the standard Python3 kernel populates that help menu with external links to the python website. I suspect this locally hosted approach was taken to make sagemath more functional in offline settings (which do happen, particularly in more remote places where internet connections aren't so plentiful or are unreliable) I think the kernelspec is NOT the place to host this doc. Perhaps this was chosen as a spot that's guaranteed to be accessible by the kernel, and possibly a place that's not problematic to serve files from? I'm actually a little surprised: you'd think the kernel config directory is exactly what you DON'T want a web server to serve. Generally, I'd say serving /usr/local/doc shouldn't be much of a problem, so perhaps just not symlinking and serving SAGE_DOC instead? I guess looking around the jupyter ecosystem a bit to see what solutions other projects come up with ... |
comment:10
Thanks. If it turns out that this symlinking business is indispensable, we could go for the following solution:
|
comment:11
Replying to @nbruin:
Yes, and I think it's important to preserve fully offline operation as a feature. |
comment:12
I think packaging the built HTML documentation as an nbextension could also be a solution. This would facilitate remote sage kernels as described in #30306 (3). |
comment:14
Replying to @mkoeppe:
isn't copying/building the docs and optionally deleting the installation source the normal way to install software docs? |
comment:15
See #30306 for the full context of this discussion. |
comment:16
Replying to @dimpase:
It's about the location. Sure, installing the docs Installing the sagemath kernel in jupyter produces a link to it in Telling the standard jupyter install_kernel machinery to make Other kernels do seem to make doclinks available in the help menu, but they are links to the actual documentation hosted by the project; so not a local copy. It looks like a symlink was an easy solution to make the docs available to jupyter to serve without copying them over. But it seems that having a symlink in the |
comment:18
Hoping we can make progress on this ticket this week - https://wiki.sagemath.org/days111 |
Changed keywords from none to sd111 |
comment:19
Setting new milestone based on a cursory review of ticket status, priority, and last modification date. |
comment:24
From #33855 comment:5: The kernel might also be missing in the wheels. Best to redo the kernelspec generation/installation similar to https://github.com/ipython/ipykernel/blob/main/setup.py#L108 When building a wheel, the symlink |
We make the following change to
sagelib
:console_script
that installs a kernel spec (usingsage.repl.ipython_kernel.install
), similar toipykernel.kernelspec
(https://github.com/ipython/ipykernel/blob/f2e9895a6217c53c3912a0fdeb306a8316fd62fd/ipykernel/kernelspec.py), usingjupyter_client.kernelspec.KernelSpecManager
for the actual installation.References:
Distributing Jupyter Extensions as Python Packages — Jupyter Notebook 6.1.1 documentation
https://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/Distributing%20Jupyter%20Extensions%20as%20Python%20Packages.html
ipykernel/kernelspec.py at f2e9895a6217c53c3912a0fdeb306a8316fd62fd · ipython/ipykernel
https://github.com/ipython/ipykernel/blob/f2e9895a6217c53c3912a0fdeb306a8316fd62fd/ipykernel/kernelspec.py
ipykernel/setup.py at f2e9895a6217c53c3912a0fdeb306a8316fd62fd · ipython/ipykernel
https://github.com/ipython/ipykernel/blob/f2e9895a6217c53c3912a0fdeb306a8316fd62fd/setup.py
Depends on #33855
CC: @dimpase @nbruin @slel @paulmasson @kiwifb @EmmanuelCharpentier @jhpalmieri
Component: build
Keywords: sd111
Issue created by migration from https://trac.sagemath.org/ticket/30298
The text was updated successfully, but these errors were encountered: