Skip to content

Commit

Permalink
Merge pull request #110 from chrishavlin/update_to_jlab_4
Browse files Browse the repository at this point in the history
Update to jupyterlab 4
  • Loading branch information
matthewturk authored Oct 1, 2024
2 parents 0c69e27 + 5e860ee commit 3131303
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 72 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
project: 'tsconfig.eslint.json',
sourceType: 'module'
},
plugins: ['@typescript-eslint'],
Expand Down
32 changes: 17 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,28 @@ jobs:
strategy:
matrix:
python-version: [3.9, "3.10", "3.11"]
fail-fast: false
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
# https://github.com/jupyterlab/maintainer-tools/blob/main/.github/actions/base-setup/action.yml
with:
node-version: '18.x'
python_version: ${{ matrix.python-version }}
node_version: '18.x'
- name: Install dependencies
run: python -m pip install -U jupyterlab~=3.0
- name: Build the extension
run: python -m pip install -U jupyterlab~=4.0
- name: jlpm config
run: jlpm config set -H enableImmutableInstalls false
- name: install ts modules
run: jlpm
- name: jlpm lint check
run: jlpm run eslint:check
- name: install python package
run: python -m pip install .
- name: check for widgyts in extensions
run: |
jlpm
jlpm run eslint:check
python -m pip install yt
python -m pip install .
jupyter server extension list 2>&1 | grep -ie "widgyts.*OK"
jupyter labextension list 2>&1 | grep -ie "@yt-project/yt-widgets.*OK"
python -m jupyterlab.browser_check
- name: run jupyterlab browser check
run: python -m jupyterlab.browser_check
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,4 @@ dmypy.json

# yarn build related
.yarn/
.yarnrc.yml
yarn.lock
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ The following assumes you're using conda. If not, you'll need to install nodejs
in your environemnt separately.

```bash
conda create -n widgyts-dev -c conda-forge nodejs python=3.10 jupyterlab=3
conda create -n widgyts-dev -c conda-forge nodejs python=3.10 jupyterlab=4
conda activate widgyts-dev
```

Install the python. This will also build the TS package.
```bash
pip install -e "."
pip install -e .
```

When developing your extensions, you need to manually enable your extensions with the
Expand Down
73 changes: 32 additions & 41 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,54 +60,45 @@
},
"dependencies": {
"@data-exp-lab/yt-tools": "^0.4.1",
"@jupyter-widgets/base": "^1.1.10 || ^2 || ^3 || ^4",
"@jupyterlab/application": "^3.0.4",
"@jupyterlab/coreutils": "^5.0.2",
"@jupyterlab/mainmenu": "^3.0.3",
"@jupyterlab/services": "^6.0.3",
"@jupyter-widgets/base": "^1.1.10 || ^2 || ^3 || ^4 || ^5 || ^6",
"@jupyterlab/application": "^4.2.5",
"@types/fscreen": "^1.0.1",
"@types/node": "^10.11.6",
"@types/three": "^0.141.0",
"fscreen": "^1.2.0",
"ipycanvas": "^0.8.2",
"ipycanvas": "^0.13.3",
"jupyter-threejs": "^2.3.0"
},
"devDependencies": {
"@jupyterlab/builder": "^3.0.0",
"@phosphor/application": "^1.6.0",
"@phosphor/widgets": "^1.6.0",
"@types/expect.js": "^0.3.29",
"@types/mocha": "^5.2.5",
"@types/node": "^10.11.6",
"@types/webpack-env": "^1.13.6",
"@typescript-eslint/eslint-plugin": "^3.6.0",
"@typescript-eslint/parser": "^3.6.0",
"acorn": "^7.2.0",
"css-loader": "^3.2.0",
"eslint": "^7.4.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.4",
"expect.js": "^0.3.1",
"fs-extra": "^7.0.0",
"karma": "^3.1.0",
"karma-chrome-launcher": "^2.2.0",
"karma-firefox-launcher": "^1.1.0",
"karma-ie-launcher": "^1.0.0",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.5",
"karma-typescript": "^5.0.3",
"karma-typescript-es6-transform": "^5.0.3",
"mkdirp": "^0.5.1",
"mocha": "^5.2.0",
"npm-run-all": "^4.1.3",
"prettier": "^2.0.5",
"rimraf": "^2.6.2",
"source-map-loader": "^0.2.4",
"style-loader": "^1.0.0",
"ts-loader": "^5.2.1",
"typescript": "^4.1.3",
"webpack": "^4.20.2",
"webpack-cli": "^3.1.2"
"@jupyter-widgets/base-manager": "^1.0.7",
"@jupyterlab/builder": "^4.0.11",
"@lumino/application": "^2.3.0",
"@lumino/widgets": "^2.3.1",
"@types/webpack-env": "^1.18.4",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"acorn": "^8.11.3",
"css-loader": "^6.9.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"fs-extra": "^11.2.0",
"identity-obj-proxy": "^3.0.0",
"mkdirp": "^3.0.1",
"npm-run-all": "^4.1.5",
"prettier": "^3.2.4",
"rimraf": "^5.0.5",
"source-map-loader": "^5.0.0",
"style-loader": "^3.3.4",
"ts-loader": "^9.5.1",
"typescript": "~5.3.3",
"webpack": "^5.90.0",
"webpack-cli": "^5.1.4"
},
"devDependenciesComments": {
"@jupyterlab/builder": "pinned to the latest JupyterLab 4.x release",
"@lumino/application": "pinned to the latest Lumino 2.x release",
"@lumino/widgets": "pinned to the latest Lumino 2.x release"
},
"sideEffects": [
"style/*.css",
Expand Down
31 changes: 20 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[build-system]
requires = [
"hatchling",
"jupyterlab~=3.1",
"hatchling>=1.21.1",
"jupyterlab>=4.0.0,<5",
"hatch-nodejs-version>=0.3.2",
]
build-backend = "hatchling.build"

Expand All @@ -16,7 +17,7 @@ authors = [
keywords = [
"Jupyter",
"JupyterLab",
"JupyterLab3",
"JupyterLab4",
]
classifiers = [
"Framework :: Jupyter",
Expand All @@ -29,8 +30,8 @@ classifiers = [
]
dependencies = [
"ipycanvas>=0.4.7",
"ipywidgets>=7.5.1",
"jupyterlab~=3.0",
"ipywidgets>=8.0.0",
"jupyterlab>=4.0",
"numpy>=1.14",
"pythreejs>=2.2.0",
"traitlets>=4.3.3",
Expand All @@ -49,9 +50,13 @@ Tracker = "https://github.com/yt-project/widgyts/issues"

[tool.hatch.build]
artifacts = [
"widgyts/labextension/*.tgz",
"widgyts/labextension",
]

[tool.hatch.metadata]
allow-direct-references = true

[tool.hatch.build.targets.wheel.shared-data]
"widgyts/labextension/static" = "share/jupyter/labextensions/@yt-project/yt-widgets/static"
"install.json" = "share/jupyter/labextensions/@yt-project/yt-widgets/install.json"
Expand All @@ -66,7 +71,7 @@ exclude = [

[tool.hatch.build.hooks.jupyter-builder]
dependencies = [
"hatch-jupyter-builder>=0.9.1",
"hatch-jupyter-builder>=0.8.3",
]
build-function = "hatch_jupyter_builder.npm_builder"
ensured-targets = [
Expand All @@ -77,19 +82,23 @@ skip-if-exists = [
"widgyts/labextension/static/style.js",
]

[tool.hatch.build.hooks.jupyter-builder.build-kwargs]
path = "."
build_cmd = "build:prod"
npm = [
"jlpm",
]

[tool.hatch.build.hooks.jupyter-builder.editable-build-kwargs]
path = "."
build_dir = "widgyts/labextension"
source_dir = "src"
build_cmd = "install:extension"
npm = [
"jlpm",
]

[tool.hatch.build.hooks.jupyter-builder.build-kwargs]
build_cmd = "build:prod"
npm = [
"jlpm",
]


[tool.black]
line-length = 88
Expand Down
2 changes: 1 addition & 1 deletion src/fullscreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class FullscreenButtonView extends DOMWidgetView {
this.el.classList.add('jupyter-widgets');
this.el.classList.add('jupyter-button');
this.el.classList.add('widget-button');
this.delegate('click', this.el, this._handle_click);
this.delegate('click', this.el.value, this._handle_click);
this.update(); // Set defaults.
}

Expand Down
5 changes: 5 additions & 0 deletions tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": "./tsconfig.json",
"include": ["src/**/*.ts", "src/**/*.tsx"],
"exclude": []
}

0 comments on commit 3131303

Please sign in to comment.