#25546 closed enhancement (fixed)

Install Jupyter kernel in the correct prefix

Reported by: jdemeyer Owned by:
Priority: major Milestone: sage-8.3
Component: distribution Keywords:
Cc: gh-timokau, fbissey Merged in:
Authors: Jeroen Demeyer Reviewers: Vincent Klein
Report Upstream: N/A Work issues:
Branch: ad0ee29 (Commits) Commit: ad0ee291941aca37c7b7f743cc9f915fee9170b8
Dependencies: Stopgaps:

Description (last modified by jdemeyer)

The Sage Jupyter kernel is unconditionally installed in sys.prefix. However, this should instead be the install_data directory. This defaults to the installation prefix, which in turn defaults to sys.prefix. So the default won't change, but it allows customization.

The reason for choosing install_data is to be compatible with other Jupyter packages, which use the data_files option to setup() for installing Jupyter files (see for example https://github.com/jupyter-widgets/ipywidgets/blob/master/widgetsnbextension/setup.py#L203). Those files are installed in the install_data directory.

Change History (12)

comment:1 Changed 18 months ago by jdemeyer

  • Branch set to u/jdemeyer/ticket/25546

comment:2 Changed 18 months ago by jdemeyer

  • Cc fbissey added
  • Commit set to ad0ee291941aca37c7b7f743cc9f915fee9170b8
  • Status changed from new to needs_review

New commits:

ad0ee29Install Jupyter kernel in install_data directory

comment:3 Changed 18 months ago by jdemeyer

  • Description modified (diff)

comment:4 Changed 18 months ago by fbissey

That looks like it may greatly simplify my life. I have still one issue about the current setup but it is comparatively minor - I think the code installing the kernel should live under sage_setup since you are not supposed to use it at runtime. But that can wait.

comment:5 follow-ups: Changed 18 months ago by gh-timokau

What is the install_data directory? Is that variable documented somewhere?

comment:6 in reply to: ↑ 5 ; follow-up: Changed 18 months ago by fbissey

Replying to gh-timokau:

What is the install_data directory? Is that variable documented somewhere?

It's a standard distutils command it is mentioned on this page for example https://wiki.python.org/moin/Distutils/Tutorial.

comment:7 Changed 18 months ago by jdemeyer

  • Description modified (diff)

comment:8 in reply to: ↑ 5 ; follow-up: Changed 18 months ago by jdemeyer

Replying to gh-timokau:

What is the install_data directory? Is that variable documented somewhere?

I don't know whether it's documented, but it's the directory where data_files are installed. As I explained in the ticket description, it's certainly the right directory to use.

comment:9 in reply to: ↑ 6 Changed 18 months ago by jdemeyer

Replying to fbissey:

https://wiki.python.org/moin/Distutils/Tutorial.

I think that page takes about about install_data command, not the install_data directory.

comment:10 in reply to: ↑ 8 Changed 18 months ago by gh-timokau

Replying to jdemeyer:

Replying to gh-timokau:

What is the install_data directory? Is that variable documented somewhere?

I don't know whether it's documented, but it's the directory where data_files are installed. As I explained in the ticket description, it's certainly the right directory to use.

I can't even find the default value of that variable by grepping through the distutils source. However as long as it is relative to --prefix, thats fine by me and should solve #25328.

Last edited 17 months ago by gh-timokau (previous) (diff)

comment:11 Changed 17 months ago by vklein

  • Reviewers set to Vincent Klein
  • Status changed from needs_review to positive_review

Tested. It works for me.

comment:12 Changed 17 months ago by vbraun

  • Branch changed from u/jdemeyer/ticket/25546 to ad0ee291941aca37c7b7f743cc9f915fee9170b8
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.