Skip to content

Commit 8b8182d

Browse files
chore: update pre-commit hooks (#435)
* chore: update pre-commit hooks updates: - [github.com/python-jsonschema/check-jsonschema: 0.27.3 → 0.27.4](python-jsonschema/check-jsonschema@0.27.3...0.27.4) - [github.com/astral-sh/ruff-pre-commit: v0.1.9 → v0.2.0](astral-sh/ruff-pre-commit@v0.1.9...v0.2.0) - [github.com/scientific-python/cookie: 2023.12.21 → 2024.01.24](scientific-python/cookie@2023.12.21...2024.01.24) * Fixes RUF017 * [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 <fcollonval@gmail.com>
1 parent 75b1ec0 commit 8b8182d

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ repos:
2121
- id: trailing-whitespace
2222

2323
- repo: https://github.com/python-jsonschema/check-jsonschema
24-
rev: 0.27.3
24+
rev: 0.27.4
2525
hooks:
2626
- id: check-github-workflows
2727

@@ -77,7 +77,7 @@ repos:
7777
]
7878

7979
- repo: https://github.com/astral-sh/ruff-pre-commit
80-
rev: v0.1.9
80+
rev: v0.2.0
8181
hooks:
8282
- id: ruff
8383
types_or: [python, jupyter]
@@ -86,7 +86,7 @@ repos:
8686
types_or: [python, jupyter]
8787

8888
- repo: https://github.com/scientific-python/cookie
89-
rev: "2023.12.21"
89+
rev: "2024.01.24"
9090
hooks:
9191
- id: sp-repo-review
9292
additional_dependencies: ["repo-review[cli]"]

jupyterlab_server/licenses_handler.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,11 @@ def federated_extensions(self) -> dict[str, Any]:
5858

5959
assert isinstance(self.parent, LabServerApp)
6060

61-
labextensions_path: list = sum(
62-
[
63-
self.parent.labextensions_path,
64-
self.parent.extra_labextensions_path,
65-
],
66-
[],
67-
)
61+
per_paths = [
62+
self.parent.labextensions_path,
63+
self.parent.extra_labextensions_path,
64+
]
65+
labextensions_path = [extension for extensions in per_paths for extension in extensions]
6866
return get_federated_extensions(labextensions_path)
6967

7068
async def report_async(

tests/test_workspaces_api.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,10 @@ async def test_listing_dates(jp_fetch, labserverapp):
121121
r = await jp_fetch("lab", "api", "workspaces")
122122
data = json.loads(r.body.decode())
123123
values = data["workspaces"]["values"]
124-
times: list = sum(
125-
([ws["metadata"].get("last_modified"), ws["metadata"].get("created")] for ws in values), []
126-
)
124+
workspaces = [
125+
[ws["metadata"].get("last_modified"), ws["metadata"].get("created")] for ws in values
126+
]
127+
times = [time for workspace in workspaces for time in workspace]
127128
assert None not in times
128129
[rfc3339_to_timestamp(t) for t in times]
129130

0 commit comments

Comments
 (0)