Skip to content

install script's --prefix option isn't used by install_nbextension #7

@d-torrance

Description

@d-torrance

Currently, python3 -m m2_kernel.install --prefix /foo will only install the kernel spec under /foo and not the nbextension.

I'm getting around this by using the following patch, but it would only work if it's known that notebook is installed under /usr.

--- a/m2_kernel/install.py
+++ b/m2_kernel/install.py
@@ -35,7 +35,8 @@
 
     print("Installing nbextension for syntax highlighting ...")
     install_nbextension('{}/m2-mode'.format(assets_dir),
-            nbextensions_dir='{}/static/components/codemirror/mode/'.format(notebook_dir[0]),
+            nbextensions_dir='{}/static/components/codemirror/mode/'.format(
+                notebook_dir[0].replace('/usr', prefix)),
             destination='macaulay2', overwrite=True, symlink=False)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions