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
fix(cli): restore typechecking with Click 8.4 (#10738)
Shahmir Varqha535c156400a6
diff --git a/marimo/_cli/errors.py b/marimo/_cli/errors.pyindex e8f7e35927..391ad5ae1d 100644--- a/marimo/_cli/errors.py+++ b/marimo/_cli/errors.py@@ -1,7 +1,7 @@# Copyright 2026 Marimo. All rights reserved.from __future__ import annotations-from typing import Any+from typing import IO, Anyimport click@@ -12,15 +12,13 @@ from marimo._cli.print import bold, green, muted, redclass MarimoCLIError(click.ClickException):"""Base class for marimo CLI errors."""- def show(self, file: Any = None) -> None:- if file is None:- file = click.get_text_stream("stderr")-+ def show(self, file: IO[Any] | None = None) -> None:ctx = getattr(self, "ctx", None)color = ctx.color if ctx is not None else Noneclick.echo(f"{red('Error', bold=True)}: {self.format_message()}",file=file,+ err=file is None,color=color,)diff --git a/marimo/_cli/parser_ux.py b/marimo/_cli/parser_ux.pyindex cdc63343e7..69ff289ca0 100644--- a/marimo/_cli/parser_ux.py+++ b/marimo/_cli/parser_ux.py@@ -1,7 +1,7 @@# Copyright 2026 Marimo. All rights reserved.from __future__ import annotations-from typing import Any+from typing import IO, Anyimport click@@ -79,23 +79,25 @@ def _format_usage_error(error: click.UsageError) -> list[str]:def show_compact_usage_error(- error: click.UsageError, file: Any = None+ error: click.UsageError, file: IO[Any] | None = None) -> None:"""Print compact parser errors without the full command help block."""- if file is None:- file = click.get_text_stream("stderr")+ use_stderr = file is Nonecolor = error.ctx.color if error.ctx is not None else Nonefor line in _format_usage_error(error):- click.echo(line, file=file, color=color)+ click.echo(line, file=file, err=use_stderr, color=color)if error.ctx is not None:- click.echo(file=file, color=color)- click.echo(error.ctx.get_usage(), file=file, color=color)- click.echo(file=file, color=color)+ click.echo(file=file, err=use_stderr, color=color)+ click.echo(+ error.ctx.get_usage(), file=file, err=use_stderr, color=color+ )+ click.echo(file=file, err=use_stderr, color=color)click.echo("For more information, try '--help'.",file=file,+ err=use_stderr,color=color,)