Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
build/pkgs/sagelib/spkg-install: Do installation of sagemath kernelsp…
Browse files Browse the repository at this point in the history
…ec here, not in sage_setup.command.sage_install
  • Loading branch information
Matthias Koeppe committed May 16, 2022
1 parent 6c5903d commit 40b44a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 23 deletions.
7 changes: 4 additions & 3 deletions build/pkgs/sagelib/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ export SAGE_SHARE=/doesnotexist
# uses this variable.
# export SAGE_LOCAL=/doesnotexist

# Trac #30903: We cannot poison SAGE_DOC because setup.py installs the Jupyter kernel
# spec, which includes setting a symlink to the installed documentation.
# export SAGE_DOC=/doesnotexist
export SAGE_DOC=/doesnotexist

SITEPACKAGESDIR=$(python3 -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])')
if [ "$SAGE_EDITABLE" = yes ]; then
Expand All @@ -55,6 +53,9 @@ else
time python3 -u setup.py --no-user-cfg build install || exit 1
fi

# Install sagemath kernel spec, including symlink to documentation
python3 -c 'from sage.repl.ipython_kernel.install import SageKernelSpec; SageKernelSpec.update()'

# Trac #33103: The temp.* directories are large after a full build.
# We remove them to save space; they are not needed for fast rebuilds.
rm -rf build/temp.*
Expand Down
21 changes: 1 addition & 20 deletions src/sage_setup/command/sage_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,7 @@
from distutils.command.install import install

class sage_install(install):

def run(self):
install.run(self)
self.install_kernel_spec()

def install_kernel_spec(self):
"""
Install the Jupyter kernel spec.
.. NOTE::
The files are generated, not copied. Therefore, we cannot
use ``data_files`` for this.
"""
from sage.repl.ipython_kernel.install import SageKernelSpec
# Jupyter packages typically use the data_files option to
# setup() to install kernels and nbextensions. So we should use
# the install_data directory for installing our Jupyter files.
SageKernelSpec.update(prefix=self.install_data)

pass

class sage_clean(install):

Expand Down

0 comments on commit 40b44a1

Please sign in to comment.