From 8b8182de949a416423b9cb15c53a19ceb89bd8c5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 7 Feb 2024 15:32:11 +0100 Subject: [PATCH] chore: update pre-commit hooks (#435) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update pre-commit hooks updates: - [github.com/python-jsonschema/check-jsonschema: 0.27.3 → 0.27.4](https://github.com/python-jsonschema/check-jsonschema/compare/0.27.3...0.27.4) - [github.com/astral-sh/ruff-pre-commit: v0.1.9 → v0.2.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.9...v0.2.0) - [github.com/scientific-python/cookie: 2023.12.21 → 2024.01.24](https://github.com/scientific-python/cookie/compare/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 --- .pre-commit-config.yaml | 6 +++--- jupyterlab_server/licenses_handler.py | 12 +++++------- tests/test_workspaces_api.py | 7 ++++--- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e21d7a90..aa4948a0 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 27fcac87..c60aaa94 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 9b65855c..a1f49c53 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]