Opened 2 years ago
Last modified 3 months ago
#30124 new enhancement
System package information, spkgconfigure for Jupyter "notebook" package, "rst2ipynb", and dependencies
Reported by:  Matthias Köppe  Owned by:  

Priority:  major  Milestone:  sage9.8 
Component:  build: configure  Keywords:  sd111 
Cc:  Dima Pasechnik, Nils Bruin, Samuel Lelièvre, Paul Masson, François Bissey, Emmanuel Charpentier, John Palmieri, Thierry Thomas, Andrew, Nicolas M. Thiéry  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 (26)
comment:1 Changed 2 years ago by
Cc:  Samuel Lelièvre added 

comment:2 Changed 2 years ago by
Cc:  Paul Masson added 

comment:3 Changed 2 years ago by
Cc:  François Bissey added 

comment:4 Changed 2 years ago by
Description:  modified (diff) 

comment:5 Changed 2 years ago by
Cc:  Emmanuel Charpentier John Palmieri Thierry Thomas Andrew added 

Description:  modified (diff) 
Summary:  spkgconfigure for "jupyter" → System information, spkgconfigure for Jupyter "notebook" package and dependencies 
comment:6 followup: 7 Changed 2 years 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 followup: 8 Changed 2 years 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 Changed 2 years ago by
comment:10 Changed 2 years ago by
Dependencies:  → #28197, #30299 

comment:11 Changed 2 years ago by
Branch:  → u/mkoeppe/system_information__spkg_configure_for_jupyter__notebook__package_and_dependencies 

comment:12 Changed 2 years ago by
Commit:  → b8164c135422731f6319d85eb1a52f37440f1b6b 

Summary:  System information, spkgconfigure for Jupyter "notebook" package and dependencies → System package information, spkgconfigure for Jupyter "notebook" package and dependencies 
New commits:
b8164c1  build/pkgs/notebook/spkgconfigure.m4: New

comment:13 Changed 2 years ago by
Description:  modified (diff) 

comment:14 Changed 2 years ago by
Description:  modified (diff) 

comment:15 Changed 2 years ago by
Description:  modified (diff) 

comment:16 Changed 2 years ago by
Description:  modified (diff) 

comment:17 Changed 2 years ago by
Cc:  Nicolas M. Thiéry added 

Description:  modified (diff) 
Summary:  System package information, spkgconfigure for Jupyter "notebook" package and dependencies → System package information, spkgconfigure for Jupyter "notebook" package, "rst2ipynb", and dependencies 
comment:18 Changed 2 years ago by
Milestone:  sage9.2 → sage9.3 

comment:19 Changed 2 years ago by
Description:  modified (diff) 

comment:20 Changed 2 years 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 2 years ago by
Keywords:  sd111 added 

Hoping we can make progress on this ticket this week  https://wiki.sagemath.org/days111
comment:22 Changed 22 months ago by
Milestone:  sage9.3 → sage9.4 

Setting new milestone based on a cursory review of ticket status, priority, and last modification date.
comment:23 Changed 16 months ago by
Milestone:  sage9.4 → sage9.5 

comment:24 Changed 12 months ago by
Milestone:  sage9.5 → sage9.6 

comment:25 Changed 9 months ago by
Milestone:  sage9.6 → sage9.7 

comment:26 Changed 3 months ago by
Milestone:  sage9.7 → sage9.8 

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: