From 2f5612fd02d225397ab6a6d558728ded7b74c4cd Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Tue, 16 Jan 2018 14:51:56 +0100 Subject: [PATCH] setup.py : remove the use of install_nbextension As install_nbextension seems to be buggy see (https://github.com/jupyter/notebook/issues/1706). - Remove the call of install_nbextension - Use data_files instead with fixed path (old paths where wrongs) --- setup.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index bb3b1b4..017f7aa 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ class install(_install): def run(self): - from notebook.nbextensions import enable_nbextension, install_nbextension + from notebook.nbextensions import enable_nbextension # run from distutils install _install.run(self) @@ -36,14 +36,10 @@ def run(self): os.chmod(td, 0o755) # Starts off as 700, not user readable with open(os.path.join(td, 'kernel.json'), 'w') as f: json.dump(kernel_json, f, sort_keys=True) - path_of_file = dirname( abspath(__file__) ) + "/jupyter_kernel_singular/resources/" - file_copy(path_of_file + "logo-32x32.png", td ) - file_copy(path_of_file + "logo-64x64.png", td ) print('Installing IPython kernel spec') install_kernel_spec(td, 'Singular', user=self.user, replace=True) - #install codemirror notebook extension - install_nbextension('jupyter_kernel_singular/singular-mode', overwrite=True, user=self.user) + # enable codemirror notebook extension enable_nbextension('notebook', 'singular-mode/main') setup( name="jupyter_kernel_singular" @@ -54,6 +50,7 @@ def run(self): , url="https://github.com/sebasguts/jupyter-singular" , packages=["jupyter_kernel_singular"] , package_dir={"jupyter_kernel_singular": "jupyter_kernel_singular"} - , data_files=[(kernelpath, glob("resources/*")), (nbextpath, glob("singular-mode/*"))] - , cmdclass={'install':install} + , data_files=[(kernelpath, glob("jupyter_kernel_singular/resources/*")), + (nbextpath, glob("jupyter_kernel_singular/singular-mode/*"))] + , cmdclass={'install': install} )