Opened 23 months ago
Last modified 3 months ago
#30124 new enhancement
System package information, spkgconfigure for Jupyter "notebook" package, "rst2ipynb", and dependencies
Reported by:  mkoeppe  Owned by:  

Priority:  major  Milestone:  sage9.7 
Component:  build: configure  Keywords:  sd111 
Cc:  dimpase, nbruin, slelievre, paulmasson, fbissey, charpent, jhpalmieri, ghthierryFreeBSD, ghsheerluck, nthiery  Merged in:  
Authors:  Reviewers:  
Report Upstream:  N/A  Work issues:  
Branch:  u/mkoeppe/system_information__spkg_configure_for_jupyter__notebook__package_and_dependencies (Commits, GitHub, GitLab)  Commit:  b8164c135422731f6319d85eb1a52f37440f1b6b 
Dependencies:  #28197, #30299  Stopgaps: 
Description (last modified by )
(From dimpase https://groups.google.com/d/msg/sagedevel/mWTD0_iBwKc/4eKjmINXAQAJ)
We currently cannot use Python packages from the system (see #29023)  and spkgconfigure.m4
is not the right tool for changing that.
However, the situation is different for the Jupyter notebook
package (and its dependencies):
We do not really need to install it in our venv if a suitable version is available in the system. Rather, we should install our kernel into the system/user's jupyter installation (see https://groups.google.com/forum/#!topic/sagedevel/wH7_bru_Q0s/discussion).
Likewise, rst2ipynb
is a Python package but we only provide it to make a script available, not a Python module. So again, if the system provides a suitable version, we do not need to install it in our venv.
notebook
's exclusive dependencies (see #26919, https://github.com/jupyter/notebook/blob/master/setup.py):
terminado
,prometheus_client
,send2trash
argon2cffi
(new dependency)
Shared between notebook
and optional package rst2ipynb
(via nbconvert
):
nbconvert
,nbformat
,jsonschema
,mistune
,entrypoints
,bleach
,pandocfilters
,testpath
,defusedxml
pyrsistent
(new dependency ofjsonschema
)pandoc
,pandoc_attributes
(?)
The following dependencies are shared between notebook
and sagelib
/ipython
/ipykernel
. So we need to install them even if they are present in the system python:
pyzmq
,dateutil
,tornado
,jupyterclient
,jupytercore
,jinja2
,pygments
,ipython_genutils
Packages depending on notebook
:
pari_jupyter
(no system packages: https://repology.org/projects/?search=pari_jupyter&maintainer=&category=&inrepo=¬inrepo=&repos=&families=&repos_newest=&families_newest=)r_jupyter
(script package; https://repology.org/project/r:irkernel/versions)widgetsnbextension
See also:
Change History (25)
comment:1 Changed 23 months ago by
 Cc slelievre added
comment:2 Changed 22 months ago by
 Cc paulmasson added
comment:3 Changed 22 months ago by
 Cc fbissey added
comment:4 Changed 22 months ago by
 Description modified (diff)
comment:5 Changed 22 months ago by
 Cc charpent jhpalmieri ghthierryFreeBSD ghsheerluck added
 Description modified (diff)
 Summary changed from spkgconfigure for "jupyter" to System information, spkgconfigure for Jupyter "notebook" package and dependencies
comment:6 followup: ↓ 7 Changed 22 months ago by
That implies that we will have to ask a jupyter
that is in the PATH
to tell us about its installation PATH
.
If we just call jupyter kernelspec install
then it will install in a user location for a system wide jupyter (~/.local/share/jupyter/kernels
on linux), for a sage jupyter it will probably go to the sage install ({sys.prefix}/share/jupyter/kernels
on linux/OS X). But for distro it will become problematic straight away since you install in a stage before merging in the system tree. It is possible to pass a prefix
but this is not the same as DESTDIR
which would be the useful thing for distros.
comment:7 in reply to: ↑ 6 ; followup: ↓ 8 Changed 22 months ago by
I think we will only need the following changes to sagelib
:
 remove the call to
sage.repl.ipython_kernel.install
from the installation steps done by sagelib'ssetup.py
 it is not compatible with modern python packaging methods anyway  add a
console_script
that installs a kernel spec (usingsage.repl.ipython_kernel.install
), call itsagekernel
(interface similar to: https://ipython.readthedocs.io/en/stable/install/kernel_install.html)  Change
sagenotebook
(which implementssage n
) to a shell script that invokes the correct jupyter (from system if installed in system, from SAGE_LOCAL if installed there)
Calling sagekernel
would be done by sagethedistribution (perhaps in build/pkgs/sagelib/spkginstall
), and likewise by distribution packagers' scripts.
comment:8 in reply to: ↑ 7 Changed 22 months ago by
comment:9 Changed 22 months ago by
comment:10 Changed 22 months ago by
 Dependencies set to #28197, #30299
comment:11 Changed 22 months ago by
 Branch set to u/mkoeppe/system_information__spkg_configure_for_jupyter__notebook__package_and_dependencies
comment:12 Changed 22 months ago by
 Commit set to b8164c135422731f6319d85eb1a52f37440f1b6b
 Summary changed from System information, spkgconfigure for Jupyter "notebook" package and dependencies to System package information, spkgconfigure for Jupyter "notebook" package and dependencies
New commits:
b8164c1  build/pkgs/notebook/spkgconfigure.m4: New

comment:13 Changed 22 months ago by
 Description modified (diff)
comment:14 Changed 22 months ago by
 Description modified (diff)
comment:15 Changed 22 months ago by
 Description modified (diff)
comment:16 Changed 22 months ago by
 Description modified (diff)
comment:17 Changed 22 months ago by
 Cc nthiery added
 Description modified (diff)
 Summary changed from System package information, spkgconfigure for Jupyter "notebook" package and dependencies to System package information, spkgconfigure for Jupyter "notebook" package, "rst2ipynb", and dependencies
comment:18 Changed 22 months ago by
 Milestone changed from sage9.2 to sage9.3
comment:19 Changed 22 months ago by
 Description modified (diff)
comment:20 Changed 19 months ago by
If we attempt to automatically install the Sage jupyter kernel into the system jupyter, for example using jupyter kernelspec install user
as explained in #30476, we should think about how to disambiguate the kernels when working with multiple Sage installations.
comment:21 Changed 18 months ago by
 Keywords sd111 added
Hoping we can make progress on this ticket this week  https://wiki.sagemath.org/days111
comment:22 Changed 16 months ago by
 Milestone changed from sage9.3 to sage9.4
Setting new milestone based on a cursory review of ticket status, priority, and last modification date.
comment:23 Changed 10 months ago by
 Milestone changed from sage9.4 to sage9.5
comment:24 Changed 5 months ago by
 Milestone changed from sage9.5 to sage9.6
comment:25 Changed 3 months ago by
 Milestone changed from sage9.6 to sage9.7
This code from
src/sage/repl/ipython_kernel/install.py
of course needs updating so that we can install the kernel outside of the Sage venv: