Skip to content

Commit

Permalink
Fix build for latest yarn/jlpm
Browse files Browse the repository at this point in the history
Move to jlpm to make sure we are in sync with JupyterLab quirks.

Currently, jlpm is on yarn 3. To make the package work with that I had
to:
* Run `jlpm install` to change to the new lock file format.
>  ➤ YN0028: │ The lockfile would have been modified by this install, which is explicitly forbidden.
* Change the CICD step that ran Jupyter in detached mode as yarn doesn't
  seem to respect the `&` operator at the end of command targets any
  more and won't run the target in the background.
* Use PnP loose mode of yarn. This one applies due to transative
  dependencies not complying with recent yarn rules.

NB that I pinned the version of JupyterLab to below 4.

Signed-off-by: Vasilis Themelis <vdthemelis@gmail.com>
  • Loading branch information
vthemelis authored and martinRenou committed May 22, 2023
1 parent 24f1586 commit 783e342
Show file tree
Hide file tree
Showing 12 changed files with 25,452 additions and 17,746 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ jobs:
working-directory: ui-tests-ipw7

- name: Launch JupyterLab
run: yarn run start:detached
run: yarn run start:detached &
working-directory: ui-tests-ipw7

- name: Wait for JupyterLab
Expand Down Expand Up @@ -177,7 +177,7 @@ jobs:
working-directory: ui-tests-ipw8

- name: Launch JupyterLab
run: yarn run start:detached
run: yarn run start:detached &
working-directory: ui-tests-ipw8

- name: Wait for JupyterLab
Expand Down
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nodeLinker: node-modules
pnpMode: "loose"
16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@
"url": "https://github.com/Bloomberg/ipydatagrid"
},
"scripts": {
"build": "yarn run build:lib && yarn run build:nbextension && yarn run build:labextension",
"build:dev": "yarn run build:lib && yarn run build:nbextension && yarn run build:labextension:dev",
"build": "jlpm run build:lib && jlpm run build:nbextension && jlpm run build:labextension",
"build:dev": "jlpm run build:lib && jlpm run build:nbextension && jlpm run build:labextension:dev",
"build:labextension": "jupyter labextension build .",
"build:labextension:dev": "jupyter labextension build --development True .",
"build:lib": "tsc",
"build:nbextension": "webpack --mode=production --no-devtool",
"build:widget-examples": "cd widget-examples/basic && webpack --mode=production",
"build:all": "yarn run build:labextension && yarn run build:nbextension && yarn run build:widget-examples",
"clean": "rimraf dist && yarn run clean:lib && yarn run clean:labextension && yarn run clean:nbextension",
"build:all": "jlpm run build:labextension && jlpm run build:nbextension && jlpm run build:widget-examples",
"clean": "rimraf dist && jlpm run clean:lib && jlpm run clean:labextension && jlpm run clean:nbextension",
"clean:lib": "rimraf lib",
"clean:labextension": "rimraf ipydatagrid/labextension",
"clean:nbextension": "rimraf ipydatagrid/nbextension/index.*",
"lint": "eslint 'js/**/*.{js,ts}' --quiet --fix",
"prepack": "yarn run build:labextension && yarn run build:nbextension",
"prepack": "jlpm run build:labextension && jlpm run build:nbextension",
"test": "jest --verbose",
"watch": "npm-run-all -p watch:*",
"watch:lib": "tsc -w",
Expand All @@ -57,23 +57,28 @@
"@jupyter-widgets/base": "^2 || ^3 || ^4 || ^6.0.0",
"@jupyterlab/apputils": "^3.0.2",
"@lumino/algorithm": "^1.9.0",
"@lumino/application": "^1.27.0",
"@lumino/commands": "^1.20.0",
"@lumino/coreutils": "^1.12.0",
"@lumino/datagrid": "^0.36.0",
"@lumino/default-theme": "^0.19.0",
"@lumino/domutils": "^1.8.0",
"@lumino/messaging": "^1.9.0",
"@lumino/signaling": "^1.10",
"@lumino/virtualdom": "^1.13.0",
"@lumino/widgets": "^1.28.0",
"bqplot": "^0.5",
"core-js-pure": "^3.30.2",
"d3-array": "^2.2.0",
"d3-color": "^3.1.0",
"d3-format": "^1.3.2",
"d3-scale": "^3.0.0",
"d3-time-format": "^2.1.3",
"jest-environment-jsdom": "^28.1.3",
"moment": "^2.24.0",
"underscore": "^1.13.6",
"vega-expression": "^2.6.0",
"vega-format": "^1.1.1",
"vega-functions": "^5.3.0"
},
"devDependencies": {
Expand All @@ -84,6 +89,7 @@
"@jupyterlab/builder": "^3.0.1",
"@types/jest": "^27.4.1",
"@types/node": "^10.11.6",
"@types/underscore": "^1.11.4",
"@types/webpack-env": "^1.13.6",
"@typescript-eslint/eslint-plugin": "^3.5.0",
"@typescript-eslint/parser": "^3.5.0",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ build-function = "hatch_jupyter_builder.npm_builder"
path = "."
build_cmd = "build"
npm = [
"yarn",
"jlpm",
]

[tool.isort]
Expand Down
2 changes: 1 addition & 1 deletion test-environment-ipyw7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
- pandas >=1.0.0,<2.0.0
- bqplot
- scipy
- jupyterlab
- jupyterlab < 4
- jupyter-packaging
- pytest
- nbval
Expand Down
2 changes: 1 addition & 1 deletion test-environment-ipyw8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
- pandas >=1.0.0,<2.0.0
- bqplot
- scipy
- jupyterlab
- jupyterlab < 4
- jupyter-packaging
- pytest
- nbval
Expand Down
2 changes: 1 addition & 1 deletion test-environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
- pandas >=1.0.0,<2.0.0
- bqplot
- scipy
- jupyterlab
- jupyterlab < 4
- jupyter-packaging
- pytest
- nbval
Expand Down
3 changes: 3 additions & 0 deletions ui-tests-ipw7/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@
"@jupyterlab/galata": "~4.5.0",
"klaw-sync": "^6.0.0",
"rimraf": "^3.0.2"
},
"devDependencies": {
"@playwright/test": "^1.16.2"
}
}
Loading

0 comments on commit 783e342

Please sign in to comment.