OK, I made some progress on this.
Even to get the kernel working properly for "sage --notebook jupyterlab" I needed to manually run
from sage.repl.ipython_kernel.install import Sage
KernelSpec
SageKernelSpec.update()
I would have expected this to be done for me as it was before.
This ends up installing the kernel in `~/.local/share/jupyter/kernels`. That directory also gets used by the system `jupyter lab` but the kernel as installed doesn't run properly because it assume sage's venv, which isn't active when you just run `jupyter lab`.
I ended up editing the kernel.json to read:
{"argv": ["sage", "--python", "-m", "sage.repl.ipython_kernel", "-f", "{connection_file}"], "display_name": "SageMath", "language": "sage"}
so that the kernel gets started through python as sage starts it (assuming "sage" is in the path).
In particular, the instructions in
don't work properly, because the kernelspec file that is installed assumes the venv is already activated, which is not the case when jupyter is run normally. In fact it shouldn't be: it's entirely possible to have kernels installed that depend on pip --user installs. Those are generally screened out in a venv. So the right thing to do is to run the jupyter server in whatever environment is usual and only activate the venv for the sage kernel.
Something did break recently in the updating of these kernels. I suspect when things got switched over to meson (which still hangs for 4 minutes before proceeding with an install!)