A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.
Python artificial-intelligencedagdata-sciencedata-visualizationdataflowdeveloper-toolsmachine-learningnotebookspipelinepythonreactivesqlweb-app
improve: configure output max bytes with pyproject.toml (#3858)
Akshay Agrawal5cc4d784fdcf
diff --git a/.github/workflows/test_schemas.yaml b/.github/workflows/test_schemas.yamlindex f971d5016c..e037597230 100644--- a/.github/workflows/test_schemas.yaml+++ b/.github/workflows/test_schemas.yaml@@ -49,6 +49,7 @@ jobs:run: |BREAKING_CHANGES=$(oasdiff breaking main/${{ env.SCHEMA_PATH }} current/${{ env.SCHEMA_PATH }})if [ -n "$BREAKING_CHANGES" ]; then+ echo "breaking_changes=$BREAKING_CHANGES" >> $GITHUB_OUTPUTecho "Breaking changes detected:"echo "$BREAKING_CHANGES"exit 1@@ -63,7 +64,7 @@ jobs:script: |const output = `Breaking changes detected in the OpenAPI specification!- ${process.env.BREAKING_CHANGES}`+ ${{ steps.compare.outputs.breaking_changes }}`github.rest.issues.createComment({issue_number: context.issue.number,diff --git a/docs/guides/configuration/index.md b/docs/guides/configuration/index.mdindex 567e347926..bbf7f31704 100644--- a/docs/guides/configuration/index.md+++ b/docs/guides/configuration/index.md@@ -116,8 +116,8 @@ marimo supports the following environment variables for advanced configuration:| Environment Variable | Description | Default Value || ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | --------------- |-| `MARIMO_OUTPUT_MAX_BYTES` | Maximum size of output that marimo will display. Outputs larger than this will be truncated. | 5,000,000 (5MB) |-| `MARIMO_STD_STREAM_MAX_BYTES` | Maximum size of standard stream (stdout/stderr) output that marimo will display. Outputs larger than this will be truncated. | 1,000,000 (1MB) |+| `MARIMO_OUTPUT_MAX_BYTES` (deprecated, use `pyproject.toml`) | Maximum size of output that marimo will display. Outputs larger than this will be truncated. | 8,000,000 (8MB) |+| `MARIMO_STD_STREAM_MAX_BYTES` (deprecated, use `pyproject.toml`) | Maximum size of standard stream (stdout/stderr) output that marimo will display. Outputs larger than this will be truncated. | 1,000,000 (1MB) || `MARIMO_SKIP_UPDATE_CHECK` | If set to "1", marimo will skip checking for updates when starting. | Not set || `MARIMO_SQL_DEFAULT_LIMIT` | Default limit for SQL query results. If not set, no limit is applied. | Not set |diff --git a/marimo/_ai/llm/__init__.py b/marimo/_ai/llm/__init__.pyindex a42bdf1fe3..123b6ab311 100644--- a/marimo/_ai/llm/__init__.py+++ b/marimo/_ai/llm/__init__.py@@ -1,3 +1,4 @@+# Copyright 2025 Marimo. All rights reserved.from marimo._ai.llm._impl import anthropic, google, groq, openai__all__ = ["openai", "anthropic", "google", "groq"]diff --git a/marimo/_config/config.py b/marimo/_config/config.pyindex 9520e9e194..879f39f2fb 100644--- a/marimo/_config/config.py+++ b/marimo/_config/config.py@@ -1,6 +1,7 @@# Copyright 2024 Marimo. All rights reserved.from __future__ import annotations+import osimport sysfrom dataclasses import dataclass@@ -105,12 +106,18 @@ class RuntimeConfig(TypedDict):hidden potential state build up.- `watcher_on_save`: how to handle file changes when saving. `"lazy"` marksaffected cells as stale, `"autorun"` automatically runs affected cells.+ - `output_max_bytes`: the maximum size in bytes of cell outputs; larger+ values may affect frontend performance+ - `std_stream_max_bytes`: the maximum size in bytes of console outputs;+ larger values may affect frontend performance"""auto_instantiate: boolauto_reload: Literal["off", "lazy", "autorun"]on_cell_change: OnCellChangeTypewatcher_on_save: Literal["lazy", "autorun"]+ output_max_bytes: int+ std_stream_max_bytes: int# TODO(akshayka): remove normal, migrate to compact@@ -304,6 +311,12 @@ DEFAULT_CONFIG: MarimoConfig = {"auto_reload": "off","on_cell_change": "autorun","watcher_on_save": "lazy",+ "output_max_bytes": int(+ os.getenv("MARIMO_OUTPUT_MAX_BYTES", 8_000_000)+ ),+ "std_stream_max_bytes": int(+ os.getenv("MARIMO_STD_STREAM_MAX_BYTES", 1_000_000)+ ),},"save": {"autosave": "after_delay",diff --git a/marimo/_messaging/ops.py b/marimo/_messaging/ops.pyindex 9e7c74c69c..ae299258d3 100644--- a/marimo/_messaging/ops.py+++ b/marimo/_messaging/ops.py@@ -44,7 +44,7 @@ from marimo._messaging.errors import (is_sensitive_error,)from marimo._messaging.mimetypes import KnownMimeType-from marimo._messaging.streams import OUTPUT_MAX_BYTES+from marimo._messaging.streams import output_max_bytesfrom marimo._messaging.types import Streamfrom marimo._messaging.variables import get_variable_previewfrom marimo._output.hypertext import Html@@ -52,6 +52,7 @@ from marimo._plugins.core.json_encoder import WebComponentEncoderfrom marimo._plugins.core.web_component import JSONTypefrom marimo._plugins.ui._core.ui_element import UIElementfrom marimo._runtime.context import get_context+from marimo._runtime.context.types import ContextNotInitializedErrorfrom marimo._runtime.context.utils import get_modefrom marimo._runtime.layout.layout import LayoutConfigfrom marimo._types.ids import CellId_t, RequestId@@ -84,8 +85,6 @@ class Op:# TODO(akshayka): fix typing once mypy has stricter typing for asdictdef broadcast(self, stream: Optional[Stream] = None) -> None:- from marimo._runtime.context.types import ContextNotInitializedError-if stream is None:try:ctx = get_context()@@ -161,7 +160,7 @@ class CellOp(Op):def maybe_truncate_output(mimetype: KnownMimeType, data: str) -> tuple[KnownMimeType, str]:- if (size := sys.getsizeof(data)) > OUTPUT_MAX_BYTES:+ if (size := sys.getsizeof(data)) > output_max_bytes():from marimo._output.md import mdfrom marimo._plugins.stateless.callout import callout@@ -172,9 +171,15 @@ class CellOp(Op):of {size} bytes. Did you output this object by accident?If this limitation is a problem for you, you can configure- the max output size with the environment variable- `MARIMO_OUTPUT_MAX_BYTES`. For example, to increase- the max output to 10 MB, use:+ the max output size by adding (eg)++ ```+ [tool.marimo.runtime]+ output_max_bytes = 10_000_000+ ```++ to your pyproject.toml, or with the environment variable+ `MARIMO_OUTPUT_MAX_BYTES`:```export MARIMO_OUTPUT_MAX_BYTES=10_000_000diff --git a/marimo/_messaging/streams.py b/marimo/_messaging/streams.pyindex 201b146e7e..6d4595eff5 100644--- a/marimo/_messaging/streams.py+++ b/marimo/_messaging/streams.py@@ -35,7 +35,8 @@ if TYPE_CHECKING:LOGGER = _loggers.marimo_logger()-# Byte limits on outputs. Limits exist for two reasons:++# Byte limits on outputs exist for two reasons## 1. We use a multiprocessing.Connection object to send outputs from# the kernel to the server (the server then sends the output to@@ -53,12 +54,24 @@ LOGGER = _loggers.marimo_logger()# Usually users only output gigantic things accidentally, so refusing# to show large outputs should in most cases not bother the user too much.# In any case, it's better than breaking the frontend/kernel.-#-# Output not shown if larger than OUTPUT_MAX_BYTES=5MB-OUTPUT_MAX_BYTES = int(os.getenv("MARIMO_OUTPUT_MAX_BYTES", 5_000_000))-# Standard stream truncated if larger than STD_STREAM_MAX_BYTES=1MB-STD_STREAM_MAX_BYTES = int(os.getenv("MARIMO_STD_STREAM_MAX_BYTES", 1_000_000))++def output_max_bytes() -> int:+ from marimo._runtime.context import ContextNotInitializedError, get_context++ try:+ return get_context().marimo_config["runtime"]["output_max_bytes"]+ except ContextNotInitializedError:+ return 5_000_000+++def std_stream_max_bytes() -> int:+ from marimo._runtime.context import ContextNotInitializedError, get_context++ try:+ return get_context().marimo_config["runtime"]["std_stream_max_bytes"]+ except ContextNotInitializedError:+ return 1_000_000class PipeProtocol(Protocol):@@ -230,11 +243,12 @@ class ThreadSafeStdout(Stdout):raise TypeError("write() argument must be a str, not %s" % type(data).__name__)- if sys.getsizeof(data) > STD_STREAM_MAX_BYTES:+ max_bytes = std_stream_max_bytes()+ if sys.getsizeof(data) > max_bytes:sys.stderr.write("Warning: marimo truncated a very large console output.\n")- data = data[: int(STD_STREAM_MAX_BYTES)] + " ... "+ data = data[: int(max_bytes)] + " ... "self._stream.console_msg_queue.append(ConsoleMsg(stream=CellChannel.STDOUT,@@ -293,10 +307,11 @@ class ThreadSafeStderr(Stderr):raise TypeError("write() argument must be a str, not %s" % type(data).__name__)- if sys.getsizeof(data) > STD_STREAM_MAX_BYTES:+ max_bytes = std_stream_max_bytes()+ if sys.getsizeof(data) > max_bytes:data = ("Warning: marimo truncated a very large console output.\n"- + data[: int(STD_STREAM_MAX_BYTES)]+ + data[: int(max_bytes)]+ " ... ")@@ -344,10 +359,12 @@ class ThreadSafeStdin(Stdin):raise TypeError("prompt must be a str, not %s" % type(prompt).__name__)- if sys.getsizeof(prompt) > STD_STREAM_MAX_BYTES:++ max_bytes = std_stream_max_bytes()+ if sys.getsizeof(prompt) > max_bytes:prompt = ("Warning: marimo truncated a very large console output.\n"- + prompt[: int(STD_STREAM_MAX_BYTES)]+ + prompt[: int(max_bytes)]+ " ... ")diff --git a/marimo/_output/formatters/iframe.py b/marimo/_output/formatters/iframe.pyindex 9cbb2aa138..7145cac65a 100644--- a/marimo/_output/formatters/iframe.py+++ b/marimo/_output/formatters/iframe.py@@ -1,3 +1,4 @@+# Copyright 2025 Marimo. All rights reserved.from __future__ import annotationsfrom html.parser import HTMLParserdiff --git a/marimo/_plugins/ui/_impl/tables/selection.py b/marimo/_plugins/ui/_impl/tables/selection.pyindex 720a583b24..74b2209fe3 100644--- a/marimo/_plugins/ui/_impl/tables/selection.py+++ b/marimo/_plugins/ui/_impl/tables/selection.py@@ -1,3 +1,4 @@+# Copyright 2025 Marimo. All rights reserved.from __future__ import annotationsfrom typing import TypeVar, castdiff --git a/marimo/_pyodide/streams.py b/marimo/_pyodide/streams.pyindex e0b2085318..ea44df803a 100644--- a/marimo/_pyodide/streams.py+++ b/marimo/_pyodide/streams.py@@ -9,7 +9,7 @@ from marimo import _loggersfrom marimo._messaging.cell_output import CellChannel, CellOutputfrom marimo._messaging.mimetypes import KnownMimeTypefrom marimo._messaging.ops import CellOp-from marimo._messaging.streams import STD_STREAM_MAX_BYTES+from marimo._messaging.streams import std_stream_max_bytesfrom marimo._messaging.types import (KernelMessage,Stderr,@@ -62,11 +62,12 @@ class PyodideStdout(Stdout):raise TypeError("write() argument must be a str, not %s" % type(data).__name__)- if sys.getsizeof(data) > STD_STREAM_MAX_BYTES:+ max_bytes = std_stream_max_bytes()+ if sys.getsizeof(data) > max_bytes:sys.stderr.write("Warning: marimo truncated a very large console output.\n")- data = data[: int(STD_STREAM_MAX_BYTES)] + " ... "+ data = data[: int(max_bytes)] + " ... "CellOp(cell_id=self.stream.cell_id,console=CellOutput(@@ -106,10 +107,11 @@ class PyodideStderr(Stderr):raise TypeError("write() argument must be a str, not %s" % type(data).__name__)- if sys.getsizeof(data) > STD_STREAM_MAX_BYTES:+ max_bytes = std_stream_max_bytes()+ if sys.getsizeof(data) > max_bytes:data = ("Warning: marimo truncated a very large console output.\n"- + data[: int(STD_STREAM_MAX_BYTES)]+ + data[: int(max_bytes)]+ " ... ")@@ -148,10 +150,11 @@ class PyodideStdin(Stdin):raise TypeError("prompt must be a str, not %s" % type(prompt).__name__)- if sys.getsizeof(prompt) > STD_STREAM_MAX_BYTES:+ max_bytes = std_stream_max_bytes()+ if sys.getsizeof(prompt) > max_bytes:prompt = ("Warning: marimo truncated a very large console output.\n"- + prompt[: int(STD_STREAM_MAX_BYTES)]+ + prompt[: int(max_bytes)]+ " ... ")diff --git a/marimo/_schemas/session.py b/marimo/_schemas/session.pyindex 2dd0b470be..9713599152 100644--- a/marimo/_schemas/session.py+++ b/marimo/_schemas/session.py@@ -1,3 +1,4 @@+# Copyright 2025 Marimo. All rights reserved.from __future__ import annotationsfrom typing import Any, Dict, List, Literal, Optional, TypedDict, Uniondiff --git a/marimo/_server/export/__init__.py b/marimo/_server/export/__init__.pyindex b9ab538245..39e95baa3d 100644--- a/marimo/_server/export/__init__.py+++ b/marimo/_server/export/__init__.py@@ -2,11 +2,13 @@from __future__ import annotationsimport asyncio+import osimport sysfrom dataclasses import dataclassfrom typing import Any, Callable, Literal, Optional, Union, castfrom marimo._cli.print import echo+from marimo._config.config import RuntimeConfigfrom marimo._config.manager import (get_default_config_manager,)@@ -183,8 +185,6 @@ async def run_app_then_export_as_reactive_html(path: MarimoPath,include_code: bool,) -> ExportResult:- import os-from marimo._islands._island_generator import MarimoIslandGeneratorgenerator = MarimoIslandGenerator.from_file(@@ -259,12 +259,17 @@ async def run_app_until_completion(current_path=file_manager.path).with_overrides({- "runtime": {- "on_cell_change": "autorun",- "auto_instantiate": True,- "auto_reload": "off",- "watcher_on_save": "lazy",- }+ "runtime": cast(+ RuntimeConfig,+ {+ "on_cell_change": "autorun",+ "auto_instantiate": True,+ "auto_reload": "off",+ "watcher_on_save": "lazy",+ # We cast because we don't want to override the other+ # config values+ },+ ),})diff --git a/marimo/_server/session/serialize.py b/marimo/_server/session/serialize.pyindex 9d97461aad..74416525b4 100644--- a/marimo/_server/session/serialize.py+++ b/marimo/_server/session/serialize.py@@ -1,3 +1,4 @@+# Copyright 2025 Marimo. All rights reserved.from __future__ import annotationsimport asynciodiff --git a/marimo/_snippets/data/env-0.py b/marimo/_snippets/data/env-0.pyindex c0e2178f0b..40faf0454d 100644--- a/marimo/_snippets/data/env-0.py+++ b/marimo/_snippets/data/env-0.py@@ -1,3 +1,4 @@+# Copyright 2025 Marimo. All rights reserved.import marimo__generated_with = "0.11.0"diff --git a/marimo/_snippets/data/huggingface-0.py b/marimo/_snippets/data/huggingface-0.pyindex e58f8b3261..ada7ddd436 100644--- a/marimo/_snippets/data/huggingface-0.py+++ b/marimo/_snippets/data/huggingface-0.py@@ -1,3 +1,4 @@+# Copyright 2025 Marimo. All rights reserved.import marimo__generated_with = "0.11.0"diff --git a/marimo/_snippets/data/huggingface-1.py b/marimo/_snippets/data/huggingface-1.pyindex 186e4845c3..422e3fa1e8 100644--- a/marimo/_snippets/data/huggingface-1.py+++ b/marimo/_snippets/data/huggingface-1.py@@ -1,3 +1,4 @@+# Copyright 2025 Marimo. All rights reserved.import marimo__generated_with = "0.11.0"diff --git a/marimo/_snippets/data/openai-0.py b/marimo/_snippets/data/openai-0.pyindex cf6cfc2657..e69fc90c83 100644--- a/marimo/_snippets/data/openai-0.py+++ b/marimo/_snippets/data/openai-0.py@@ -1,3 +1,4 @@+# Copyright 2025 Marimo. All rights reserved.import marimo__generated_with = "0.11.0"diff --git a/marimo/_snippets/data/openai-1.py b/marimo/_snippets/data/openai-1.pyindex d502226a62..848521a2c2 100644--- a/marimo/_snippets/data/openai-1.py+++ b/marimo/_snippets/data/openai-1.py@@ -1,3 +1,4 @@+# Copyright 2025 Marimo. All rights reserved.import marimo__generated_with = "0.11.0"diff --git a/marimo/_types/ids.py b/marimo/_types/ids.pyindex 38e20d3b73..01227b3beb 100644--- a/marimo/_types/ids.py+++ b/marimo/_types/ids.py@@ -1,3 +1,4 @@+# Copyright 2025 Marimo. All rights reserved.from __future__ import annotationsfrom typing import NewTypediff --git a/marimo/_utils/background_task.py b/marimo/_utils/background_task.pyindex 403cbf8277..3403bfaaad 100644--- a/marimo/_utils/background_task.py+++ b/marimo/_utils/background_task.py@@ -1,3 +1,4 @@+# Copyright 2025 Marimo. All rights reserved.from __future__ import annotationsimport asynciodiff --git a/marimo/_utils/scripts.py b/marimo/_utils/scripts.pyindex 1ab400b0cd..0b2a4e5745 100644--- a/marimo/_utils/scripts.py+++ b/marimo/_utils/scripts.py@@ -1,3 +1,4 @@+# Copyright 2025 Marimo. All rights reserved.from __future__ import annotationsimport rediff --git a/openapi/api.yaml b/openapi/api.yamlindex f0fa5ca4c1..73c03d63bc 100644--- a/openapi/api.yaml+++ b/openapi/api.yaml@@ -1297,6 +1297,10 @@ components:- lazy- autoruntype: string+ output_max_bytes:+ type: integer+ std_stream_max_bytes:+ type: integerwatcher_on_save:enum:- lazy@@ -1307,6 +1311,8 @@ components:- auto_reload- on_cell_change- watcher_on_save+ - output_max_bytes+ - std_stream_max_bytestype: objectsave:properties:@@ -2146,7 +2152,7 @@ components:type: objectinfo:title: marimo API- version: 0.11.2+ version: 0.11.7openapi: 3.1.0paths:/@file/{filename_and_length}:diff --git a/openapi/src/api.ts b/openapi/src/api.tsindex ab718b0246..45de65aa96 100644--- a/openapi/src/api.ts+++ b/openapi/src/api.ts@@ -2512,6 +2512,7 @@ export interface components {| null;KernelReady: {app_config: {+ _toplevel_fn: boolean;app_title?: string | null;auto_download: ("html" | "markdown")[];css_file?: string | null;@@ -2633,6 +2634,8 @@ export interface components {auto_reload: "off" | "lazy" | "autorun";/** @enum {string} */on_cell_change: "lazy" | "autorun";+ output_max_bytes: number;+ std_stream_max_bytes: number;/** @enum {string} */watcher_on_save: "lazy" | "autorun";};diff --git a/pyproject.toml b/pyproject.tomlindex 883ead4627..874fbe7861 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -499,3 +499,5 @@ dataframes = "rich"[tool.marimo.runtime]watcher_on_save = "autorun"+output_max_bytes = 10_000_000+std_stream_max_bytes = 2_000_000diff --git a/tests/_server/templates/snapshots/export1.txt b/tests/_server/templates/snapshots/export1.txtindex bfd581f623..a285c4e80d 100644--- a/tests/_server/templates/snapshots/export1.txt+++ b/tests/_server/templates/snapshots/export1.txt@@ -55,7 +55,7 @@<marimo-filename hidden>notebook.py</marimo-filename><marimo-mode data-mode='read' hidden></marimo-mode><marimo-version data-version='0.0.0' hidden></marimo-version>- <marimo-user-config data-config='{"completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_width": "medium", "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "package_management": {"manager": "uv"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "on_cell_change": "autorun", "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}}' data-overrides='{"formatting": {"line_length": 100}}' hidden></marimo-user-config>+ <marimo-user-config data-config='{"completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_width": "medium", "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "package_management": {"manager": "uv"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "on_cell_change": "autorun", "output_max_bytes": 8000000, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}}' data-overrides='{"formatting": {"line_length": 100}}' hidden></marimo-user-config><marimo-app-config data-config='{"width": "compact"}' hidden></marimo-app-config><marimo-server-token data-token='token' hidden></marimo-server-token><title>notebook</title>diff --git a/tests/_server/templates/snapshots/export2.txt b/tests/_server/templates/snapshots/export2.txtindex 725ae2d2ec..2226a479d1 100644--- a/tests/_server/templates/snapshots/export2.txt+++ b/tests/_server/templates/snapshots/export2.txt@@ -55,7 +55,7 @@<marimo-filename hidden></marimo-filename><marimo-mode data-mode='read' hidden></marimo-mode><marimo-version data-version='0.0.0' hidden></marimo-version>- <marimo-user-config data-config='{"completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_width": "medium", "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "package_management": {"manager": "uv"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "on_cell_change": "autorun", "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}}' data-overrides='{"formatting": {"line_length": 100}}' hidden></marimo-user-config>+ <marimo-user-config data-config='{"completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_width": "medium", "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "package_management": {"manager": "uv"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "on_cell_change": "autorun", "output_max_bytes": 8000000, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}}' data-overrides='{"formatting": {"line_length": 100}}' hidden></marimo-user-config><marimo-app-config data-config='{"width": "compact"}' hidden></marimo-app-config><marimo-server-token data-token='token' hidden></marimo-server-token><title>marimo</title>diff --git a/tests/_server/templates/snapshots/export3.txt b/tests/_server/templates/snapshots/export3.txtindex 6b025fc1bc..952f7b8fc5 100644--- a/tests/_server/templates/snapshots/export3.txt+++ b/tests/_server/templates/snapshots/export3.txt@@ -55,7 +55,7 @@<marimo-filename hidden>notebook.py</marimo-filename><marimo-mode data-mode='read' hidden></marimo-mode><marimo-version data-version='0.0.0' hidden></marimo-version>- <marimo-user-config data-config='{"completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_width": "medium", "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "package_management": {"manager": "uv"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "on_cell_change": "autorun", "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}}' data-overrides='{"formatting": {"line_length": 100}}' hidden></marimo-user-config>+ <marimo-user-config data-config='{"completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_width": "medium", "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "package_management": {"manager": "uv"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "on_cell_change": "autorun", "output_max_bytes": 8000000, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}}' data-overrides='{"formatting": {"line_length": 100}}' hidden></marimo-user-config><marimo-app-config data-config='{"width": "compact"}' hidden></marimo-app-config><marimo-server-token data-token='token' hidden></marimo-server-token><title>notebook</title>diff --git a/tests/_server/templates/snapshots/export4.txt b/tests/_server/templates/snapshots/export4.txtindex 06e5f92f0f..37e1bf8996 100644--- a/tests/_server/templates/snapshots/export4.txt+++ b/tests/_server/templates/snapshots/export4.txt@@ -55,7 +55,7 @@<marimo-filename hidden>notebook.py</marimo-filename><marimo-mode data-mode='read' hidden></marimo-mode><marimo-version data-version='0.0.0' hidden></marimo-version>- <marimo-user-config data-config='{"completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_width": "medium", "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "package_management": {"manager": "uv"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "on_cell_change": "autorun", "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}}' data-overrides='{"formatting": {"line_length": 100}}' hidden></marimo-user-config>+ <marimo-user-config data-config='{"completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_width": "medium", "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "package_management": {"manager": "uv"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "on_cell_change": "autorun", "output_max_bytes": 8000000, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}}' data-overrides='{"formatting": {"line_length": 100}}' hidden></marimo-user-config><marimo-app-config data-config='{"css_file": "custom.css", "width": "compact"}' hidden></marimo-app-config><marimo-server-token data-token='token' hidden></marimo-server-token><title>notebook</title>diff --git a/tests/_server/templates/snapshots/export5.txt b/tests/_server/templates/snapshots/export5.txtindex 9be387349b..5e837ae9d2 100644--- a/tests/_server/templates/snapshots/export5.txt+++ b/tests/_server/templates/snapshots/export5.txt@@ -55,7 +55,7 @@<marimo-filename hidden>notebook.py</marimo-filename><marimo-mode data-mode='read' hidden></marimo-mode><marimo-version data-version='0.0.0' hidden></marimo-version>- <marimo-user-config data-config='{"completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_width": "medium", "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "package_management": {"manager": "uv"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "on_cell_change": "autorun", "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}}' data-overrides='{"formatting": {"line_length": 100}}' hidden></marimo-user-config>+ <marimo-user-config data-config='{"completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_width": "medium", "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "package_management": {"manager": "uv"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "on_cell_change": "autorun", "output_max_bytes": 8000000, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}}' data-overrides='{"formatting": {"line_length": 100}}' hidden></marimo-user-config><marimo-app-config data-config='{"app_title": "My App", "html_head_file": "head.html", "width": "compact"}' hidden></marimo-app-config><marimo-server-token data-token='token' hidden></marimo-server-token><title>My App</title>diff --git a/tests/_utils/test_scripts.py b/tests/_utils/test_scripts.pyindex fc222c15c7..5a7fa03060 100644--- a/tests/_utils/test_scripts.py+++ b/tests/_utils/test_scripts.py@@ -65,6 +65,8 @@ def test_read_marimo_config_from_script():# [tool.marimo.runtime]# watcher_on_save = "autorun"# auto_instantiate = true+ # output_max_bytes = 20+ # std_stream_max_bytes = 10# [tool.marimo.display]# cell_output = "above"# ///@@ -74,4 +76,6 @@ def test_read_marimo_config_from_script():assert config is not Noneassert config["tool"]["marimo"]["runtime"]["auto_instantiate"] is Trueassert config["tool"]["marimo"]["runtime"]["watcher_on_save"] == "autorun"+ assert config["tool"]["marimo"]["runtime"]["output_max_bytes"] == 20+ assert config["tool"]["marimo"]["runtime"]["std_stream_max_bytes"] == 10assert config["tool"]["marimo"]["display"]["cell_output"] == "above"