Skip to content

Commit d592c03

Browse files
authored
Merge pull request #86 from jasongrout/8.0
8.0 compatibility
2 parents 9f04d27 + febd482 commit d592c03

File tree

9 files changed

+2820
-977
lines changed

9 files changed

+2820
-977
lines changed

.github/workflows/main.yml

+14-17
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,24 @@ jobs:
2020

2121
steps:
2222
- name: Checkout
23-
uses: actions/checkout@v2
23+
uses: actions/checkout@v3
2424

25-
- name: Setup conda
26-
uses: conda-incubator/setup-miniconda@v2
25+
- name: Install node
26+
uses: actions/setup-node@v3
2727
with:
28-
mamba-version: "*"
29-
channels: conda-forge
28+
node-version: '16'
29+
cache: 'yarn'
3030

31-
- name: Mamba install dependencies
32-
shell: bash -l {0}
33-
run: mamba install python=${{ matrix.python-version }} pip yarn ipywidgets=7.6 jupyterlab=3 pytest nbval
34-
35-
- name: Install sidecar
36-
shell: bash -l {0}
37-
run: pip install -e .
31+
- name: Install Python
32+
uses: actions/setup-python@v4
33+
with:
34+
python-version: '3.x'
35+
cache: 'pip'
36+
cache-dependency-path: setup.py
3837

39-
- name: Check installation files
40-
shell: bash -l {0}
41-
run: |
42-
test -d $CONDA_PREFIX/share/jupyter/labextensions/@jupyter-widgets/jupyterlab-sidecar
43-
test -f $CONDA_PREFIX/share/jupyter/labextensions/@jupyter-widgets/jupyterlab-sidecar/package.json
38+
- run: pip install jupyterlab pytest nbval jupyter_packaging
39+
- run: pip install -ve .
40+
- run: jupyter labextension develop . --overwrite
4441

4542
- name: Check labextension
4643
shell: bash -l {0}

.github/workflows/release.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,15 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v3
1717

1818
- name: Install node
19-
uses: actions/setup-node@v1
19+
uses: actions/setup-node@v3
2020
with:
21-
node-version: '14.x'
22-
registry-url: 'https://registry.npmjs.org'
21+
node-version: '16'
2322

2423
- name: Install Python
25-
uses: actions/setup-python@v2
24+
uses: actions/setup-python@v4
2625
with:
2726
python-version: '3.x'
2827

package.json

+22-6
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@
55
"keywords": [
66
"jupyter",
77
"jupyterlab",
8-
"jupyterlab extension",
8+
"jupyterlab-extension",
99
"widgets"
1010
],
11+
"files": [
12+
"lib/**/*.js",
13+
"dist/*.js",
14+
"css/*.css"
15+
],
1116
"homepage": "https://github.com/jupyter-widgets/jupyterlab-sidecar",
1217
"bugs": {
1318
"url": "https://github.com/jupyter-widgets/jupyterlab-sidecar/issues"
@@ -42,17 +47,26 @@
4247
"watch:labextension": "jupyter labextension watch ."
4348
},
4449
"dependencies": {
45-
"@jupyter-widgets/base": "^4.0.0",
46-
"@jupyter-widgets/jupyterlab-manager": "^3.0.0",
50+
"@jupyter-widgets/base": "^4 || ^5 || ^6",
51+
"@jupyter-widgets/jupyterlab-manager": "^3 || ^4 || ^5",
4752
"@jupyterlab/application": "^3.0.0",
4853
"@lumino/coreutils": "^1.5.3"
4954
},
5055
"devDependencies": {
56+
"@babel/core": "^7.5.0",
57+
"@babel/preset-env": "^7.5.0",
5158
"@jupyterlab/builder": "^3.0.0",
5259
"@types/expect.js": "^0.3.29",
5360
"@types/mocha": "^7.0.2",
5461
"@types/node": "^13.9.2",
62+
"@types/webpack-env": "^1.13.6",
63+
"@typescript-eslint/eslint-plugin": "^3.6.0",
64+
"@typescript-eslint/parser": "^3.6.0",
5565
"expect.js": "^0.3.1",
66+
"css-loader": "^3.2.0",
67+
"eslint": "^7.4.0",
68+
"eslint-config-prettier": "^6.11.0",
69+
"eslint-plugin-prettier": "^3.1.4",
5670
"fs-extra": "^8.1.0",
5771
"json-loader": "^0.5.7",
5872
"karma": "^4.4.1",
@@ -65,10 +79,12 @@
6579
"mkdirp": "^1.0.3",
6680
"mocha": "^7.1.1",
6781
"npm-run-all": "^4.1.5",
82+
"prettier": "^2.0.5",
6883
"rimraf": "^3.0.2",
69-
"source-map-loader": "^0.2.4",
70-
"ts-loader": "^6.2.1",
71-
"typescript": "^3.8.3"
84+
"source-map-loader": "^1.1.3",
85+
"style-loader": "^1.0.0",
86+
"ts-loader": "^8.0.0",
87+
"typescript": "~4.1.3"
7288
},
7389
"jupyterlab": {
7490
"extension": "lib/plugin",

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[build-system]
2-
requires = ["jupyter_packaging~=0.7.9", "jupyterlab~=3.0", "setuptools>=40.8.0", "wheel"]
2+
requires = ["jupyter_packaging~=0.12", "jupyterlab~=3.0", "setuptools>=40.8.0", "wheel"]
33
build-backend = "setuptools.build_meta"

setup.cfg

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[bdist_wheel]
2-
universal=1
3-
41
[metadata]
52
description-file = README.md
63
license_file = LICENSE.txt

setup.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
name = 'sidecar'
2424
labext_name = '@jupyter-widgets/jupyterlab-sidecar'
2525

26-
# Ensure a valid python version
27-
ensure_python('>=3.6')
28-
2926
# Get our version
3027
version = get_version(os.path.join(name, '_version.py'))
3128

@@ -77,6 +74,7 @@
7774
author_email = '[email protected]',
7875
url = 'https://github.com/jupyter-widgets/jupyterlab-sidecar',
7976
license = 'BSD',
77+
python_requires = ">=3.7",
8078
platforms = "Linux, Mac OS X, Windows",
8179
keywords = ['Jupyter', 'Widgets', 'IPython'],
8280
classifiers = [
@@ -85,10 +83,10 @@
8583
'License :: OSI Approved :: BSD License',
8684
'Programming Language :: Python',
8785
'Programming Language :: Python :: 3',
88-
'Programming Language :: Python :: 3.6',
8986
'Programming Language :: Python :: 3.7',
9087
'Programming Language :: Python :: 3.8',
9188
'Programming Language :: Python :: 3.9',
89+
'Programming Language :: Python :: 3.10',
9290
'Framework :: Jupyter',
9391
],
9492
include_package_data = True,

src/widget.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Project Jupyter.
22
// Distributed under the terms of the Modified BSD License.
33

4+
import { DOMWidgetModel } from '@jupyter-widgets/base';
45
import {
56
output
67
} from '@jupyter-widgets/jupyterlab-manager';
@@ -30,7 +31,8 @@ class SidecarModel extends output.OutputModel {
3031
initialize(attributes: any, options: any) {
3132
super.initialize(attributes, options);
3233

33-
this.widget_manager.display_model(undefined as any, this as any, {});
34+
// create_view calls the view's render function, which will display this widget in the sidebar.
35+
this.widget_manager.create_view(this as DOMWidgetModel, {})
3436
}
3537

3638
static model_name = 'SidecarModel';

tests/src/utils.spec.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Distributed under the terms of the Modified BSD License.
33

44
import * as widgets from '@jupyter-widgets/base';
5+
import{ ManagerBase } from '@jupyter-widgets/base-manager';
56
import * as services from '@jupyterlab/services';
67
import * as Backbone from 'backbone';
78

@@ -47,7 +48,7 @@ class MockComm {
4748
}
4849

4950
export
50-
class DummyManager extends widgets.ManagerBase<HTMLElement> {
51+
class DummyManager extends ManagerBase {
5152
constructor() {
5253
super();
5354
this.el = window.document.createElement('div');

0 commit comments

Comments
 (0)