Skip to content

Commit 6704acc

Browse files
pre-commit-ci[bot]fcollonvalblink1073
authored
[pre-commit.ci] pre-commit autoupdate (#411)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/python-jsonschema/check-jsonschema: 0.26.3 → 0.27.0](python-jsonschema/check-jsonschema@0.26.3...0.27.0) - [github.com/psf/black: 23.7.0 → 23.9.1](psf/black@23.7.0...23.9.1) - [github.com/astral-sh/ruff-pre-commit: v0.0.287 → v0.0.292](astral-sh/ruff-pre-commit@v0.0.287...v0.0.292) * Fix readthedocs config * typing updates * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Frédéric Collonval <[email protected]> Co-authored-by: Steven Silvester <[email protected]>
1 parent 93ea539 commit 6704acc

File tree

6 files changed

+29
-8
lines changed

6 files changed

+29
-8
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repos:
1919
- id: trailing-whitespace
2020

2121
- repo: https://github.com/python-jsonschema/check-jsonschema
22-
rev: 0.26.3
22+
rev: 0.27.0
2323
hooks:
2424
- id: check-github-workflows
2525

@@ -31,12 +31,12 @@ repos:
3131
[mdformat-gfm, mdformat-frontmatter, mdformat-footnote]
3232

3333
- repo: https://github.com/psf/black
34-
rev: 23.7.0
34+
rev: 23.9.1
3535
hooks:
3636
- id: black
3737

3838
- repo: https://github.com/astral-sh/ruff-pre-commit
39-
rev: v0.0.287
39+
rev: v0.0.292
4040
hooks:
4141
- id: ruff
4242
args: ["--fix"]

.readthedocs.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
version: 2
2+
3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3.11"
7+
28
sphinx:
39
configuration: docs/source/conf.py
10+
411
python:
5-
version: 3.8
612
install:
713
# install itself with pip install .
814
- method: pip

jupyterlab_server/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class LabServerApp(ExtensionAppJinjaMixin, LabConfig, ExtensionApp):
1919

2020
name = "jupyterlab_server"
2121
extension_url = "/lab"
22-
app_name = "JupyterLab Server Application"
23-
file_url_prefix = "/lab/tree" # type:ignore
22+
app_name = "JupyterLab Server Application" # type:ignore[assignment]
23+
file_url_prefix = "/lab/tree" # type:ignore[assignment]
2424

2525
@property
2626
def app_namespace(self):

jupyterlab_server/licenses_handler.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import re
1111
from concurrent.futures import ThreadPoolExecutor
1212
from pathlib import Path
13+
from typing import TYPE_CHECKING
1314

1415
from jupyter_server.base.handlers import APIHandler
1516
from tornado import gen, web
@@ -50,6 +51,11 @@ def federated_extensions(self):
5051
This is expensive, but probably the only way to be sure to get
5152
up-to-date license information for extensions installed interactively.
5253
"""
54+
if TYPE_CHECKING:
55+
from .app import LabServerApp
56+
57+
assert isinstance(self.parent, LabServerApp)
58+
5359
labextensions_path: list = sum(
5460
[
5561
self.parent.labextensions_path,
@@ -200,6 +206,10 @@ def app_static_info(self):
200206
This will usually be in `static_dir`, but may also appear in the
201207
parent of `static_dir`.
202208
"""
209+
if TYPE_CHECKING:
210+
from .app import LabServerApp
211+
212+
assert isinstance(self.parent, LabServerApp)
203213
path = Path(self.parent.static_dir)
204214
package_json = path / "package.json"
205215
if not package_json.exists():
@@ -253,6 +263,11 @@ async def get(self, _args):
253263
full_text=full_text,
254264
)
255265

266+
if TYPE_CHECKING:
267+
from .app import LabServerApp
268+
269+
assert isinstance(self.manager.parent, LabServerApp)
270+
256271
if download:
257272
filename = "{}-licenses{}".format(
258273
self.manager.parent.app_name.lower(), mimetypes.guess_extension(mime)

jupyterlab_server/process_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class ProcessApp(ExtensionAppJinjaMixin, LabConfig, ExtensionApp):
1717
load_other_extensions = True
1818

1919
# Do not open a browser for process apps
20-
open_browser = False
20+
open_browser = False # type:ignore[assignment]
2121

2222
def get_command(self):
2323
"""Get the command and kwargs to run with `Process`.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ nowarn = "test -W default {args}"
109109

110110
[tool.hatch.envs.typing]
111111
features = ["test"]
112-
dependencies = ["mypy>=1.5.1"]
112+
dependencies = ["mypy>=1.5.1", "traitlets>=5.11.2"]
113113
[tool.hatch.envs.typing.scripts]
114114
test = "mypy --install-types --non-interactive {args:jupyterlab_server tests}"
115115

0 commit comments

Comments
 (0)