Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down
1 change: 0 additions & 1 deletion plugin/examples/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
@app.cell
def _():
print("In notebook.py")
return


if __name__ == "__main__":
Expand Down
1 change: 0 additions & 1 deletion plugin/examples/cw-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def check_mount():
print(f"{f}: {fp.read()[:100]}")
else:
print("Mount not ready")
return


if __name__ == "__main__":
Expand Down
1 change: 0 additions & 1 deletion plugin/examples/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
@app.cell
def _():
print("righto!")
return


if __name__ == "__main__":
Expand Down
4 changes: 0 additions & 4 deletions plugin/examples/getting-started.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -49,7 +48,6 @@ def _(mo, slider):
3. **No cell numbers** — Order on the page doesn't determine execution order
"""
)
return


@app.cell
Expand All @@ -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)
Expand All @@ -77,7 +74,6 @@ def _(mo):
- **Run as an app** — Use `kubectl marimo run` to serve as a read-only
dashboard
""")
return


@app.cell
Expand Down
2 changes: 0 additions & 2 deletions plugin/examples/gpu-getting-started.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -102,7 +101,6 @@ def _(mo):

See [marimo caching docs](https://docs.marimo.io/api/caching/) for more.
""")
return


if __name__ == "__main__":
Expand Down
1 change: 0 additions & 1 deletion plugin/examples/with-cw.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def read_test_file(os):
if os.path.exists("/home/marimo/notebooks/mounts")
else "none",
)
return


if __name__ == "__main__":
Expand Down
1 change: 0 additions & 1 deletion plugin/examples/with-sshfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__":
Expand Down
1 change: 0 additions & 1 deletion plugin/examples/with-storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def check():

path = "/home/marimo/notebooks"
os.listdir(path) if os.path.exists(path) else []
return


if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions plugin/kubectl_marimo/delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
4 changes: 2 additions & 2 deletions plugin/kubectl_marimo/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
3 changes: 2 additions & 1 deletion plugin/kubectl_marimo/formats/python.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
3 changes: 1 addition & 2 deletions plugin/kubectl_marimo/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -23,7 +23,6 @@ def cli():
kubectl marimo delete notebook.py
kubectl marimo status
"""
pass


@cli.command()
Expand Down
1 change: 0 additions & 1 deletion plugin/kubectl_marimo/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
5 changes: 2 additions & 3 deletions plugin/kubectl_marimo/swap.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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():
Expand Down
1 change: 0 additions & 1 deletion plugin/tests/test_delete.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Tests for delete module."""

import pytest

from kubectl_marimo.delete import delete_notebook


Expand Down
1 change: 0 additions & 1 deletion plugin/tests/test_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import socket

import pytest

from kubectl_marimo.deploy import (
check_secret_exists,
ensure_cw_credentials,
Expand Down
4 changes: 2 additions & 2 deletions plugin/tests/test_formats.py
Original file line number Diff line number Diff line change
@@ -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,
)


Expand Down
11 changes: 5 additions & 6 deletions plugin/tests/test_resources.py
Original file line number Diff line number Diff line change
@@ -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,
)


Expand Down
3 changes: 1 addition & 2 deletions plugin/tests/test_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions plugin/tests/test_swap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)


Expand Down
Loading