Skip to content

Commit 20a463e

Browse files
authored
Update typings for Server 2.10.1 and mypy 1.7 (#425)
1 parent 240cbb3 commit 20a463e

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ repos:
3333
[mdformat-gfm, mdformat-frontmatter, mdformat-footnote]
3434

3535
- repo: https://github.com/pre-commit/mirrors-prettier
36-
rev: "v3.0.3"
36+
rev: "v3.1.0"
3737
hooks:
3838
- id: prettier
3939
types_or: [yaml, json]
@@ -58,7 +58,7 @@ repos:
5858
- id: rst-inline-touching-normal
5959

6060
- repo: https://github.com/pre-commit/mirrors-mypy
61-
rev: "v1.6.1"
61+
rev: "v1.7.0"
6262
hooks:
6363
- id: mypy
6464
files: "^jupyterlab_server"
@@ -67,7 +67,7 @@ repos:
6767
additional_dependencies:
6868
[
6969
"traitlets>=5.3",
70-
"jupyter_server>=2.10",
70+
"jupyter_server>=2.10.1",
7171
"openapi_core",
7272
"json5",
7373
"pytest",

jupyterlab_server/settings_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ def _get_user_settings(settings_dir: str, schema_name: str, schema: Any) -> dict
9292

9393
if os.path.exists(path):
9494
stat = os.stat(path)
95-
last_modified = tz.utcfromtimestamp(stat.st_mtime).isoformat() # type:ignore[no-untyped-call]
96-
created = tz.utcfromtimestamp(stat.st_ctime).isoformat() # type:ignore[no-untyped-call]
95+
last_modified = tz.utcfromtimestamp(stat.st_mtime).isoformat()
96+
created = tz.utcfromtimestamp(stat.st_ctime).isoformat()
9797
with open(path, encoding="utf-8") as fid:
9898
try: # to load and parse the settings file.
9999
raw = fid.read() or raw

jupyterlab_server/workspaces_handler.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ def _load_with_file_times(workspace_path: Path) -> dict:
5757
with workspace_path.open(encoding="utf-8") as fid:
5858
workspace = json.load(fid)
5959
workspace["metadata"].update(
60-
last_modified=tz.utcfromtimestamp(stat.st_mtime).isoformat(), # type:ignore[no-untyped-call]
61-
created=tz.utcfromtimestamp(stat.st_ctime).isoformat(), # type:ignore[no-untyped-call]
60+
last_modified=tz.utcfromtimestamp(stat.st_mtime).isoformat(),
61+
created=tz.utcfromtimestamp(stat.st_ctime).isoformat(),
6262
)
6363
return workspace
6464

@@ -170,9 +170,7 @@ def save(self, space_name: str, raw: str) -> Path:
170170
class WorkspacesHandler(ExtensionHandlerMixin, ExtensionHandlerJinjaMixin, APIHandler):
171171
"""A workspaces API handler."""
172172

173-
def initialize( # type:ignore[override]
174-
self, name: str, manager: WorkspacesManager, **kwargs: Any
175-
) -> None:
173+
def initialize(self, name: str, manager: WorkspacesManager, **kwargs: Any) -> None:
176174
"""Initialize the handler."""
177175
super().initialize(name)
178176
self.manager = manager

0 commit comments

Comments
 (0)