Skip to content

Commit 9f72cd9

Browse files
isumitjhakrassowski
andauthoredMar 5, 2024··
Add support for JupyterLab 4.x (#34)
Co-authored-by: Michał Krassowski <[email protected]>
1 parent 072b219 commit 9f72cd9

12 files changed

+12876
-9027
lines changed
 

‎.github/workflows/build.yml

+16-18
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
2424

2525
- name: 'Install dependencies 📦'
26-
run: python -m pip install -U "jupyterlab<4"
26+
run: python -m pip install -U jupyterlab>4
2727

2828
- name: 'Lint the extension 🧹'
2929
run: |
@@ -85,9 +85,7 @@ jobs:
8585
sudo rm -rf $(which node)
8686
sudo rm -rf $(which node)
8787
88-
pip install "jupyterlab<4" jupyterlab_conda_store*.whl
89-
90-
88+
pip install "jupyterlab>4" jupyterlab_conda_store*.whl
9189
jupyter labextension list
9290
jupyter labextension list 2>&1 | grep -ie "jupyterlab-conda-store.*OK"
9391
python -m jupyterlab.browser_check --no-chrome-test
@@ -115,7 +113,7 @@ jobs:
115113
- name: 'Install the extension'
116114
run: |
117115
set -eux
118-
python -m pip install "jupyterlab~=3.1" jupyterlab_conda_store*.whl
116+
python -m pip install "jupyterlab>4" jupyterlab_conda_store*.whl
119117
120118
- name: 'Install dependencies'
121119
working-directory: ui-tests
@@ -134,16 +132,16 @@ jobs:
134132
run: jlpm playwright install chromium
135133
working-directory: ui-tests
136134

137-
# - name: Execute integration tests
138-
# working-directory: ui-tests
139-
# run: |
140-
# jlpm playwright test
141-
142-
# - name: Upload Playwright Test report
143-
# if: always()
144-
# uses: actions/upload-artifact@v2
145-
# with:
146-
# name: jupyterlab_conda_store-playwright-tests
147-
# path: |
148-
# ui-tests/test-results
149-
# ui-tests/playwright-report
135+
- name: Execute integration tests
136+
working-directory: ui-tests
137+
run: |
138+
jlpm playwright test
139+
140+
- name: Upload Playwright Test report
141+
if: always()
142+
uses: actions/upload-artifact@v2
143+
with:
144+
name: jupyterlab_conda_store-playwright-tests
145+
path: |
146+
ui-tests/test-results
147+
ui-tests/playwright-report

‎.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
3232

3333
- name: 'Install dependencies 📦'
34-
run: python -m pip install -U "jupyterlab<4"
34+
run: python -m pip install -U "jupyterlab>=4"
3535

3636
- name: 'Lint the extension 🧹'
3737
run: |

‎.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ dmypy.json
142142
# vim stuff
143143
*.swp
144144

145+
# frontend stuff
146+
.yarn/
145147
# eslint cache
146148
.eslintcache
147149
# stylelint cache
148-
.stylelintcache
150+
.stylelintcache

‎.yarnrc.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
enableImmutableInstalls: true
2+
nodeLinker: node-modules

‎README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
A JupyterLab extension for [conda-store][conda-store-repo].
1818

1919
> [!NOTE]
20-
> Currently, this extension is only compatible with JupyterLab `>= 3.0 <= 4.0`.
20+
> This extension is only compatible with JupyterLab `>= 4.0`.
2121
2222
## Installation 📦
2323

2424
### Pre-requisites
2525

2626
You will need to have [conda-store][conda-store-repo] installed and running on your local computer to use this extension. As well as:
2727

28-
- `JupyterLab >= 3.0 <= 4.0`
28+
- `JupyterLab >= 4.0`
2929
- Python `>= 3.8`
3030

3131
You can install the extension with pip:
@@ -76,7 +76,7 @@ pip uninstall jupyterlab-conda-store
7676

7777
```bash
7878
# Install node and jupyterlab from conda-forge
79-
conda install -c conda-forge 'nodejs>16' 'jupyterlab<4'
79+
conda install -c conda-forge 'nodejs>16' 'jupyterlab>=4'
8080
```
8181

8282
5. Install the package in development mode:

‎package.json

+29-26
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
"type": "git",
3131
"url": "https://github.com/telamonian/jupyterlab-conda-store.git"
3232
},
33+
"workspaces": [
34+
"ui-tests"
35+
],
3336
"scripts": {
3437
"build": "jlpm build:lib && jlpm build:labextension:dev",
3538
"build:prod": "jlpm clean && jlpm build:lib && jlpm build:labextension",
@@ -58,39 +61,39 @@
5861
},
5962
"dependencies": {
6063
"@conda-store/conda-store-ui": "2024.1.1",
61-
"@jupyterlab/application": "^3.1.0",
62-
"@jupyterlab/apputils": "^3.1.0",
63-
"@jupyterlab/mainmenu": "^3.1.0",
64-
"@jupyterlab/settingregistry": "^3.1.0",
65-
"@jupyterlab/ui-components": "^3.1.0",
66-
"@lumino/widgets": "^1.37.1",
67-
"react": "^17.0.1",
68-
"react-dom": "^17.0.1"
64+
"@jupyterlab/application": "^4.0.9",
65+
"@jupyterlab/apputils": "^4.1.2",
66+
"@jupyterlab/mainmenu": "^4.0.9",
67+
"@jupyterlab/settingregistry": "^4.0.9",
68+
"@jupyterlab/ui-components": "^4.0.9",
69+
"@lumino/widgets": "^2.3.1",
70+
"react": "^18.2.0",
71+
"react-dom": "^18.2.0"
6972
},
7073
"devDependencies": {
7174
"@babel/core": "^7.0.0",
7275
"@babel/preset-env": "^7.0.0",
73-
"@jupyterlab/builder": "^3.0.0 || ^4.0.0",
74-
"@jupyterlab/testutils": "^3.0.0 || ^4.0.0",
76+
"@jupyterlab/builder": "^4.0.0",
77+
"@jupyterlab/testutils": "^4.0.0",
7578
"@types/jest": "^26.0.0",
76-
"@types/react": "^17.0.0",
77-
"@types/react-dom": "^17.0.0",
78-
"@typescript-eslint/eslint-plugin": "^4.8.1",
79-
"@typescript-eslint/parser": "^4.8.1",
80-
"eslint": "^7.14.0",
81-
"eslint-config-prettier": "^6.15.0",
82-
"eslint-plugin-prettier": "^3.1.4",
83-
"jest": "^26.4.2",
79+
"@types/react": "^18.2.0",
80+
"@types/react-dom": "^18.2.0",
81+
"@typescript-eslint/eslint-plugin": "~6.13.2",
82+
"@typescript-eslint/parser": "~6.13.2",
83+
"eslint": "~8.55.0",
84+
"eslint-config-prettier": "~9.1.0",
85+
"eslint-plugin-prettier": "~5.0.1",
86+
"jest": "^29.2.0",
8487
"npm-run-all": "^4.1.5",
85-
"prettier": "^2.1.1",
88+
"prettier": "~3.0.0",
8689
"rimraf": "^3.0.2",
87-
"stylelint": "^14.3.0",
90+
"stylelint": "^15.10.1",
8891
"stylelint-config-prettier": "^9.0.3",
89-
"stylelint-config-recommended": "^6.0.0",
90-
"stylelint-config-standard": "~24.0.0",
91-
"stylelint-prettier": "^2.0.0",
92-
"ts-jest": "^26.3.0",
93-
"typescript": "~4.7.3"
92+
"stylelint-config-recommended": "^13.0.0",
93+
"stylelint-config-standard": "^34.0.0",
94+
"stylelint-prettier": "^4.0.0",
95+
"ts-jest": "^29.1.1",
96+
"typescript": "~5.0.2"
9497
},
9598
"sideEffects": [
9699
"style/*.css",
@@ -108,7 +111,7 @@
108111
"jupyter-releaser": {
109112
"hooks": {
110113
"before-build-npm": [
111-
"python -m pip install jupyterlab~=3.1",
114+
"python -m pip install jupyterlab>4",
112115
"jlpm"
113116
],
114117
"before-build-python": [

‎pyproject.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["hatchling", "jupyterlab<4", "hatch-nodejs-version"]
2+
requires = ["hatchling", "jupyterlab>4", "hatch-nodejs-version"]
33
build-backend = "hatchling.build"
44

55
[project]
@@ -9,11 +9,11 @@ readme = "README.md"
99
license = { file = "LICENSE" }
1010
requires-python = ">=3.8"
1111
maintainers = [{ name = "Tania Allard", email = "trallard@bitsandchips.me" }]
12-
keywords = ["Jupyter", "JupyterLab", "JupyterLab3", "conda", "environments"]
12+
keywords = ["Jupyter", "JupyterLab", "JupyterLab4", "conda", "environments"]
1313
classifiers = [
1414
"Framework :: Jupyter",
1515
"Framework :: Jupyter :: JupyterLab",
16-
"Framework :: Jupyter :: JupyterLab :: 3",
16+
"Framework :: Jupyter :: JupyterLab :: 4",
1717
"Framework :: Jupyter :: JupyterLab :: Extensions",
1818
"Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt",
1919
"License :: OSI Approved :: BSD License",

‎src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ async function activate(
7878
command,
7979
args: {}
8080
});
81-
mainMenu.addMenu(condaStoreMenu, { rank: 1000 });
81+
mainMenu.addMenu(condaStoreMenu, true, { rank: 1000 });
8282
} else {
8383
mainMenu.settingsMenu.addGroup([{ command }], 900);
8484
}

‎ui-tests/jupyter_server_test_config.py

+2-12
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,7 @@
44
opens the server to the world and provide access to JupyterLab
55
JavaScript objects through the global window variable.
66
"""
7-
from tempfile import mkdtemp
87

9-
c.ServerApp.port = 8888
10-
c.ServerApp.port_retries = 0
11-
c.ServerApp.open_browser = False
8+
from jupyterlab.galata import configure_jupyter_server
129

13-
c.ServerApp.root_dir = mkdtemp(prefix='galata-test-')
14-
c.ServerApp.token = ""
15-
c.ServerApp.password = ""
16-
c.ServerApp.disable_check_xsrf = True
17-
c.LabApp.expose_app_in_browser = True
18-
19-
# Uncomment to set server log level to debug level
20-
# c.ServerApp.log_level = "DEBUG"
10+
configure_jupyter_server(c)

‎ui-tests/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"test": "jlpm playwright test"
99
},
1010
"devDependencies": {
11-
"@jupyterlab/galata": "^4.3.0"
11+
"@jupyterlab/galata": "^5.0.9",
12+
"@playwright/test": "^1.32.0"
1213
}
1314
}

‎ui-tests/tests/jupyterlab_conda_store.spec.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ test('should emit an activation console message', async ({ page }) => {
1616
await page.goto();
1717

1818
expect(
19-
logs.filter(
20-
s => s === 'JupyterLab extension jupyterlab-conda-store is activated!'
21-
)
19+
logs.filter(s => s === 'JupyterLab extension conda-store is activated!')
2220
).toHaveLength(1);
2321
});

0 commit comments

Comments
 (0)
Please sign in to comment.