From 8b8ab94ef9cf5769b80fb35f3819a5600e37c7a2 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Thu, 19 Mar 2020 10:46:05 +0100 Subject: [PATCH 1/2] JupyterLab 2 compatebility - Update the python package coupling to the JupyterLab extension to be less strict, allowing for a coupling to `^1.1.2` instead of exactly `^1.1.1`. This is very relevant if we make a small bump to the extension but don't want to make a new release of qgrid, or if qgrid would be installed by conda and it's availability was delayed so the newer npm package was available but the python package was outdated and coupled to the old versions specifically. - Move various loaders that are only used by webpack to build the json files from being dependencies to being devDependencies. - Bump versions of various dependencies to avoid security issues found in packages by npm. --- js/package.json | 31 ++++++++++++++++--------------- js/src/qgrid.widget.js | 4 ++-- js/webpack.config.js | 9 ++++++--- qgrid/_version.py | 2 +- qgrid/grid.py | 4 ++-- 5 files changed, 27 insertions(+), 23 deletions(-) diff --git a/js/package.json b/js/package.json index b885010c..dd2a139f 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "qgrid2", - "version": "1.1.2", + "version": "1.1.3", "description": "An Interactive Grid for Sorting and Filtering DataFrames in Jupyter Notebook", "author": "Quantopian Inc.", "main": "src/index.js", @@ -16,27 +16,28 @@ ], "scripts": { "clean": "rimraf dist/", - "prepublish": "webpack", + "prepare": "webpack", "test": "echo \"Error: no test specified\" && exit 1" }, "devDependencies": { - "jshint": "^2.9.5", - "rimraf": "^2.6.1", - "webpack": "^3.5.5" + "css-loader": "^3.4.2", + "expose-loader": "^0.7.5", + "file-loader": "^6.0.0", + "jshint": "^2.11.0", + "json-loader": "^0.5.7", + "rimraf": "^3.0.2", + "style-loader": "^1.1.3", + "webpack": "^4.42.0", + "webpack-cli": "^3.3.11" }, "dependencies": { - "@jupyter-widgets/base": "^1.1 || ^2", - "@jupyter-widgets/controls": "^1.0.0 || ^1.5.1", - "css-loader": "^0.28.7", - "expose-loader": "^0.7.3", - "file-loader": "^0.11.2", + "@jupyter-widgets/base": "^1.1 || ^2 || ^3", + "@jupyter-widgets/controls": "^1 || ^2", "jquery": "^3.2.1", - "jquery-ui-dist": "1.12.1", - "json-loader": "^0.5.4", - "moment": "^2.18.1", + "jquery-ui-dist": "^1.12.1", + "moment": "^2.24.0", "slickgrid-qgrid": "0.0.5", - "style-loader": "^0.18.2", - "underscore": "^1.8.3" + "underscore": "^1.9.2" }, "jshintConfig": { "esversion": 6 diff --git a/js/src/qgrid.widget.js b/js/src/qgrid.widget.js index 9cfe94df..488b046e 100644 --- a/js/src/qgrid.widget.js +++ b/js/src/qgrid.widget.js @@ -36,8 +36,8 @@ class QgridModel extends widgets.DOMWidgetModel { _view_name : 'QgridView', _model_module : 'qgrid', _view_module : 'qgrid', - _model_module_version : '^1.1.1', - _view_module_version : '^1.1.1', + _model_module_version : '^1.1.2', + _view_module_version : '^1.1.2', _df_json: '', _columns: {} }); diff --git a/js/webpack.config.js b/js/webpack.config.js index 381f7fe0..4386585c 100644 --- a/js/webpack.config.js +++ b/js/webpack.config.js @@ -42,7 +42,8 @@ module.exports = [ path: path.resolve(__dirname, '..', 'qgrid', 'static'), libraryTarget: 'amd' }, - plugins: plugins + plugins: plugins, + mode: 'production' }, {// Bundle for the notebook containing the custom widget views and models // @@ -61,7 +62,8 @@ module.exports = [ rules: rules }, externals: ['@jupyter-widgets/base', '@jupyter-widgets/controls', 'base/js/dialog'], - plugins: plugins + plugins: plugins, + mode: 'production' }, {// Embeddable qgrid bundle // @@ -89,6 +91,7 @@ module.exports = [ rules: rules }, externals: ['@jupyter-widgets/base', '@jupyter-widgets/controls'], - plugins: plugins + plugins: plugins, + mode: 'production' } ]; diff --git a/qgrid/_version.py b/qgrid/_version.py index 6669572a..f0fd39f1 100644 --- a/qgrid/_version.py +++ b/qgrid/_version.py @@ -1,4 +1,4 @@ -version_info = (1, 3, 0, "final") +version_info = (1, 3, 1, "final") _specifier_ = {"alpha": "a", "beta": "b", "candidate": "rc", "final": ""} diff --git a/qgrid/grid.py b/qgrid/grid.py index 66366533..44887b25 100644 --- a/qgrid/grid.py +++ b/qgrid/grid.py @@ -566,8 +566,8 @@ class can be constructed directly but that's not recommended because _model_name = Unicode('QgridModel').tag(sync=True) _view_module = Unicode('qgrid').tag(sync=True) _model_module = Unicode('qgrid').tag(sync=True) - _view_module_version = Unicode('1.1.1').tag(sync=True) - _model_module_version = Unicode('1.1.1').tag(sync=True) + _view_module_version = Unicode('^1.1.3').tag(sync=True) + _model_module_version = Unicode('^1.1.3').tag(sync=True) _df = Instance(pd.DataFrame) _df_json = Unicode('', sync=True) From 5e57e23fb4f0ab3cb1aaddd69c180f1f7dc57f78 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Thu, 19 Mar 2020 11:04:42 +0100 Subject: [PATCH 2/2] Use labextension link instead of install for local dev A good rule of thumb according to this @vidartf. ref: https://discourse.jupyter.org/t/about-jupyter-labextension-link-v-s-install/2201/2?u=consideratio --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index c9b8b3e5..c774967f 100644 --- a/README.rst +++ b/README.rst @@ -216,7 +216,7 @@ to do this. #. If desired, install the labextension:: - jupyter labextension install js/ + jupyter labextension link js/ #. Run the notebook as you normally would with the following command::