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.

Make formatting failure message package-manager agnostic (#5459)

Trevor Manz6a00621b5809
diff --git a/marimo/_utils/formatter.py b/marimo/_utils/formatter.py
index 7f6e0199be..37dc98ead8 100644
--- a/marimo/_utils/formatter.py
+++ b/marimo/_utils/formatter.py
@@ -25,8 +25,7 @@ def ruff(codes: CellCodes, *cmd: str) -> CellCodes:
process = subprocess.run([*ruff_cmd, "--help"], capture_output=True)
if process.returncode != 0:
raise ModuleNotFoundError(
- "To enable code formatting, install ruff (pip install ruff)",
- name="ruff",
+ "To enable code formatting, please install ruff", name="ruff"
)
formatted_codes: CellCodes = {}
@@ -77,9 +76,7 @@ class DefaultFormatter(Formatter):
return BlackFormatter(self.line_length).format(codes)
else:
raise ModuleNotFoundError(
- "To enable code formatting, install ruff (pip install ruff) "
- "or black (pip install black).",
- # This asks the frontend to install ruff
+ "To enable code formatting, please install ruff or black",
name="ruff",
)