Skip to content

Commit

Permalink
setup.py : remove the use of install_nbextension
Browse files Browse the repository at this point in the history
As install_nbextension seems to be buggy
see (jupyter/notebook#1706).

- Remove the call of install_nbextension
- Use data_files instead with fixed path (old paths where wrongs)
  • Loading branch information
Vincent Klein committed Jan 16, 2018
1 parent ca9711b commit 2f5612f
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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"
Expand All @@ -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}
)

0 comments on commit 2f5612f

Please sign in to comment.