Skip to content

Commit 0254ccb

Browse files
authored
Merge pull request #139 from jupyterlab/fix/jlab3-corrections
Passthrough following JLab3 update
2 parents 944f073 + 7595d79 commit 0254ccb

File tree

21 files changed

+184
-163
lines changed

21 files changed

+184
-163
lines changed

.github/workflows/main.yml

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
node-version: "12.x"
6868
- name: Install Python
6969
if: steps.filter.outputs.extension == 'true'
70-
uses: actions/setup-python@v1
70+
uses: actions/setup-python@v2
7171
with:
7272
python-version: "3.7"
7373
architecture: "x64"
@@ -88,9 +88,7 @@ jobs:
8888
- name: Install the Python dependencies
8989
if: steps.filter.outputs.extension == 'true'
9090
run: |
91-
python -m pip install --upgrade pip
92-
python -m pip install jupyter_packaging
93-
python -m pip install jupyterlab
91+
python -m pip install --upgrade pip jupyter_packaging~=0.7.9 jupyterlab~=3.0
9492
- name: Install the NPM dependencies
9593
if: steps.filter.outputs.extension == 'true'
9694
run: |
@@ -112,9 +110,7 @@ jobs:
112110
run: |
113111
cd ${EXAMPLE_FOLDER}
114112
pip install -e .
115-
jupyter labextension list 1>labextensions 2>&1
116-
cat labextensions
117-
cat labextensions | grep -i "@jupyterlab-examples/*.*OK"
113+
jupyter labextension list 2>&1 | grep -ie "@jupyterlab-examples/*.*OK"
118114
python -m jupyterlab.browser_check
119115
pip uninstall -y $(python setup.py --name)
120116
env:
@@ -161,7 +157,7 @@ jobs:
161157
shell: bash
162158
- name: Install Python
163159
if: steps.filter.outputs.extension == 'true'
164-
uses: actions/setup-python@v1
160+
uses: actions/setup-python@v2
165161
with:
166162
python-version: "3.7"
167163
architecture: "x64"
@@ -182,9 +178,7 @@ jobs:
182178
- name: Install the Python dependencies
183179
if: steps.filter.outputs.extension == 'true'
184180
run: |
185-
python -m pip install --upgrade pip
186-
python -m pip install jupyter_packaging
187-
python -m pip install jupyterlab
181+
python -m pip install --upgrade pip jupyter_packaging~=0.7.9 jupyterlab~=3.0
188182
- name: Install the NPM dependencies
189183
if: steps.filter.outputs.extension == 'true'
190184
run: |
@@ -206,10 +200,8 @@ jobs:
206200
- name: Check extension as dev
207201
if: steps.filter.outputs.extension == 'true' && ( startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS') )
208202
run: |
209-
jupyter server extension list 1>serverextensions 2>&1
210-
cat serverextensions | grep "jlab_ext_example.*OK"
211-
jupyter labextension list 1>labextensions 2>&1
212-
cat labextensions | grep "@jupyterlab-examples/server-extension.*OK"
203+
jupyter server extension list 2>&1 | grep -ie "jlab_ext_example.*OK"
204+
jupyter labextension list 2>&1 | grep -ie "@jupyterlab-examples/server-extension.*OK"
213205
- name: Clean extension installation
214206
if: steps.filter.outputs.extension == 'true'
215207
run: |
@@ -222,14 +214,11 @@ jobs:
222214
run: |
223215
cd advanced/server-extension
224216
pip install -e .
225-
jupyter server extension enable --py jlab_ext_example
226217
- name: Check extension as dev
227218
if: steps.filter.outputs.extension == 'true' && ( startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS') )
228219
run: |
229-
jupyter server extension list 1>serverextensions 2>&1
230-
cat serverextensions | grep "jlab_ext_example.*OK"
231-
jupyter labextension list 1>labextensions 2>&1
232-
cat labextensions | grep "@jupyterlab-examples/server-extension.*OK"
220+
jupyter server extension list 2>&1 | grep -ie "jlab_ext_example.*OK"
221+
jupyter labextension list 2>&1 | grep -ie "@jupyterlab-examples/server-extension.*OK"
233222
python -m jupyterlab.browser_check
234223
235224
build_all:
@@ -255,7 +244,7 @@ jobs:
255244
with:
256245
node-version: "12.x"
257246
- name: Install Python
258-
uses: actions/setup-python@v1
247+
uses: actions/setup-python@v2
259248
with:
260249
python-version: "3.7"
261250
architecture: "x64"
@@ -272,11 +261,12 @@ jobs:
272261
restore-keys: |
273262
${{ runner.os }}-pip-
274263
- name: Install the Python dependencies
275-
run: python -m pip install jupyterlab
264+
run: python -m pip install jupyterlab~=3.0 pytest pytest-check-links
276265
- name: Bootstrap the jlpm deps
277266
run: jlpm
278267
- name: Build all the extensions
279268
run: |
269+
pytest --check-links
280270
jlpm build-ext
281271
jlpm lint:check
282272
jlpm install-ext

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ node_modules
33
**/lib
44
**/package.json
55
**/labextension
6+
**/.pytest_cache

README.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ You can expect from each example:
7777
- The list of used JupyterLab API and Extension Points.
7878
- Explanations of the internal working, illustrated with code snippets.
7979

80-
We have structured the examples based on the [extension points](https://jupyterlab.readthedocs.io/en/stable/developer/extension_points.html). Browse the previews below or skip them and [jump directly to the sections for developers](#prerequisites).
80+
We have structured the examples based on the [extension points](https://jupyterlab.readthedocs.io/en/stable/extension/extension_points.html). Browse the previews below or skip them and [jump directly to the sections for developers](#prerequisites).
8181

8282
You are welcome to open any [issue](https://github.com/jupyterlab/extension-examples/issues) or [pull request](https://github.com/jupyterlab/extension-examples/pulls).
8383

@@ -255,16 +255,14 @@ jlpm clean-ext
255255
Go to the example directory you want to install, e.g. `cd ./basics/hello-world`, and run the following commands:
256256

257257
```bash
258-
jlpm install
259-
jlpm run build
260-
jupyter labextension install .
258+
pip install -e .
259+
jupyter labextension develop . --overwrite
261260
```
262261

263-
Rebuild the JupyterLab application:
262+
Rebuild the extension:
264263

265264
```bash
266265
jlpm run build
267-
jupyter lab build
268266
```
269267

270268
You can now start JupyterLab and check if your extension is working fine:
@@ -296,11 +294,11 @@ We are using [embedme](https://github.com/zakhenry/embedme) to embed code snippe
296294

297295
## Install a Published Extension
298296

299-
Once your extension is published (outside of this scope), you can install it
297+
Once your extension is published on [pypi.org](https://pypi.org/) (outside of this scope), you can install it
300298
with the following command:
301299

302300
```bash
303-
jupyter labextension install <published_extension>
301+
pip install <published_extension>
304302
```
305303

306304
## About JupyterLab
@@ -313,9 +311,9 @@ of libraries from different languages.
313311

314312
Complementary to these examples, you can rely on the official JupyterLab documentation.
315313

316-
- [Extension Developer Guide](https://jupyterlab.readthedocs.io/en/stable/developer/extension_dev.html)
317-
- [Common Extension Points](https://jupyterlab.readthedocs.io/en/stable/developer/extension_points.html)
318-
- [Astronomy Picture of the Day JupyterLab Extension](https://jupyterLab.readthedocs.io/en/stable/developer/extension_tutorial.html)
314+
- [Extension Developer Guide](https://jupyterlab.readthedocs.io/en/stable/extension/extension_dev.html)
315+
- [Common Extension Points](https://jupyterlab.readthedocs.io/en/stable/extension/extension_points.html)
316+
- [Astronomy Picture of the Day JupyterLab Extension](https://jupyterLab.readthedocs.io/en/stable/extension/extension_tutorial.html)
319317

320318
## Credits
321319

advanced/kernel-messaging/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
![Kernel Messages](preview.gif)
1111

12-
## Custom Kernel Interactions: Kernel Managment and Messaging
12+
## Custom Kernel Interactions: Kernel Management and Messaging
1313

1414
One of the main features of JupyterLab is the possibility to manage and
1515
interact with [kernels](https://jupyter-client.readthedocs.io/en/latest/kernels.html).
@@ -32,7 +32,7 @@ execution result.
3232
## Initializing and managing a Kernel Session (`panel.ts`)
3333

3434
Jupyterlab provides a class `SessionContext`
35-
([see the documentation](https://jupyterlab.github.io/jupyterlab/apputils/classes/sessioncontext.html))
35+
([see the documentation](https://jupyterlab.github.io/jupyterlab/classes/_apputils_src_index_.sessioncontext.html))
3636
that manages a single kernel session. Here is the code to initialize such session:
3737

3838
```ts
@@ -76,7 +76,7 @@ const manager = app.serviceManager;
7676
With these lines, you can extend the panel widget from the [signal example](../../basics/signals) to initialize a
7777
kernel. In addition, you will create a `KernelModel` class in it and
7878
overwrite the `dispose` and `onCloseRequest` methods of the `StackedPanel`
79-
([see the documentation](https://jupyterlab.github.io/lumino/api/widgets/classes/stackedpanel.html))
79+
([see the documentation](https://jupyterlab.github.io/lumino/widgets/classes/stackedpanel.html))
8080
to free the kernel session resources if the panel is closed. The whole adapted
8181
panel class looks like this:
8282

advanced/kernel-output/README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ followed by the creation of the visual element.
3737
## Initializing a Kernel Session
3838

3939
To interact with a kernel, you can create a `SessionContext`
40-
object ([see the documentation](https://jupyterlab.github.io/jupyterlab/apputils/classes/sessioncontext.html)).
40+
object ([see the documentation](https://jupyterlab.github.io/jupyterlab/classes/_apputils_src_index_.sessioncontext.html)).
4141
Here it is stored in the private `_sessionContext` variable:
4242

4343
```ts
44-
// src/panel.ts#L94-L94
44+
// src/panel.ts#L95-L95
4545

4646
private _sessionContext: SessionContext;
4747
```
@@ -50,7 +50,7 @@ A `SessionContext` handles a single kernel session. The session itself (not yet
5050
the kernel) is started with these lines:
5151

5252
```ts
53-
// src/panel.ts#L44-L48
53+
// src/panel.ts#L45-L49
5454

5555
this._sessionContext = new SessionContext({
5656
sessionManager: manager.sessions,
@@ -63,7 +63,7 @@ The private session variable is exposed as read-only for other users
6363
through a getter method:
6464

6565
```ts
66-
// src/panel.ts#L72-L74
66+
// src/panel.ts#L73-L75
6767

6868
get session(): ISessionContext {
6969
return this._sessionContext;
@@ -75,7 +75,7 @@ with this line:
7575

7676
<!-- prettier-ignore-start -->
7777
```ts
78-
// src/panel.ts#L58-L69
78+
// src/panel.ts#L59-L70
7979

8080
void this._sessionContext
8181
.initialize()
@@ -93,13 +93,13 @@ void this._sessionContext
9393
<!-- prettier-ignore-end -->
9494

9595
When a session has no predefined preferred kernel, a dialog will request the user to choose a kernel to start. Conveniently, this can
96-
also be an already existing kernel, as you will see later.
96+
also be an already existing kernel.
9797

9898
The following two methods ensure the clean disposal of the session
9999
when you close the panel.
100100

101101
```ts
102-
// src/panel.ts#L76-L79
102+
// src/panel.ts#L77-L80
103103

104104
dispose(): void {
105105
this._sessionContext.dispose();
@@ -108,7 +108,7 @@ dispose(): void {
108108
```
109109

110110
```ts
111-
// src/panel.ts#L89-L92
111+
// src/panel.ts#L90-L93
112112

113113
protected onCloseRequest(msg: Message): void {
114114
super.onCloseRequest(msg);
@@ -120,11 +120,11 @@ protected onCloseRequest(msg: Message): void {
120120

121121
The `SimplifiedOutputArea` class is a `Widget`, as described in the [widget example](../../widget-tracker/widgets/README.md).
122122
It has the ability to display the results of a notebook cell execution.
123-
You can instantiate it with a new `OutputAreaModel`; this is class containing
123+
You can instantiate it with a new `OutputAreaModel`; this class is containing
124124
the data to show:
125125

126126
```ts
127-
// src/panel.ts#L50-L54
127+
// src/panel.ts#L51-L55
128128

129129
this._outputareamodel = new OutputAreaModel();
130130
this._outputarea = new SimplifiedOutputArea({
@@ -134,11 +134,11 @@ this._outputarea = new SimplifiedOutputArea({
134134
```
135135

136136
`SimplifiedOutputArea` provides a static method `execute` that sends
137-
some code to a kernel through a `ISessionContext` ([see documentation](https://jupyterlab.github.io/jupyterlab/outputarea/classes/simplifiedoutputarea.html#execute)). And then it displays the result
137+
some code to a kernel through a `ISessionContext` ([see documentation](https://jupyterlab.github.io/jupyterlab/classes/_outputarea_src_index_.simplifiedoutputarea.html#execute)). And then it displays the result
138138
in the specific `SimplifiedOutputArea` object you created:
139139

140140
```ts
141-
// src/panel.ts#L81-L87
141+
// src/panel.ts#L82-L88
142142

143143
execute(code: string): void {
144144
SimplifiedOutputArea.execute(code, this._outputarea, this._sessionContext)
@@ -158,7 +158,7 @@ To display the `SimplifiedOutputArea` Widget you need to add it to your
158158
panel with:
159159

160160
```ts
161-
// src/panel.ts#L56-L56
161+
// src/panel.ts#L57-L57
162162

163163
this.addWidget(this._outputarea);
164164
```
@@ -266,4 +266,4 @@ the variable name in the input dialog, it will be displayed in the example panel
266266
## Where to Go Next
267267

268268
This example makes use of input dialogs. To know which input dialogs are available
269-
have a look at the [documentation](https://jupyterlab.readthedocs.io/en/stable/developer/ui_helpers.html).
269+
have a look at the [documentation](https://jupyterlab.readthedocs.io/en/stable/extension/ui_helpers.html#dialogs).

advanced/kernel-output/src/panel.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { OutputAreaModel, SimplifiedOutputArea } from '@jupyterlab/outputarea';
99
import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
1010

1111
import { KernelMessage, ServiceManager } from '@jupyterlab/services';
12+
1213
import {
1314
ITranslator,
1415
nullTranslator,

0 commit comments

Comments
 (0)