Skip to content

Versioned installation of threejs #30972

@paulmasson

Description

@paulmasson

From Matthias Koeppe on #30915:

When we start using Sage with a system jupyter notebook (Meta-ticket #30306), there is an issue involving the installation directory share/jupyter/nbextensions/threejs, and the fact that there will be several unrelated (and possibly mutually incompatible) copies of that.

Here is an example.

Let's say:

  • system jupyter is installed in /usr, so the notebook server is accessing /usr/share/jupyter/nbextensions.
  • Sage-9.x may be installed in /home/x/sage-9.x/local/ and may need threejs r122.
  • Sage-9.y may be installed in /home/x/sage-9.y/local/ and may need threejs r155.
  • Let's say r122 and r155 are mutually incompatible.

As @enriqueartal has reported in #30915, our offline threejs graphics needs /usr/share/jupyter/nbextensions/threejs/. But the system does not provide it -- it is only provided by Sage (and, after #30915 is the result of a custom build (fork) of threejs).

If we create a symlink /usr/share/jupyter/nbextensions/threejs -> /home/x/sage-9.x/local/share/jupyter/nbextensions/threejs, then Sage 9.x will work with the system jupyter notebook; but Sage 9.y will not.

This means that we need a versioned installation scheme so that offline threejs graphics can access the specific version it needs even if the user is accessing Sage through the system notebook.

In this ticket we also rename directories from threejs to threejs-sage (in share/ and share/jupyter/nbextensions/) to reflect the fact that it is a Sage-specific fork. This will reduce the need for downstream patching.

(On this ticket we ignore the separate issue that installing such symlinks is not user-friendly -- see #30123 Repackage Sage's cropped threejs as a pip-installable package jupyter-threejs-sage for a follow-up.)

CC: @jcamp0x2a @kiwifb @mkoeppe @EmmanuelCharpentier @enriqueartal @jhpalmieri @seblabbe @antonio-rojas @defeo @novoselt @dimpase

Component: graphics

Keywords: threejs, jsmol, jupyter, sd111

Author: Matthias Koeppe, Joshua Campbell

Branch/Commit: 935dcef

Reviewer: Joshua Campbell, Matthias Koeppe, Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/30972

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions