Skip to content

Commit 973f681

Browse files
committed
Fix linter
1 parent 539aeb3 commit 973f681

File tree

15 files changed

+36
-36
lines changed

15 files changed

+36
-36
lines changed

.copier-answers.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ project_short_description: A Jupyter Server extension to execute code cell from
1212
python_name: jupyter_server_nbmodel
1313
repository: https://github.com/datalayer/jupyter-server-nbmodel
1414
test: true
15-

.github/workflows/build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ name: Build
22

33
on:
44
push:
5-
branches: main
5+
branches:
6+
- main
67
pull_request:
7-
branches: '*'
8+
branches:
9+
- '*'
810

911
concurrency:
1012
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ repos:
3131
[mdformat-gfm, mdformat-frontmatter, mdformat-footnote]
3232

3333
- repo: https://github.com/charliermarsh/ruff-pre-commit
34-
rev: 0.4.4
34+
rev: v0.4.4
3535
hooks:
3636
- id: ruff
3737
args: ["--fix"]

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ for the frontend extension.
1111
## Requirements
1212

1313
- Jupyter Server
14-
- [optional] JupyterLab >= 4.0.0
14+
- \[optional\] JupyterLab >= 4.0.0
1515

1616
## Install
1717

@@ -79,7 +79,6 @@ sequenceDiagram
7979

8080
### With input case
8181

82-
8382
Execution of a Python code snippet: `input("Age:")`
8483

8584
```mermaid
@@ -107,7 +106,7 @@ sequenceDiagram
107106
Server-->>-Frontend: Status 300 & Pending input
108107
Frontend->>+Server: POST /api/kernels/<id>/input
109108
Server->>Kernel: Send input msg
110-
Server-->>-Frontend:
109+
Server-->>-Frontend:
111110
loop While status is 202
112111
Frontend->>+Server: GET /api/kernels/<id>/requests/<uid>
113112
Server->>ExecutionStack: Get task result
@@ -122,7 +121,7 @@ sequenceDiagram
122121
Server-->>-Frontend: Status 200 & result
123122
```
124123

125-
> [!NOTE]
124+
> \[!NOTE\]
126125
> The code snippet is always send in the body of the POST `/api/kernels/<id>/execute`
127126
> request to avoid document model discrepancy; the document on the backend is only
128127
> eventually identical with the frontends (document updates are not instantaneous).
@@ -220,7 +219,6 @@ More precisely, the JupyterLab helper [Galata](https://github.com/jupyterlab/jup
220219

221220
More information are provided within the [ui-tests](./ui-tests/README.md) README.
222221

223-
224222
### Manual testing
225223

226224
```bash

RELEASE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Here is a summary of the steps to cut a new release:
6969
- Check the draft changelog
7070
- Run the "Step 2: Publish Release" workflow
7171

72-
> [!NOTE]
72+
> \[!NOTE\]
7373
> Check out the [workflow documentation](https://jupyter-releaser.readthedocs.io/en/latest/get_started/making_release_from_repo.html)
7474
> for more information.
7575

binder/postBuild

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import subprocess
1212
import sys
1313
from pathlib import Path
1414

15-
1615
ROOT = Path.cwd()
1716

1817
def _(*args, **kwargs):

conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3-
pytest_plugins = ("pytest_jupyter.jupyter_server", )
3+
pytest_plugins = ("pytest_jupyter.jupyter_server",)
44

55

66
@pytest.fixture
@@ -9,4 +9,4 @@ def jp_server_config(jp_server_config):
99
"ServerApp": {
1010
"jpserver_extensions": {"jupyter_server_nbmodel": True, "jupyter_server_ydoc": False}
1111
}
12-
}
12+
}

examples/basic.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@
6464
"metadata": {},
6565
"outputs": [],
6666
"source": [
67-
"# FIXME\n",
68-
"# input(\"Age: \")"
67+
"input(\"Age: \")"
6968
]
7069
},
7170
{

jupyter_server_nbmodel/__init__.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,15 @@
55
# in editable mode with pip. It is highly recommended to install
66
# the package from a stable release or in editable mode: https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs
77
import warnings
8-
warnings.warn("Importing 'jupyter_server_nbmodel' outside a proper installation.")
8+
9+
warnings.warn("Importing 'jupyter_server_nbmodel' outside a proper installation.", stacklevel=1)
910
__version__ = "dev"
1011
from .extension import Extension
1112

1213

1314
def _jupyter_labextension_paths():
14-
return [{
15-
"src": "labextension",
16-
"dest": "jupyter-server-nbmodel"
17-
}]
15+
return [{"src": "labextension", "dest": "jupyter-server-nbmodel"}]
1816

1917

2018
def _jupyter_server_extension_points():
21-
return [{
22-
"module": "jupyter_server_nbmodel", "app": Extension
23-
}]
19+
return [{"module": "jupyter_server_nbmodel", "app": Extension}]

jupyter_server_nbmodel/handlers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import os
66
import typing as t
77
import uuid
8-
from dataclasses import asdict, dataclass, is_dataclass
8+
from dataclasses import asdict, dataclass
99
from functools import partial
1010
from http import HTTPStatus
1111

@@ -75,7 +75,7 @@ async def _get_ycell(
7575
metadata: dict | None,
7676
) -> y.Map | None:
7777
if ydoc is None:
78-
msg = "jupyter-collaboration extension is not installed on the server. Outputs won't be written within the document."
78+
msg = "jupyter-collaboration extension is not installed on the server. Outputs won't be written within the document." # noqa: E501
7979
get_logger().warning(msg)
8080
return None
8181

@@ -263,6 +263,7 @@ async def _kernel_worker(
263263
if to_raise is not None:
264264
raise to_raise
265265

266+
266267
class ExecutionStack:
267268
"""Execution request stack.
268269

0 commit comments

Comments
 (0)