From e11559e3c7b0b8d582e7718c839fa4d6a0bb874a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 Jul 2026 22:16:03 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v5.0.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v5.0.0...v6.0.0) - [github.com/astral-sh/ruff-pre-commit: v0.11.6 → v0.16.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.6...v0.16.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a944254..25254f7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -16,7 +16,7 @@ repos: - id: check-merge-conflict - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.11.6 + rev: v0.16.0 hooks: - id: ruff args: [--fix] From eae9d106b2bbeb4ff84e080b6902db1cd8f9a959 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 Jul 2026 22:17:01 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- plugin/examples/basic.py | 1 - plugin/examples/cw-test.py | 1 - plugin/examples/example.py | 1 - plugin/examples/getting-started.py | 4 ---- plugin/examples/gpu-getting-started.py | 2 -- plugin/examples/with-cw.py | 1 - plugin/examples/with-sshfs.py | 1 - plugin/examples/with-storage.py | 1 - plugin/kubectl_marimo/delete.py | 4 ++-- plugin/kubectl_marimo/deploy.py | 4 ++-- plugin/kubectl_marimo/formats/python.py | 3 ++- plugin/kubectl_marimo/main.py | 3 +-- plugin/kubectl_marimo/resources.py | 1 - plugin/kubectl_marimo/swap.py | 5 ++--- plugin/tests/test_delete.py | 1 - plugin/tests/test_deploy.py | 1 - plugin/tests/test_formats.py | 4 ++-- plugin/tests/test_resources.py | 11 +++++------ plugin/tests/test_status.py | 3 +-- plugin/tests/test_swap.py | 6 +++--- 20 files changed, 20 insertions(+), 38 deletions(-) diff --git a/plugin/examples/basic.py b/plugin/examples/basic.py index e2075a4..80e4154 100644 --- a/plugin/examples/basic.py +++ b/plugin/examples/basic.py @@ -7,7 +7,6 @@ @app.cell def _(): print("In notebook.py") - return if __name__ == "__main__": diff --git a/plugin/examples/cw-test.py b/plugin/examples/cw-test.py index 2668084..30d26df 100644 --- a/plugin/examples/cw-test.py +++ b/plugin/examples/cw-test.py @@ -27,7 +27,6 @@ def check_mount(): print(f"{f}: {fp.read()[:100]}") else: print("Mount not ready") - return if __name__ == "__main__": diff --git a/plugin/examples/example.py b/plugin/examples/example.py index d413ac9..7900bfa 100644 --- a/plugin/examples/example.py +++ b/plugin/examples/example.py @@ -7,7 +7,6 @@ @app.cell def _(): print("righto!") - return if __name__ == "__main__": diff --git a/plugin/examples/getting-started.py b/plugin/examples/getting-started.py index eecb18d..afbf80e 100644 --- a/plugin/examples/getting-started.py +++ b/plugin/examples/getting-started.py @@ -19,7 +19,6 @@ def _(mo): This notebook introduces marimo's **reactive execution model** — if you're coming from Jupyter, this is the key difference to understand. """) - return @app.cell @@ -49,7 +48,6 @@ def _(mo, slider): 3. **No cell numbers** — Order on the page doesn't determine execution order """ ) - return @app.cell @@ -63,7 +61,6 @@ def _(mo, slider): This cell depends on `slider.value`, so it updates automatically when you interact with the slider. marimo tracks these dependencies for you. """) - return @app.cell(hide_code=True) @@ -77,7 +74,6 @@ def _(mo): - **Run as an app** — Use `kubectl marimo run` to serve as a read-only dashboard """) - return @app.cell diff --git a/plugin/examples/gpu-getting-started.py b/plugin/examples/gpu-getting-started.py index 6541a9b..9a5f2a0 100644 --- a/plugin/examples/gpu-getting-started.py +++ b/plugin/examples/gpu-getting-started.py @@ -83,7 +83,6 @@ def matrix_multiply(n: int, device: str): 3. **Share results** — cached data persists in storage, accessible across sessions """) - return @app.cell @@ -102,7 +101,6 @@ def _(mo): See [marimo caching docs](https://docs.marimo.io/api/caching/) for more. """) - return if __name__ == "__main__": diff --git a/plugin/examples/with-cw.py b/plugin/examples/with-cw.py index b5c639e..200f784 100644 --- a/plugin/examples/with-cw.py +++ b/plugin/examples/with-cw.py @@ -45,7 +45,6 @@ def read_test_file(os): if os.path.exists("/home/marimo/notebooks/mounts") else "none", ) - return if __name__ == "__main__": diff --git a/plugin/examples/with-sshfs.py b/plugin/examples/with-sshfs.py index 26955a2..ccc0951 100644 --- a/plugin/examples/with-sshfs.py +++ b/plugin/examples/with-sshfs.py @@ -18,7 +18,6 @@ def check_mount(): mount_path = "/home/marimo/notebooks/mounts/sshfs-0" exists = os.path.exists(mount_path) os.listdir(mount_path) if exists else [] - return if __name__ == "__main__": diff --git a/plugin/examples/with-storage.py b/plugin/examples/with-storage.py index d17d894..719bb35 100644 --- a/plugin/examples/with-storage.py +++ b/plugin/examples/with-storage.py @@ -16,7 +16,6 @@ def check(): path = "/home/marimo/notebooks" os.listdir(path) if os.path.exists(path) else [] - return if __name__ == "__main__": diff --git a/plugin/kubectl_marimo/delete.py b/plugin/kubectl_marimo/delete.py index f455eb1..1b568b2 100644 --- a/plugin/kubectl_marimo/delete.py +++ b/plugin/kubectl_marimo/delete.py @@ -7,8 +7,8 @@ from .formats import parse_file from .k8s import delete_resource, exec_in_pod, patch_resource -from .resources import compute_hash, resource_name, detect_content_type -from .swap import read_swap_file, delete_swap_file +from .resources import compute_hash, detect_content_type, resource_name +from .swap import delete_swap_file, read_swap_file from .sync import sync_local_mounts diff --git a/plugin/kubectl_marimo/deploy.py b/plugin/kubectl_marimo/deploy.py index 6fbf8dd..962bc21 100644 --- a/plugin/kubectl_marimo/deploy.py +++ b/plugin/kubectl_marimo/deploy.py @@ -14,8 +14,8 @@ from .formats import parse_file from .k8s import apply_resource, delete_resource, resource_exists -from .resources import build_marimo_notebook, resource_name, compute_hash, to_yaml -from .swap import read_swap_file, write_swap_file, create_swap_meta, delete_swap_file +from .resources import build_marimo_notebook, compute_hash, resource_name, to_yaml +from .swap import create_swap_meta, delete_swap_file, read_swap_file, write_swap_file from .sync import sync_notebook diff --git a/plugin/kubectl_marimo/formats/python.py b/plugin/kubectl_marimo/formats/python.py index d1aea8b..af32e21 100644 --- a/plugin/kubectl_marimo/formats/python.py +++ b/plugin/kubectl_marimo/formats/python.py @@ -1,9 +1,10 @@ """Parser for marimo Python notebooks.""" import re -import tomllib from typing import Any +import tomllib + def parse_python(content: str) -> tuple[str, dict[str, Any] | None]: """Parse marimo Python notebook. diff --git a/plugin/kubectl_marimo/main.py b/plugin/kubectl_marimo/main.py index 2a982d2..13e021e 100644 --- a/plugin/kubectl_marimo/main.py +++ b/plugin/kubectl_marimo/main.py @@ -3,8 +3,8 @@ import click from . import __version__ -from .deploy import deploy_notebook from .delete import delete_notebook +from .deploy import deploy_notebook from .status import show_status from .sync import sync_notebook @@ -23,7 +23,6 @@ def cli(): kubectl marimo delete notebook.py kubectl marimo status """ - pass @cli.command() diff --git a/plugin/kubectl_marimo/resources.py b/plugin/kubectl_marimo/resources.py index 05f1c41..30a11e7 100644 --- a/plugin/kubectl_marimo/resources.py +++ b/plugin/kubectl_marimo/resources.py @@ -6,7 +6,6 @@ from pathlib import Path from typing import Any - # Default SSH image, configurable via environment SSH_IMAGE = os.environ.get("SSH_IMAGE", "linuxserver/openssh-server:latest") diff --git a/plugin/kubectl_marimo/swap.py b/plugin/kubectl_marimo/swap.py index 0ac7a95..1b2d6ec 100644 --- a/plugin/kubectl_marimo/swap.py +++ b/plugin/kubectl_marimo/swap.py @@ -1,10 +1,9 @@ """Swap file management for tracking deployments.""" import json -from dataclasses import dataclass, asdict +from dataclasses import asdict, dataclass from datetime import datetime, timezone from pathlib import Path -from typing import Optional @dataclass @@ -50,7 +49,7 @@ def write_swap_file(file_path: str, meta: SwapMeta) -> None: json.dump(meta.to_dict(), f, indent=2) -def read_swap_file(file_path: str) -> Optional[SwapMeta]: +def read_swap_file(file_path: str) -> SwapMeta | None: """Read swap file if it exists.""" swap_path = swap_file_path(file_path) if not swap_path.exists(): diff --git a/plugin/tests/test_delete.py b/plugin/tests/test_delete.py index 38f9d55..8da785b 100644 --- a/plugin/tests/test_delete.py +++ b/plugin/tests/test_delete.py @@ -1,7 +1,6 @@ """Tests for delete module.""" import pytest - from kubectl_marimo.delete import delete_notebook diff --git a/plugin/tests/test_deploy.py b/plugin/tests/test_deploy.py index 8678ff5..4886aff 100644 --- a/plugin/tests/test_deploy.py +++ b/plugin/tests/test_deploy.py @@ -3,7 +3,6 @@ import socket import pytest - from kubectl_marimo.deploy import ( check_secret_exists, ensure_cw_credentials, diff --git a/plugin/tests/test_formats.py b/plugin/tests/test_formats.py index 85e483c..3eb5378 100644 --- a/plugin/tests/test_formats.py +++ b/plugin/tests/test_formats.py @@ -1,14 +1,14 @@ """Tests for format parsers.""" from kubectl_marimo.formats.markdown import ( - parse_markdown, extract_frontmatter, is_marimo_markdown, + parse_markdown, ) from kubectl_marimo.formats.python import ( - parse_python, extract_pep723_metadata, is_marimo_python, + parse_python, ) diff --git a/plugin/tests/test_resources.py b/plugin/tests/test_resources.py index 422a82b..3379756 100644 --- a/plugin/tests/test_resources.py +++ b/plugin/tests/test_resources.py @@ -1,17 +1,16 @@ """Tests for resources module.""" import pytest - from kubectl_marimo.resources import ( - compute_hash, - slugify, - resource_name, build_marimo_notebook, + build_ssh_sidecar, + compute_hash, detect_content_type, + filter_mounts, parse_env, parse_mount_uri, - filter_mounts, - build_ssh_sidecar, + resource_name, + slugify, ) diff --git a/plugin/tests/test_status.py b/plugin/tests/test_status.py index e4c7cae..8f23786 100644 --- a/plugin/tests/test_status.py +++ b/plugin/tests/test_status.py @@ -2,8 +2,7 @@ import json - -from kubectl_marimo.status import show_status, format_elapsed +from kubectl_marimo.status import format_elapsed, show_status class TestShowStatus: diff --git a/plugin/tests/test_swap.py b/plugin/tests/test_swap.py index 452adf6..88561bd 100644 --- a/plugin/tests/test_swap.py +++ b/plugin/tests/test_swap.py @@ -4,11 +4,11 @@ from kubectl_marimo.swap import ( SwapMeta, + create_swap_meta, + delete_swap_file, + read_swap_file, swap_file_path, write_swap_file, - read_swap_file, - delete_swap_file, - create_swap_meta, )