diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e21d7a9..aa4948a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,7 +21,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.27.3 + rev: 0.27.4 hooks: - id: check-github-workflows @@ -77,7 +77,7 @@ repos: ] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.9 + rev: v0.2.0 hooks: - id: ruff types_or: [python, jupyter] @@ -86,7 +86,7 @@ repos: types_or: [python, jupyter] - repo: https://github.com/scientific-python/cookie - rev: "2023.12.21" + rev: "2024.01.24" hooks: - id: sp-repo-review additional_dependencies: ["repo-review[cli]"] diff --git a/jupyterlab_server/licenses_handler.py b/jupyterlab_server/licenses_handler.py index 27fcac8..c60aaa9 100644 --- a/jupyterlab_server/licenses_handler.py +++ b/jupyterlab_server/licenses_handler.py @@ -58,13 +58,11 @@ def federated_extensions(self) -> dict[str, Any]: assert isinstance(self.parent, LabServerApp) - labextensions_path: list = sum( - [ - self.parent.labextensions_path, - self.parent.extra_labextensions_path, - ], - [], - ) + per_paths = [ + self.parent.labextensions_path, + self.parent.extra_labextensions_path, + ] + labextensions_path = [extension for extensions in per_paths for extension in extensions] return get_federated_extensions(labextensions_path) async def report_async( diff --git a/tests/test_workspaces_api.py b/tests/test_workspaces_api.py index 9b65855..a1f49c5 100644 --- a/tests/test_workspaces_api.py +++ b/tests/test_workspaces_api.py @@ -121,9 +121,10 @@ async def test_listing_dates(jp_fetch, labserverapp): r = await jp_fetch("lab", "api", "workspaces") data = json.loads(r.body.decode()) values = data["workspaces"]["values"] - times: list = sum( - ([ws["metadata"].get("last_modified"), ws["metadata"].get("created")] for ws in values), [] - ) + workspaces = [ + [ws["metadata"].get("last_modified"), ws["metadata"].get("created")] for ws in values + ] + times = [time for workspace in workspaces for time in workspace] assert None not in times [rfc3339_to_timestamp(t) for t in times]