Skip to content

Commit 6d0c90f

Browse files
authored
Merge pull request #949 from krassowski/jupyterlab-4.0
JupyterLab 4.0 migration
2 parents ff8b6c4 + b0e8cab commit 6d0c90f

File tree

163 files changed

+23615
-28527
lines changed

Some content is hidden

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

163 files changed

+23615
-28527
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: 'CodeQL'
22

33
on:
44
push:
5-
branches: [master]
5+
branches: [main]
66
pull_request:
77
# The branches below must be a subset of the branches above
8-
branches: [master]
8+
branches: [main]
99
schedule:
1010
- cron: '16 12 * * 4'
1111

.github/workflows/job.test.yml

Lines changed: 32 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ name: CI
33
on:
44
push:
55
branches:
6-
- master
7-
- 2.x
6+
- main
87
- 3.x
8+
- 4.x
99
pull_request:
1010
branches:
11-
- master
12-
- 2.x
11+
- main
1312
- 3.x
13+
- 4.x
1414
workflow_dispatch:
1515

1616
# TODO: might need to tweak `group`
@@ -30,7 +30,7 @@ env:
3030

3131
ATEST_PROCESSES: 2
3232
ATEST_RETRIES: 3
33-
JLPM_CMD: jlpm --ignore-optional --prefer-offline --frozen-lockfile
33+
JLPM_CMD: jlpm install
3434

3535
# Increase this value to reset all caches
3636
CACHE_EPOCH: 4
@@ -43,8 +43,8 @@ jobs:
4343
strategy:
4444
matrix:
4545
os: [ubuntu]
46-
nodejs: ['>=14,<15.0.0a0']
47-
lab: ['>=3.6.0,<4.0.0a0']
46+
nodejs: ['>=16,<17.0.0a0']
47+
lab: ['>=4.0.5,<5.0.0a0']
4848
r: ['>=4']
4949
steps:
5050
- uses: actions/checkout@v3
@@ -84,7 +84,7 @@ jobs:
8484
if: steps.cache-node-modules.outputs.cache-hit != 'true'
8585
uses: actions/cache@v3
8686
with:
87-
path: .yarn-packages
87+
path: '.yarn/cache'
8888
key: |
8989
${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
9090
restore-keys: |
@@ -99,7 +99,7 @@ jobs:
9999
run: jlpm build
100100

101101
- name: Run frontend unit tests
102-
run: jlpm test
102+
run: jlpm test --no-bail
103103

104104
- name: Lint backend
105105
run: python scripts/lint.py
@@ -123,8 +123,8 @@ jobs:
123123
strategy:
124124
matrix:
125125
os: [ubuntu]
126-
nodejs: ['>=14,<15.0.0a0']
127-
lab: ['>=3.6.0,<4.0.0a0']
126+
nodejs: ['>=16,<17.0.0a0']
127+
lab: ['>=4.0.0,<5.0.0a0']
128128
r: ['>=4']
129129
steps:
130130
- uses: actions/checkout@v3
@@ -160,7 +160,7 @@ jobs:
160160
if: steps.cache-node-modules.outputs.cache-hit != 'true'
161161
uses: actions/cache@v3
162162
with:
163-
path: .yarn-packages
163+
path: '.yarn/cache'
164164
key: |
165165
${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
166166
restore-keys: |
@@ -214,18 +214,18 @@ jobs:
214214
fail-fast: false
215215
matrix:
216216
os: ['ubuntu', 'macos', 'windows']
217-
python: ['3.8', '3.10']
217+
python: ['3.8', '3.11']
218218
include:
219219
- python: '3.8'
220-
# Node 16 end-of-life: April 2024
220+
# Node 16 end-of-life: 2023-09-11
221221
nodejs: '>=16,<17.0.0.a0'
222222
r: '>=4'
223-
lab: '>=3.6.0,<4'
224-
- python: '3.10'
225-
# Node 16 end-of-life: April 2024
226-
nodejs: '>=16,<17.0.0.a0'
223+
lab: '>=4,<5'
224+
- python: '3.11'
225+
# Node 18 end-of-life: 2025-04-30
226+
nodejs: '>=18,<19.0.0.a0'
227227
r: '>=4'
228-
lab: '>=3.6.0,<4'
228+
lab: '>=4,<5'
229229

230230
steps:
231231
- uses: actions/checkout@v3
@@ -264,7 +264,7 @@ jobs:
264264
if: steps.cache-node-modules.outputs.cache-hit != 'true'
265265
uses: actions/cache@v3
266266
with:
267-
path: .yarn-packages
267+
path: '.yarn/cache'
268268
key: |
269269
${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
270270
restore-keys: |
@@ -298,11 +298,6 @@ jobs:
298298
jupyter server extension list
299299
jupyter server extension list 2>&1 | grep -ie "jupyter_lsp.*enabled" -
300300
301-
- name: List notebook server extensions
302-
run: |
303-
jupyter serverextension list
304-
jupyter serverextension list 2>&1 | grep -ie "jupyter_lsp.*enabled" -
305-
306301
- name: List frontend extensions
307302
run: |
308303
jupyter labextension list
@@ -351,23 +346,20 @@ jobs:
351346
max-parallel: 3
352347
matrix:
353348
os: ['ubuntu', 'macos', 'windows']
354-
python: ['3.8', '3.9', '3.10', 'pypy-3.8']
355-
exclude:
356-
- os: windows
357-
python: pypy-3.7
349+
python: ['3.8', '3.11', 'pypy-3.8']
358350
include:
359351
- python: '3.8'
360352
dist: 'jupyter*lsp*.whl'
361-
lab: '>=3.6,<3.7'
362-
- python: '3.9'
353+
lab: '>=4,<5'
354+
- python: '3.8'
363355
dist: 'jupyter*lsp*.tar.gz'
364-
lab: '>=3.6,<4'
365-
- python: '3.10'
356+
lab: '>=4,<5'
357+
- python: '3.11'
366358
dist: 'jupyter*lsp*.whl'
367-
lab: '>=3.6,<4'
359+
lab: '>=4,<5'
368360
- python: 'pypy-3.8'
369361
dist: 'jupyter*lsp*.tar.gz'
370-
lab: '>=3.6,<4'
362+
lab: '>=4,<5'
371363
- os: 'windows'
372364
py_cmd: python
373365
- os: 'macos'
@@ -409,13 +401,13 @@ jobs:
409401
fail-fast: false
410402
matrix:
411403
os: [ubuntu]
412-
python: ['3.8', '3.10']
413-
nodejs: ['14']
404+
python: ['3.8', '3.11']
405+
nodejs: ['18']
414406
include:
415407
- python: '3.8'
416-
lab: '>=3.6,<3.7'
417-
- python: '3.10'
418-
lab: '>=3.6,<4'
408+
lab: '>=4,<5'
409+
- python: '3.11'
410+
lab: '>=4,<5'
419411
steps:
420412
- name: Install Python
421413
uses: actions/setup-python@v4
@@ -434,8 +426,6 @@ jobs:
434426
run: python -m pip install --upgrade pip wheel setuptools
435427
- name: Install JupyterLab
436428
run: python -m pip install 'jupyterlab${{ matrix.lab }}'
437-
- name: Install Notebook (to test serverextension)
438-
run: python -m pip install 'notebook'
439429
- name: Install the server package
440430
run: cd dist && python -m pip install -vv jupyter_lsp*.whl
441431
- name: install the source extension
@@ -445,7 +435,5 @@ jobs:
445435
set -eux
446436
jupyter labextension list
447437
jupyter server extension list
448-
jupyter serverextension list
449438
jupyter labextension list 2>&1 | grep -ie "jupyterlab-lsp.*enabled.*ok" -
450439
jupyter server extension list 2>&1 | grep -ie "jupyter_lsp.*enabled" -
451-
jupyter serverextension list 2>&1 | grep -ie "jupyter_lsp.*enabled" -

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,8 @@ _build
122122

123123
# Built labextensions
124124
python_packages/*/*/labextensions/
125+
126+
# Berry
127+
.pnp.cjs
128+
.pnp.loader.mjs
129+
.yarn/

.yarnrc

Lines changed: 0 additions & 2 deletions
This file was deleted.

.yarnrc.yml

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

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
## Changelog
22

3+
### `@jupyter-lsp/jupyterlab-lsp 5.0.0-alpha.0`
4+
5+
- maintenance:
6+
- support JupyterLab 4
7+
8+
Requires JupyterLab `>=4.0.5,<5.0.0a0`
9+
310
### `@jupyter-lsp/jupyterlab-lsp 4.2.0` (2023-05-28)
411

512
- features:

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Development requires, at a minimum:
3333

3434
- `nodejs >=16,!=17,<19`
3535
- `python >=3.8,<3.11.0a0`
36-
- `jupyterlab >=3.6.0,<4.0.0a0`
36+
- `jupyterlab >=4.0.5,<5.0.0a0`
3737

3838
It is recommended to use a virtual environment (e.g. `virtualenv` or `conda env`)
3939
for development.

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Language Server Protocol integration for Jupyter(Lab)
22

3-
[![tests](https://github.com/jupyter-lsp/jupyterlab-lsp/workflows/CI/badge.svg)](https://github.com/jupyter-lsp/jupyterlab-lsp/actions?query=workflow%3ACI+branch%3Amaster)
3+
[![tests](https://github.com/jupyter-lsp/jupyterlab-lsp/workflows/CI/badge.svg)](https://github.com/jupyter-lsp/jupyterlab-lsp/actions?query=workflow%3ACI+branch%3Amain)
44
[![Documentation Status](https://readthedocs.org/projects/jupyterlab-lsp/badge/?version=latest)](https://jupyterlab-lsp.readthedocs.io/en/latest/?badge=latest)
55
[![Python Demo](https://img.shields.io/badge/demo-Python-blue)](https://mybinder.org/v2/gh/jupyter-lsp/demo-python/main?urlpath=lab)
66
[![R Demo](https://img.shields.io/badge/demo-R-blue)](https://mybinder.org/v2/gh/jupyter-lsp/demo-r/main?urlpath=lab)
77
[![Julia Demo](https://img.shields.io/badge/demo-Julia-blue)](https://mybinder.org/v2/gh/jupyter-lsp/demo-julia/main?urlpath=lab)
8-
[![Binder](https://img.shields.io/badge/launch-dev_version-blue)](https://mybinder.org/v2/gh/jupyter-lsp/jupyterlab-lsp/master?urlpath=lab%2Ftree%2Fexamples%2FPython.ipynb)
8+
[![Binder](https://img.shields.io/badge/launch-dev_version-blue)](https://mybinder.org/v2/gh/jupyter-lsp/jupyterlab-lsp/main?urlpath=lab%2Ftree%2Fexamples%2FPython.ipynb)
99

1010
**[Installation](#installation) | [Configuring](./docs/Configuring.ipynb) | [Changelog](./CHANGELOG.md) | [Roadmap](./docs/Roadmap.ipynb) | [Contributing](./CONTRIBUTING.md) | [Extending](./docs/Extending.ipynb)**
1111

@@ -19,20 +19,20 @@ Hover over any piece of code; if an underline appears, you can press <kbd>Ctrl</
1919
to get a tooltip with function/class signature, module documentation or any other
2020
piece of information that the language server provides
2121

22-
![hover](https://raw.githubusercontent.com/jupyter-lsp/jupyterlab-lsp/master/examples/screenshots/hover.png)
22+
![hover](https://raw.githubusercontent.com/jupyter-lsp/jupyterlab-lsp/main/examples/screenshots/hover.png)
2323

2424
### Diagnostics
2525

2626
Critical errors have red underline, warnings are orange, etc. Hover
2727
over the underlined code to see a more detailed message
2828

29-
![inspections](https://raw.githubusercontent.com/jupyter-lsp/jupyterlab-lsp/master/examples/screenshots/inspections.png)
29+
![inspections](https://raw.githubusercontent.com/jupyter-lsp/jupyterlab-lsp/main/examples/screenshots/inspections.png)
3030

3131
### Jump to Definition and References
3232

3333
Use the context menu entry, or <kbd>Alt</kbd> + :computer_mouse: to jump to definitions/references (you can change it to <kbd>Ctrl</kbd>/<kbd>⌘</kbd> in settings); use <kbd>Alt</kbd> + <kbd>o</kbd> to jump back.
3434

35-
![jump](https://raw.githubusercontent.com/jupyter-lsp/jupyterlab-lsp/master/examples/screenshots/jump_to_definition.png)
35+
![jump](https://raw.githubusercontent.com/jupyter-lsp/jupyterlab-lsp/main/examples/screenshots/jump_to_definition.png)
3636

3737
### Highlight References
3838

@@ -44,19 +44,19 @@ Place your cursor on a variable, function, etc and all the usages will be highli
4444
completion.
4545
- You can choose to receive the completion suggestions as you type by enabling `continuousHinting` setting.
4646

47-
![invoke](https://raw.githubusercontent.com/jupyter-lsp/jupyterlab-lsp/master/examples/screenshots/autocompletion.gif)
47+
![invoke](https://raw.githubusercontent.com/jupyter-lsp/jupyterlab-lsp/main/examples/screenshots/autocompletion.gif)
4848

4949
### Automatic Signature Suggestions
5050

5151
Function signatures will automatically be displayed
5252

53-
![signature](https://raw.githubusercontent.com/jupyter-lsp/jupyterlab-lsp/master/examples/screenshots/signature.png)
53+
![signature](https://raw.githubusercontent.com/jupyter-lsp/jupyterlab-lsp/main/examples/screenshots/signature.png)
5454

5555
### Kernel-less Autocompletion
5656

5757
Advanced static-analysis autocompletion without a running kernel
5858

59-
![autocompletion](https://raw.githubusercontent.com/jupyter-lsp/jupyterlab-lsp/master/examples/screenshots/completions-Julia-Python-R.gif)
59+
![autocompletion](https://raw.githubusercontent.com/jupyter-lsp/jupyterlab-lsp/main/examples/screenshots/completions-Julia-Python-R.gif)
6060

6161
#### The runtime kernel suggestions are still there
6262

@@ -76,21 +76,21 @@ setting; Or add both if you like to code in hardcore mode and get no completions
7676
Rename variables, functions and more, in both: notebooks and the file editor.
7777
Use the context menu option or the <kbd>F2</kbd> shortcut to invoke.
7878

79-
![rename](https://raw.githubusercontent.com/jupyter-lsp/jupyterlab-lsp/master/examples/screenshots/rename.png)
79+
![rename](https://raw.githubusercontent.com/jupyter-lsp/jupyterlab-lsp/main/examples/screenshots/rename.png)
8080

8181
### Diagnostics panel
8282

8383
Sort and jump between the diagnostics using the diagnostics panel.
8484
Open it searching for "Show diagnostics panel" in JupyterLab commands palette or from the context menu.
8585
Use context menu on rows in the panel to filter out diagnostics or copy their message.
8686

87-
![panel](https://raw.githubusercontent.com/jupyter-lsp/jupyterlab-lsp/master/examples/screenshots/panel.png)
87+
![panel](https://raw.githubusercontent.com/jupyter-lsp/jupyterlab-lsp/main/examples/screenshots/panel.png)
8888

8989
## Prerequisites
9090

9191
You will need to have both of the following installed:
9292

93-
- JupyterLab >=3.6.0,<4.0.0a0
93+
- JupyterLab >=4.0.5,<5.0.0a0
9494
- Python 3.8+
9595

9696
In addition, if you wish to use javascript, html, markdown or any other NodeJS-based language server you will need to have appropriate NodeJS version installed.
@@ -113,9 +113,9 @@ Use of a python `virtualenv` or a conda env is also recommended.
113113
1. install JupyterLab and the extensions
114114

115115
```bash
116-
conda install -c conda-forge 'jupyterlab>=3.0.0,<4.0.0a0' jupyterlab-lsp
116+
conda install -c conda-forge 'jupyterlab>=4.0.0,<5.0.0a0' jupyterlab-lsp
117117
# or
118-
pip install 'jupyterlab>=3.0.0,<4.0.0a0' jupyterlab-lsp
118+
pip install 'jupyterlab>=4.0.0,<5.0.0a0' jupyterlab-lsp
119119
```
120120

121121
> Note: `jupyterlab-lsp` provides both the server extension and the lab extension.

atest/03_Notebook.robot

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ Test Setup Try to Close All Tabs
99
Python
1010
[Setup] Setup Notebook Python Python.ipynb
1111
${diagnostic} = Set Variable W291 trailing whitespace (pycodestyle)
12-
Wait Until Page Contains Element css:.cm-lsp-diagnostic[title="${diagnostic}"] timeout=35s
12+
# TODO: no title for diagnostics; we can get the title with JS via `element.cmView.mark.spec.diagnostic.message` but this is not selectable
13+
Wait Until Page Contains Element css:.cm-lintRange[title="${diagnostic}"] timeout=35s
1314
Capture Page Screenshot 01-python.png
1415
[Teardown] Clean Up After Working With File Python.ipynb
1516

atest/04_Interface/Statusbar.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Status Changes Between Notebooks
5252
Setup Notebook Python Python.ipynb
5353
Wait Until Fully Initialized
5454
Open New Notebook
55-
Element Should Contain ${STATUSBAR} Waiting...
55+
Element Should Contain ${STATUSBAR} Waiting
5656
Wait Until Fully Initialized
5757
Switch To Tab Python.ipynb
5858
Wait Until Fully Initialized

0 commit comments

Comments
 (0)