Path: blob/develop/src/sage_setup/command/sage_install.py
4081 views
#########################################################1### Install Jupyter kernel spec2#########################################################34import os5import time67# Import setuptools before importing distutils, so that setuptools8# can replace distutils by its own vendored copy.9import setuptools1011from distutils import log12from distutils.command.install import install13from setuptools.command.develop import develop141516class install_kernel_spec_mixin:1718def install_kernel_spec(self):19"""20Install the Jupyter kernel spec.2122.. NOTE::2324The files are generated, not copied. Therefore, we cannot25use ``data_files`` for this.26"""27from sage.repl.ipython_kernel.install import SageKernelSpec28# Jupyter packages typically use the data_files option to29# setup() to install kernels and nbextensions. So we should use30# the install_data directory for installing our Jupyter files.31SageKernelSpec.update(prefix=self.install_data)323334class sage_install(install, install_kernel_spec_mixin):3536def run(self):37install.run(self)38self.install_kernel_spec()394041class sage_develop(develop, install_kernel_spec_mixin):4243def run(self):44develop.run(self)45if not self.uninstall:46self.install_kernel_spec()474849