Skip to content

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.

docs: standardize inline code backticks & fix node v26 build (#11167)

Rajveer Singh17065535a82e
diff --git a/marimo/_ast/codegen.py b/marimo/_ast/codegen.py
index e70cc8355a..68e58a4305 100644
--- a/marimo/_ast/codegen.py
+++ b/marimo/_ast/codegen.py
@@ -572,9 +572,9 @@ def generate_filecontents(
) -> str:
"""Translates a sequences of codes (cells) to a Python file"""
- # Normalize internal cell names. Empty names would emit ``def ():``
+ # Normalize internal cell names. Empty names would emit `def ():`
# (invalid Python) and fall back to the unparsable-cell path;
- # ``"__"`` is a legacy internal marker.
+ # `"__"` is a legacy internal marker.
for idx, name in enumerate(names):
if name == "__" or not name:
names[idx] = DEFAULT_CELL_NAME
diff --git a/marimo/_code_mode/_context.py b/marimo/_code_mode/_context.py
index 84f133851e..ab19fb77e9 100644
--- a/marimo/_code_mode/_context.py
+++ b/marimo/_code_mode/_context.py
@@ -734,8 +734,8 @@ class AsyncCodeModeContext:
self._kernel = kernel
self._document = document
# Output snapshot is optional — callers that don't pass one
- # (e.g. the MCP code server) get ``cell.output is None`` and
- # ``cell.console_outputs == []`` for every cell, same as cells
+ # (e.g. the MCP code server) get `cell.output is None` and
+ # `cell.console_outputs == []` for every cell, same as cells
# that genuinely produced no output.
self._outputs: CellOutputs | None = get_current_outputs()
self._cell_manager = cell_manager
@@ -1558,8 +1558,8 @@ class AsyncCodeModeContext:
return self.cells[-1].id
if isinstance(target, bool):
- # Guard before the ``int`` branch — ``bool`` subclasses
- # ``int`` in Python, and ``ctx.screenshot(True)`` almost
+ # Guard before the `int` branch — `bool` subclasses
+ # `int` in Python, and `ctx.screenshot(True)` almost
# certainly reflects a caller mistake.
raise TypeError(
"screenshot target cannot be a bool; pass a cell ID, "
diff --git a/marimo/_islands/_island_generator.py b/marimo/_islands/_island_generator.py
index f557f00a30..0614c60a4e 100644
--- a/marimo/_islands/_island_generator.py
+++ b/marimo/_islands/_island_generator.py
@@ -318,8 +318,8 @@ class MarimoIslandGenerator:
self._stubs: list[MarimoIslandStub] = []
self._config = _AppConfig()
self._dependencies: list[str] = []
- # When constructed via ``from_file``, this records the notebook
- # source path so cells see ``__file__`` / ``mo.notebook_dir()``
+ # When constructed via `from_file`, this records the notebook
+ # source path so cells see `__file__` / `mo.notebook_dir()`
# resolve to the notebook rather than to the host process.
self._source_filename: str | None = None
@@ -345,9 +345,9 @@ class MarimoIslandGenerator:
file_manager = load_notebook(filename)
generator = MarimoIslandGenerator()
- # Resolve at capture time so a chdir between ``from_file`` and
- # ``build`` doesn't change which absolute path cells see for
- # ``__file__`` / ``mo.notebook_dir()``.
+ # Resolve at capture time so a chdir between `from_file` and
+ # `build` doesn't change which absolute path cells see for
+ # `__file__` / `mo.notebook_dir()`.
generator._source_filename = os.path.abspath(filename)
stubs = []
for cell_data in file_manager.app.cell_manager.cell_data():
diff --git a/marimo/_messaging/notebook/document.py b/marimo/_messaging/notebook/document.py
index 05bfd6c40e..26bfde0cfd 100644
--- a/marimo/_messaging/notebook/document.py
+++ b/marimo/_messaging/notebook/document.py
@@ -313,7 +313,7 @@ class NotebookDocument:
# ------------------------------------------------------------------
#: Document snapshot for the current scratchpad execution. Set by the
-#: kernel before running code_mode so ``AsyncCodeModeContext`` can read
+#: kernel before running code_mode so `AsyncCodeModeContext` can read
#: cell ordering, code, names, and configs without the kernel carrying
#: mutable document state.
_current_document: ContextVar[NotebookDocument | None] = ContextVar(
diff --git a/marimo/_runtime/complete.py b/marimo/_runtime/complete.py
index 9e0450503c..da2826f88a 100644
--- a/marimo/_runtime/complete.py
+++ b/marimo/_runtime/complete.py
@@ -191,7 +191,7 @@ def _convert_docstring_to_markdown(
)
# Prefer markdown rendering when math syntax is present.
- # This ensures ``.. math::`` and markdown delimiters are interpreted by
+ # This ensures `.. math::` and markdown delimiters are interpreted by
# the same TeX pipeline used elsewhere in marimo output.
if _contains_math_syntax(raw_docstring):
return as_md_html(raw_docstring)
diff --git a/marimo/_runtime/reload/module_watcher.py b/marimo/_runtime/reload/module_watcher.py
index 90ad4cc061..b164d2907d 100644
--- a/marimo/_runtime/reload/module_watcher.py
+++ b/marimo/_runtime/reload/module_watcher.py
@@ -113,7 +113,7 @@ def _get_excluded_modules(modules: dict[str, types.ModuleType]) -> set[str]:
and _is_third_party_module(m)
)
}
- # Always exclude the root package name even when absent from ``modules``.
+ # Always exclude the root package name even when absent from `modules`.
result.add("marimo")
_excluded_modules_cache = (cache_key, result)
return result
diff --git a/marimo/_runtime/runtime.py b/marimo/_runtime/runtime.py
index 93287989f8..0195f3900d 100644
--- a/marimo/_runtime/runtime.py
+++ b/marimo/_runtime/runtime.py
@@ -1856,9 +1856,9 @@ class Kernel:
if error:
# Surface the diagnostic on stderr so SSE clients (e.g. the
# /api/kernel/execute CLI path) see it — compile errors
- # never hit ``write_traceback``, so without this the error
- # only reaches the ``CellNotification`` side channel and
- # the SSE ``done`` event drops it.
+ # never hit `write_traceback`, so without this the error
+ # only reaches the `CellNotification` side channel and
+ # the SSE `done` event drops it.
CellNotificationUtils.broadcast_console_output(
channel=CellChannel.STDERR,
mimetype="text/plain",
diff --git a/marimo/_server/api/endpoints/execution.py b/marimo/_server/api/endpoints/execution.py
index bb622bf50e..2df355d498 100644
--- a/marimo/_server/api/endpoints/execution.py
+++ b/marimo/_server/api/endpoints/execution.py
@@ -368,8 +368,8 @@ async def execute_code(
disconnect_task = asyncio.create_task(watch_disconnect())
# Correlation ID: tags both the scratchpad command and the
# listener so we wait for *our* completion and ignore
- # ``CompletedRun`` events from other commands on this session
- # (e.g. the ``session.instantiate`` call above, or concurrent
+ # `CompletedRun` events from other commands on this session
+ # (e.g. the `session.instantiate` call above, or concurrent
# browser activity).
run_id = str(uuid4())
try:
diff --git a/marimo/_server/scratchpad.py b/marimo/_server/scratchpad.py
index 7b312f91b3..a933f843f4 100644
--- a/marimo/_server/scratchpad.py
+++ b/marimo/_server/scratchpad.py
@@ -115,10 +115,10 @@ class ScratchCellListener(EventAwareExtension):
del session
msg = deserialize_kernel_message(notification)
- # Completion sentinel: the ``CompletedRunNotification`` tagged
+ # Completion sentinel: the `CompletedRunNotification` tagged
# with OUR run_id means the scratchpad's full cascade (including
- # any ``state_updates`` flushed after the scratch cell goes
- # idle) has settled. ``CompletedRun``s with other ids belong to
+ # any `state_updates` flushed after the scratch cell goes
+ # idle) has settled. `CompletedRun`s with other ids belong to
# unrelated commands — skip them.
if isinstance(msg, CompletedRunNotification):
if msg.run_id == self._run_id:
diff --git a/marimo/_session/extensions/extensions.py b/marimo/_session/extensions/extensions.py
index ec4bf33842..ba76686e7c 100644
--- a/marimo/_session/extensions/extensions.py
+++ b/marimo/_session/extensions/extensions.py
@@ -103,9 +103,9 @@ class HeartbeatExtension(SessionExtension):
)
# Notify the frontend before closing the WS so the user sees
# a persistent banner with the real cause instead of just a
- # "disconnected" UI. ``notify`` only queues the frame on each
+ # "disconnected" UI. `notify` only queues the frame on each
# consumer's send queue; yield to the event loop afterwards
- # so the WS writer task drains it before ``session.close``
+ # so the WS writer task drains it before `session.close`
# detaches the consumers. Inner guard isolates a broadcast
# failure from cleanup -- we still want to close the session
# and log even if the banner can't be delivered.
@@ -350,8 +350,8 @@ class NotificationListenerExtension(SessionExtension):
self._unnamed_autosave_logged = True
return
- # Deep-copy on the caller thread. ``NotebookCell`` and
- # ``CellConfig`` are mutable and owned by the document, so a
+ # Deep-copy on the caller thread. `NotebookCell` and
+ # `CellConfig` are mutable and owned by the document, so a
# shallow copy would let the event-loop thread mutate fields
# under the worker thread's feet (torn snapshot).
cells_snapshot: list[NotebookCell] = copy.deepcopy(
diff --git a/marimo/_session/file_change_handler.py b/marimo/_session/file_change_handler.py
index 280507f400..12ce42f5d2 100644
--- a/marimo/_session/file_change_handler.py
+++ b/marimo/_session/file_change_handler.py
@@ -243,8 +243,8 @@ class FileChangeCoordinator:
)
return FileChangeResult(handled=False)
- # Reload the file manager to get the latest code. ``reload``
- # mutates the existing document in place via ``apply()`` and
+ # Reload the file manager to get the latest code. `reload`
+ # mutates the existing document in place via `apply()` and
# returns the stamped transaction, so we just relay it.
try:
transaction, changed_cell_ids = (
diff --git a/marimo/_session/kernel_exit.py b/marimo/_session/kernel_exit.py
index 8b3575b36f..6530d2887a 100644
--- a/marimo/_session/kernel_exit.py
+++ b/marimo/_session/kernel_exit.py
@@ -16,10 +16,10 @@ import sys
from marimo._session.types import KernelExitInfo
# POSIX signal numbers used for kernel-exit classification. We pull them from
-# the ``signal`` module so the branches read naturally, with numeric fallbacks
+# the `signal` module so the branches read naturally, with numeric fallbacks
# for Windows (which doesn't define SIGKILL). The surrounding code is gated to
# Linux at runtime, so the fallbacks only matter for tests that monkeypatch
-# ``sys.platform``.
+# `sys.platform`.
_SIGKILL = getattr(signal, "SIGKILL", 9)
_SIGSEGV = getattr(signal, "SIGSEGV", 11)
@@ -68,7 +68,7 @@ def classify_kernel_exit(exitcode: int | None) -> KernelExitInfo:
),
)
- # ``exitcode < 0`` only occurs on POSIX (Windows never returns negative
+ # `exitcode < 0` only occurs on POSIX (Windows never returns negative
# exitcodes). The signal-name and cgroup OOM logic below assumes Linux
# conventions (POSIX signal numbers per multiprocessing.Process.exitcode,
# see https://docs.python.org/3/library/multiprocessing.html#multiprocessing.Process.exitcode,
@@ -76,7 +76,7 @@ def classify_kernel_exit(exitcode: int | None) -> KernelExitInfo:
# platforms (including darwin) we have no way to confirm OOM, so we
# surface a generic failure rather than guessing -- claiming OOM for
# every SIGKILL would mislead users when the real cause is a crash,
- # ``kill -9``, or something else.
+ # `kill -9`, or something else.
if sys.platform != "linux":
return KernelExitInfo(
exitcode=exitcode,
@@ -108,7 +108,7 @@ def classify_kernel_exit(exitcode: int | None) -> KernelExitInfo:
),
)
# SIGKILL without cgroup-confirmed OOM: the cause is genuinely
- # unknown (could be ``kill -9``, an external OOM-killer outside our
+ # unknown (could be `kill -9`, an external OOM-killer outside our
# cgroup, a crash, etc.). Be honest rather than guessing OOM.
return KernelExitInfo(
exitcode=exitcode,
diff --git a/marimo/_session/notebook/file_manager.py b/marimo/_session/notebook/file_manager.py
index 44a56e0847..633d33a5db 100644
--- a/marimo/_session/notebook/file_manager.py
+++ b/marimo/_session/notebook/file_manager.py
@@ -88,7 +88,7 @@ class AppFileManager:
# Serializes concurrent writers. Reentrant so public entry points
# can wrap the full "mutate app + _save_file" sequence while
- # ``_save_file`` re-acquires for any direct caller.
+ # `_save_file` re-acquires for any direct caller.
self._save_lock = threading.RLock()
# Foreground writes supersede queued autosaves.
self._autosave_generation = 0
@@ -122,7 +122,7 @@ class AppFileManager:
"""
manager = AppFileManager(None)
# Snapshot to an absolute path at assignment time so a later
- # ``chdir`` cannot change which file ``self.path`` resolves to.
+ # `chdir` cannot change which file `self.path` resolves to.
manager.filename = (
os.path.abspath(str(filename)) if filename is not None else None
)
diff --git a/marimo/_session/session.py b/marimo/_session/session.py
index 2b415c6d35..913c1a75d3 100644
--- a/marimo/_session/session.py
+++ b/marimo/_session/session.py
@@ -385,7 +385,7 @@ class SessionImpl(Session):
task = self._kernel_manager.kernel_task
if task is None or task.is_alive():
return None
- # ``exitcode`` is provided by multiprocessing.Process; threads don't
+ # `exitcode` is provided by multiprocessing.Process; threads don't
# have one, so we treat absence as "unknown".
exitcode = getattr(task, "exitcode", None)
return classify_kernel_exit(exitcode)
diff --git a/marimo/_smoke_tests/altair_examples/map_selection.py b/marimo/_smoke_tests/altair_examples/map_selection.py
index d3720f1361..4ec1b3ef06 100644
--- a/marimo/_smoke_tests/altair_examples/map_selection.py
+++ b/marimo/_smoke_tests/altair_examples/map_selection.py
@@ -79,7 +79,7 @@ def _(alt, us_population, us_states):
.project(type="albersUsa")
)
- # create a bar chart with the same conditional ``opacity`` encoding.
+ # create a bar chart with the same conditional `opacity` encoding.
bars = (
alt.Chart(
us_population.nlargest(15, "population"),
diff --git a/marimo/_snippets/data/altair-8.py b/marimo/_snippets/data/altair-8.py
index e92aa08c18..31d1f65067 100644
--- a/marimo/_snippets/data/altair-8.py
+++ b/marimo/_snippets/data/altair-8.py
@@ -11,7 +11,7 @@ def __(mo):
r"""
# Visualization: Time Series Line Plot in Altair
- Altair handles temporal types natively by using the ``:T`` type marker. An example is in this plot of stock prices over time
+ Altair handles temporal types natively by using the `:T` type marker. An example is in this plot of stock prices over time
"""
)
return
diff --git a/marimo/_utils/background_task.py b/marimo/_utils/background_task.py
index a29883ca15..97dff8dd4c 100644
--- a/marimo/_utils/background_task.py
+++ b/marimo/_utils/background_task.py
@@ -103,7 +103,7 @@ class AsyncBackgroundTask(ABC):
self.running = False
return
- # Reuse the task's loop — a fresh loop via ``asyncio.run`` would
+ # Reuse the task's loop — a fresh loop via `asyncio.run` would
# error with "future attached to a different event loop".
task_loop = self.task.get_loop()
diff --git a/marimo/_utils/file_watcher.py b/marimo/_utils/file_watcher.py
index 003e6e59ab..33a64c7df1 100644
--- a/marimo/_utils/file_watcher.py
+++ b/marimo/_utils/file_watcher.py
@@ -21,7 +21,7 @@ class FileWatcher(ABC):
@staticmethod
def create(path: Path, callback: Callback) -> FileWatcher:
# Capture the running loop now so background callbacks scheduled
- # via ``run_coroutine_threadsafe`` target the right loop.
+ # via `run_coroutine_threadsafe` target the right loop.
loop = asyncio.get_running_loop()
if DependencyManager.watchdog.has():
LOGGER.debug("Using watchdog file watcher")
diff --git a/packages/llm-info/package.json b/packages/llm-info/package.json
index 5686189db9..34fce35e1f 100644
--- a/packages/llm-info/package.json
+++ b/packages/llm-info/package.json
@@ -14,8 +14,8 @@
"./providers.json": "./data/generated/providers.json"
},
"scripts": {
- "codegen": "node --experimental-transform-types src/generate.ts",
- "sync-models": "node --experimental-transform-types src/sync-models.ts",
+ "codegen": "node --experimental-strip-types src/generate.ts",
+ "sync-models": "node --experimental-strip-types src/sync-models.ts",
"test": "vitest",
"build": "echo 'No build step'"
},