Skip to content

Commit 99d9318

Browse files
7.x: Allow building against JupyterLab 4 (#3955)
* 7.x: Allow building against lab 4 * Iterate * Iterate * Iterate * Update ts-ignore * Something that builds * Update jupyterlab in CI * Update yarn * Switch to using jlpm everywhere * Debug * Remove nbextension install in the dev script * Update jupyterlab_widgets/src/manager.ts Co-authored-by: Duc Trung Le <[email protected]> --------- Co-authored-by: Duc Trung Le <[email protected]>
1 parent 99ed88f commit 99d9318

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+19223
-11895
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ jobs:
4343
${{ runner.os }}-yarn-
4444
- name: Install dependencies
4545
run: |
46-
python -m pip install jupyterlab~=3.0
46+
python -m pip install jupyterlab~=4.0
4747
python -m pip install jupyter_packaging~=0.7.9
4848
- name: Build the extension
4949
run: |
50-
yarn install --frozen-lockfile
51-
yarn run build
52-
yarn run build:examples
50+
jlpm install --frozen-lockfile
51+
jlpm run build
52+
jlpm run build:examples
5353
5454
# First install the dev jupyterlab_widgets, since it is a dependency
5555
pushd jupyterlab_widgets
@@ -67,17 +67,17 @@ jobs:
6767
- name: Run JS tests
6868
run: |
6969
pushd packages/base
70-
yarn run test:unit:firefox:headless
70+
jlpm run test:unit:firefox:headless
7171
popd
7272
7373
pushd packages/controls
74-
yarn run test:unit:firefox:headless
74+
jlpm run test:unit:firefox:headless
7575
popd
7676
7777
pushd packages/html-manager
78-
yarn run test:unit:firefox:headless
78+
jlpm run test:unit:firefox:headless
7979
popd
8080
8181
pushd examples/web1
82-
yarn run test:firefox:headless
82+
jlpm run test:firefox:headless
8383
popd

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,6 @@ index.built.js.map
3333

3434
temp/*
3535

36+
.yarn
37+
3638
tsconfig.tsbuildinfo

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

dev-install.sh

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if [ $? -ne 0 ]; then
2020
exit 1
2121
fi
2222

23-
echo -n "Checking JupyterLab (assuming JupyterLab >=3)... "
23+
echo -n "Checking JupyterLab (assuming JupyterLab >=4)... "
2424
jupyter lab --version 2>/dev/null
2525
if [ $? -ne 0 ]; then
2626
echo "no, skipping installation of widgets for jupyterlab"
@@ -34,18 +34,12 @@ set -e
3434
nbExtFlags="--sys-prefix $1"
3535

3636
echo -n "Installing and building all yarn packages"
37-
yarn install
38-
yarn run build
37+
jlpm install
38+
jlpm run build
3939

4040
echo -n "widgetsnbextension"
4141
cd widgetsnbextension
4242
pip install -v -e .
43-
if [[ "$OSTYPE" == "msys" ]]; then
44-
jupyter nbextension install --overwrite --py $nbExtFlags widgetsnbextension || true
45-
else
46-
jupyter nbextension install --overwrite --py --symlink $nbExtFlags widgetsnbextension || true
47-
fi
48-
jupyter nbextension enable --py $nbExtFlags widgetsnbextension || true
4943
cd ..
5044

5145
if test "$skip_jupyter_lab" != yes; then

docs/source/dev_install.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ To install ipywidgets from git, you will need:
1717
version of the notebook, checkout the appropriate tag.
1818
+ See the
1919
[Compatibility table](https://github.com/jupyter-widgets/ipywidgets#compatibility)
20-
20+
2121
- the latest [JupyterLab release](https://github.com/jupyterlab/jupyterlab/releases)
2222

2323

2424

25-
### Installing With Conda
25+
### Installing With Conda
2626

2727
```bash
2828
conda create -c conda-forge -n ipywidgets yarn notebook
@@ -41,10 +41,10 @@ Rebuilding after making changes
4141

4242
To build and test changes, run the following commands in the ipywidgets repository root directory, empty your browser's cache, and refresh the page.
4343

44-
yarn run clean
45-
yarn run build
44+
jlpm run clean
45+
jlpm run build
4646

47-
If your changes are confined to one package (for example, just in the widgetsnbextension package), then it may be sufficient to just run `yarn run build` in that specific directory.
47+
If your changes are confined to one package (for example, just in the widgetsnbextension package), then it may be sufficient to just run `jlpm run build` in that specific directory.
4848

4949
Tips and troubleshooting
5050
------------------------

docs/source/dev_release.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ git checkout 7.x
4747
git pull origin 7.x
4848
git reset --hard origin/7.x
4949
git clean -fdx
50-
yarn install
51-
yarn run publish
50+
jlpm install
51+
npm publish
5252
```
5353

5454
Lerna will prompt you for version numbers for each of the changed npm packages. Lerna will then change the versions appropriately (including the interdependency versions), commit, tag, and publish the new packages to npm.

docs/source/dev_testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ To run the Python tests:
77

88
To run the Javascript tests in each package directory:
99

10-
yarn test
10+
jlpm test
1111

1212
This will run the test suite using `karma` with 'debug' level logging.

examples/web1/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
"scripts": {
1010
"build": "webpack",
1111
"clean": "rimraf built",
12-
"test": "npm run test:firefox && npm run test:chrome",
13-
"test:chrome": "npm run test:default",
12+
"test": "jlpm run test:firefox && jlpm run test:chrome",
13+
"test:chrome": "jlpm run test:default",
1414
"test:default": "karma start karma.config.js --log-level debug",
15-
"test:firefox": "npm run test:default -- --browsers Firefox",
16-
"test:firefox:headless": "npm run test:default -- --browsers FirefoxHeadless"
15+
"test:firefox": "jlpm run test:default -- --browsers Firefox",
16+
"test:firefox:headless": "jlpm run test:default -- --browsers FirefoxHeadless"
1717
},
1818
"dependencies": {
1919
"@jupyter-widgets/base": "^4.1.6",

examples/web2/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"scripts": {
1010
"build": "webpack",
1111
"clean": "rimraf built",
12-
"test": "npm run test:default",
12+
"test": "jlpm run test:default",
1313
"test:default": "echo \"No test specified\""
1414
},
1515
"dependencies": {

examples/web3/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
"author": "IPython",
88
"main": "lib/index.js",
99
"scripts": {
10-
"build": "npm run clean && tsc && node scripts/copyfiles.js && webpack",
10+
"build": "jlpm run clean && tsc && node scripts/copyfiles.js && webpack",
1111
"clean": "rimraf lib && rimraf tsconfig.tsbuildinfo && rimraf built",
1212
"host": "http-server",
1313
"lint": "tslint --project tslint.json --format stylish",
14-
"test": "npm run test:default",
14+
"test": "jlpm run test:default",
1515
"test:default": "echo \"No test specified\""
1616
},
1717
"dependencies": {
1818
"@jupyter-widgets/base": "^4.1.6",
1919
"@jupyter-widgets/controls": "^3.1.7",
2020
"@jupyter-widgets/html-manager": "^0.20.8",
21-
"@jupyterlab/services": "^6.0.0",
22-
"@lumino/widgets": "^1.3.0",
21+
"@jupyterlab/services": "^6 || ^7",
22+
"@lumino/widgets": "^1 || ^2",
2323
"codemirror": "^5.48.0",
2424
"font-awesome": "^4.7.0",
2525
"http-server": "^0.11.1"
@@ -37,7 +37,7 @@
3737
"rimraf": "^2.6.1",
3838
"style-loader": "^1.1.2",
3939
"tslint": "^5.20.1",
40-
"typescript": "~3.7.4",
40+
"typescript": "~5",
4141
"url-loader": "^3.0.0",
4242
"webpack": "^4.41.5"
4343
}

0 commit comments

Comments
 (0)