#25384 closed enhancement (fixed)

Let `sage --jupyter` call the Jupyter in Sage

Reported by: mlapointe Owned by:
Priority: major Milestone: sage-8.7
Component: packages: standard Keywords: thursdaysbdx; jupyter nbconvert
Cc: nthiery, slelievre Merged in:
Authors: Sébastien Labbé Reviewers: Samuel Lelièvre
Report Upstream: N/A Work issues:
Branch: 1f208f2 (Commits) Commit: 1f208f244d9ffa4c6a5f24a4c064cd7a73bc2fe1
Dependencies: Stopgaps:

Description (last modified by slelievre)

We should make it so that sage --jupyter calls the jupyter shipped by Sage, and thus make it possible to do things like

sage --jupyter kernelspec install /path/to/some_jupyter_kernel

and so on.

Likewise, the following converts a ipynb file to a html slides presentation:

sage -ipython nbconvert filename.ipynb --to slides 
[TerminalIPythonApp] WARNING | Subcommand `ipython nbconvert` is deprecated and will be removed in future versions.
[TerminalIPythonApp] WARNING | You likely want to use `jupyter nbconvert` in the future

and it would be nice to be able to run

sage --jupyter nbconvert filename.ipynb --to slides

but it currently gives the following error:

sage-run received unknown option: --jupyter
usage: sage [options]
Try 'sage -h' for more information.

The list of external programs we can run with sage -<program> or sage --<program> is obtained by running

sage --advanced

Change History (9)

comment:1 Changed 19 months ago by slelievre

  • Description modified (diff)
  • Summary changed from jupyter nbconvert unknown option to let `sage --jupyter` work call the Jupyter in Sage

Original summary of this ticket: "jupyter nbconvert unknown option"

It's not that jupyter nbconvert is not known, it's that we don't provide sage --jupyter (we should!).

comment:2 Changed 19 months ago by slelievre

  • Cc nthiery slelievre added

comment:3 Changed 19 months ago by slelievre

  • Description modified (diff)
  • Summary changed from let `sage --jupyter` work call the Jupyter in Sage to let `sage --jupyter` call the Jupyter in Sage

comment:4 Changed 19 months ago by embray

  • Type changed from defect to enhancement

I wouldn't say it's a defect. It's just not a feature that exists in the command-line interface. You can run any shell command in Sage's environment with sage -sh <whatever>. But I agree it would be a useful one to exist.

I've actually been thinking again lately about how to redesign Sage's command-line interface (both the UI and the implementation) but that's not a new subject, and it's pretty low priority. Adding a new flag for a specific executable is not a big deal though.

comment:5 Changed 16 months ago by vdelecroix

  • Milestone changed from sage-8.3 to sage-8.4

update milestone 8.3 -> 8.4

comment:6 Changed 11 months ago by slabbe

  • Authors set to Sébastien Labbé
  • Branch set to u/slabbe/25384
  • Commit set to 1f208f244d9ffa4c6a5f24a4c064cd7a73bc2fe1
  • Status changed from new to needs_review

New commits:

1f208f225384: sage --jupyter command line

comment:7 Changed 11 months ago by nthiery

I haven't tested it, but the diff looks fine. And I am +++1 on the feature! Thank you Sébastien!

comment:8 Changed 11 months ago by slelievre

  • Milestone changed from sage-8.4 to sage-8.7
  • Reviewers set to Samuel Lelièvre
  • Status changed from needs_review to positive_review
  • Summary changed from let `sage --jupyter` call the Jupyter in Sage to Let `sage --jupyter` call the Jupyter in Sage

Tried it. Works fine for me. Much appreciated!

comment:9 Changed 11 months ago by vbraun

  • Branch changed from u/slabbe/25384 to 1f208f244d9ffa4c6a5f24a4c064cd7a73bc2fe1
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.