From 8df92a02297610c5706bb85bdcf01f2d925878ba Mon Sep 17 00:00:00 2001 From: Sylvain Corlay Date: Fri, 13 Mar 2020 00:05:28 +0100 Subject: [PATCH] Cleanup labextension --- ipycytoscape/__init__.py | 2 +- ipycytoscape/{ipycytoscape.py => cytoscape.py} | 0 ipycytoscape/nbextension/__init__.py | 4 ++-- ipycytoscape/nbextension/static/extension.js | 2 +- jupyter-cytoscape.json | 2 +- setup.py | 3 +-- src/extension.ts | 2 +- src/plugin.ts | 2 +- webpack.config.js | 8 ++++---- 9 files changed, 12 insertions(+), 13 deletions(-) rename ipycytoscape/{ipycytoscape.py => cytoscape.py} (100%) diff --git a/ipycytoscape/__init__.py b/ipycytoscape/__init__.py index f99da8a5..7dd33fcb 100644 --- a/ipycytoscape/__init__.py +++ b/ipycytoscape/__init__.py @@ -4,7 +4,7 @@ # Copyright (c) Mariana Meireles. # Distributed under the terms of the Modified BSD License. -from .ipycytoscape import CytoscapeWidget +from .cytoscape import CytoscapeWidget from ._version import __version__, version_info from .nbextension import _jupyter_nbextension_paths diff --git a/ipycytoscape/ipycytoscape.py b/ipycytoscape/cytoscape.py similarity index 100% rename from ipycytoscape/ipycytoscape.py rename to ipycytoscape/cytoscape.py diff --git a/ipycytoscape/nbextension/__init__.py b/ipycytoscape/nbextension/__init__.py index d0de5b50..741ea4b7 100644 --- a/ipycytoscape/nbextension/__init__.py +++ b/ipycytoscape/nbextension/__init__.py @@ -8,6 +8,6 @@ def _jupyter_nbextension_paths(): return [{ 'section': 'notebook', 'src': 'nbextension/static', - 'dest': 'ipycytoscape', - 'require': 'ipycytoscape/extension' + 'dest': 'jupyter-cytoscape', + 'require': 'jupyter-cytoscape/extension' }] diff --git a/ipycytoscape/nbextension/static/extension.js b/ipycytoscape/nbextension/static/extension.js index 224bde80..a50a578c 100644 --- a/ipycytoscape/nbextension/static/extension.js +++ b/ipycytoscape/nbextension/static/extension.js @@ -6,7 +6,7 @@ define(function() { window['requirejs'].config({ map: { '*': { - 'ipycytoscape': 'nbextensions/ipycytoscape/index', + 'jupyter-cytoscape': 'nbextensions/jupyter-cytoscape/index', }, } }); diff --git a/jupyter-cytoscape.json b/jupyter-cytoscape.json index 9ccc7d65..495c61a0 100644 --- a/jupyter-cytoscape.json +++ b/jupyter-cytoscape.json @@ -1,5 +1,5 @@ { "load_extensions": { - "ipycytoscape/extension": true + "jupyter-cytoscape/extension": true } } diff --git a/setup.py b/setup.py index b2c39f9f..5b720d7a 100644 --- a/setup.py +++ b/setup.py @@ -44,7 +44,7 @@ } data_files_spec = [ - ('share/jupyter/nbextensions/ipycytoscape', + ('share/jupyter/nbextensions/jupyter-cytoscape', nb_path, '*.js*'), ('share/jupyter/lab/extensions', lab_path, '*.tgz'), ('etc/jupyter/nbconfig/notebook.d' , HERE, 'jupyter-cytoscape.json') @@ -87,7 +87,6 @@ include_package_data = True, install_requires = [ 'ipywidgets>=7.0.0', - 'networkx', ], extras_require = { 'test': [ diff --git a/src/extension.ts b/src/extension.ts index f82eeeaa..2db2d863 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -8,6 +8,6 @@ // Some static assets may be required by the custom widget javascript. The base // url for the notebook is not known at build time and is therefore computed // dynamically. -(window as any).__webpack_public_path__ = document.querySelector('body')!.getAttribute('data-base-url') + 'nbextensions/ipycytoscape'; +(window as any).__webpack_public_path__ = document.querySelector('body')!.getAttribute('data-base-url') + 'nbextensions/jupyter-cytoscape'; export * from './index'; diff --git a/src/plugin.ts b/src/plugin.ts index 792f6ef7..c8c472ab 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -19,7 +19,7 @@ import { MODULE_NAME, MODULE_VERSION } from './version'; -const EXTENSION_ID = 'ipycytoscape:plugin'; +const EXTENSION_ID = 'jupyter-cytoscape:plugin'; /** * The example plugin. diff --git a/webpack.config.js b/webpack.config.js index fe8b0b4d..29902f4b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -39,7 +39,7 @@ module.exports = [ }, /** - * Embeddable ipycytoscape bundle + * Embeddable jupyter-cytoscape bundle * * This bundle is almost identical to the notebook extension bundle. The only * difference is in the configuration of the webpack public path for the @@ -54,8 +54,8 @@ module.exports = [ filename: 'index.js', path: path.resolve(__dirname, 'dist'), libraryTarget: 'amd', - library: "ipycytoscape", - publicPath: 'https://unpkg.com/ipycytoscape@' + version + '/dist/' + library: "jupyter-cytoscape", + publicPath: 'https://unpkg.com/jupyter-cytoscape@' + version + '/dist/' }, devtool: 'source-map', module: { @@ -76,7 +76,7 @@ module.exports = [ output: { filename: 'embed-bundle.js', path: path.resolve(__dirname, 'docs', 'source', '_static'), - library: "ipycytoscape", + library: "jupyter-cytoscape", libraryTarget: 'amd' }, module: {