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.

fix: gracefully handle timeouts/input from uv when adding script metadata (#8111)

Myles Scolnicka11e98995f37
diff --git a/marimo/_cli/sandbox.py b/marimo/_cli/sandbox.py
index 6e1363927f..9f47fc73d9 100644
--- a/marimo/_cli/sandbox.py
+++ b/marimo/_cli/sandbox.py
@@ -391,10 +391,16 @@ def _ensure_marimo_in_script_metadata(name: str | None) -> None:
check=True,
capture_output=True,
text=True,
+ # stdin=DEVNULL prevents hanging on Windows when uv might
+ # wait for input
+ stdin=subprocess.DEVNULL,
+ timeout=30,
)
LOGGER.info(f"Added marimo to script metadata: {result.stdout}")
except subprocess.CalledProcessError as e:
LOGGER.warning(f"Failed to add marimo to script metadata: {e.stderr}")
+ except subprocess.TimeoutExpired:
+ LOGGER.warning("Timed out adding marimo to script metadata")
except Exception as e:
LOGGER.warning(f"Failed to add marimo to script metadata: {e}")