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.

improvement: click package icon to change the package manager (#3691)

Myles Scolnicke40879e6a014
diff --git a/frontend/src/components/app-config/app-config-button.tsx b/frontend/src/components/app-config/app-config-button.tsx
index 662aeeffdc..a2b4ea37e5 100644
--- a/frontend/src/components/app-config/app-config-button.tsx
+++ b/frontend/src/components/app-config/app-config-button.tsx
@@ -10,15 +10,14 @@ import { UserConfigForm } from "./user-config-form";
import { Tooltip } from "../ui/tooltip";
import { Dialog, DialogTrigger, DialogContent } from "../ui/dialog";
import { AppConfigForm } from "@/components/app-config/app-config-form";
-import { atom, useAtom } from "jotai";
+import { useAtom } from "jotai";
import { Button } from "../ui/button";
+import { settingDialogAtom } from "./state";
interface Props {
showAppConfig?: boolean;
}
-export const settingDialogAtom = atom<boolean>(false);
-
export const ConfigButton: React.FC<Props> = ({ showAppConfig = true }) => {
const [settingDialog, setSettingDialog] = useAtom(settingDialogAtom);
const button = (
diff --git a/frontend/src/components/app-config/state.ts b/frontend/src/components/app-config/state.ts
new file mode 100644
index 0000000000..88d5147d4c
--- /dev/null
+++ b/frontend/src/components/app-config/state.ts
@@ -0,0 +1,18 @@
+/* Copyright 2024 Marimo. All rights reserved. */
+import { atom, useSetAtom } from "jotai";
+import {
+ activeUserConfigCategoryAtom,
+ type SettingCategoryId,
+} from "./user-config-form";
+
+export const settingDialogAtom = atom<boolean>(false);
+
+export function useOpenSettingsToTab() {
+ const setActiveCategory = useSetAtom(activeUserConfigCategoryAtom);
+ const setSettingsDialog = useSetAtom(settingDialogAtom);
+ const handleClick = (tab: SettingCategoryId) => {
+ setActiveCategory(tab);
+ setSettingsDialog(true);
+ };
+ return { handleClick };
+}
diff --git a/frontend/src/components/app-config/user-config-form.tsx b/frontend/src/components/app-config/user-config-form.tsx
index 67239edca7..f80253df72 100644
--- a/frontend/src/components/app-config/user-config-form.tsx
+++ b/frontend/src/components/app-config/user-config-form.tsx
@@ -90,9 +90,11 @@ const categories = [
},
] as const;
-type CategoryId = (typeof categories)[number]["id"];
+export type SettingCategoryId = (typeof categories)[number]["id"];
-export const activeUserConfigCategoryAtom = atom<CategoryId>(categories[0].id);
+export const activeUserConfigCategoryAtom = atom<SettingCategoryId>(
+ categories[0].id,
+);
export const UserConfigForm: React.FC = () => {
const [config, setConfig] = useUserConfig();
@@ -1161,11 +1163,13 @@ export const UserConfigForm: React.FC = () => {
>
<Tabs
value={activeCategory}
- onValueChange={(value) => setActiveCategory(value as CategoryId)}
+ onValueChange={(value) =>
+ setActiveCategory(value as SettingCategoryId)
+ }
orientation="vertical"
className="w-1/3 pr-4 border-r h-full overflow-auto p-6"
>
- <TabsList className="self-start max-h-none flex flex-col gap-2 flex-shrink-0 bg-background flex-1 min-h-full">
+ <TabsList className="self-start max-h-none flex flex-col gap-2 shrink-0 bg-background flex-1 min-h-full">
{categories.map((category) => (
<TabsTrigger
key={category.id}
diff --git a/frontend/src/components/editor/actions/useNotebookActions.tsx b/frontend/src/components/editor/actions/useNotebookActions.tsx
index bed35d2288..a05a71412a 100644
--- a/frontend/src/components/editor/actions/useNotebookActions.tsx
+++ b/frontend/src/components/editor/actions/useNotebookActions.tsx
@@ -66,11 +66,11 @@ import { useLayoutState, useLayoutActions } from "@/core/layout/layout";
import { useTogglePresenting } from "@/core/layout/useTogglePresenting";
import { useCopyNotebook } from "./useCopyNotebook";
import { isWasm } from "@/core/wasm/utils";
-import { settingDialogAtom } from "@/components/app-config/app-config-button";
import { renderShortcut } from "@/components/shortcuts/renderShortcut";
import { copyToClipboard } from "@/utils/copy";
import { newNotebookURL } from "@/utils/urls";
import { useRunAllCells } from "../cell/useRunCells";
+import { settingDialogAtom } from "@/components/app-config/state";
const NOOP_HANDLER = (event?: Event) => {
event?.preventDefault();
diff --git a/frontend/src/components/editor/chrome/panels/packages-panel.tsx b/frontend/src/components/editor/chrome/panels/packages-panel.tsx
index b7b118bb0b..53513d62e4 100644
--- a/frontend/src/components/editor/chrome/panels/packages-panel.tsx
+++ b/frontend/src/components/editor/chrome/panels/packages-panel.tsx
@@ -28,6 +28,7 @@ import { Kbd } from "@/components/ui/kbd";
import { Events } from "@/utils/events";
import { copyToClipboard } from "@/utils/copy";
import { PACKAGES_INPUT_ID } from "./constants";
+import { useOpenSettingsToTab } from "@/components/app-config/state";
export const PackagesPanel: React.FC = () => {
const [config] = useResolvedMarimoConfig();
@@ -62,6 +63,7 @@ const InstallPackageForm: React.FC<{
}> = ({ onSuccess, packageManager }) => {
const [input, setInput] = React.useState("");
const [loading, setLoading] = React.useState(false);
+ const { handleClick: openSettings } = useOpenSettingsToTab();
const handleAddPackage = async () => {
try {
@@ -103,7 +105,12 @@ const InstallPackageForm: React.FC<{
className="mr-2 h-4 w-4 shrink-0 opacity-50"
/>
) : (
- <BoxIcon className="mr-2 h-4 w-4 shrink-0 opacity-50" />
+ <Tooltip content="Change package manager">
+ <BoxIcon
+ onClick={() => openSettings("packageManagement")}
+ className="mr-2 h-4 w-4 shrink-0 opacity-50 hover:opacity-80 cursor-pointer"
+ />
+ </Tooltip>
)
}
rootClassName="flex-1 border-none"
diff --git a/frontend/src/components/editor/chrome/wrapper/copilot-status.tsx b/frontend/src/components/editor/chrome/wrapper/copilot-status.tsx
index 279c82bb9d..fa7441de84 100644
--- a/frontend/src/components/editor/chrome/wrapper/copilot-status.tsx
+++ b/frontend/src/components/editor/chrome/wrapper/copilot-status.tsx
@@ -12,25 +12,24 @@ import { aiEnabledAtom, resolvedMarimoConfigAtom } from "@/core/config/config";
import { GitHubCopilotIcon } from "@/components/icons/github-copilot";
import { SparklesIcon } from "lucide-react";
import { FooterItem } from "./footer-item";
-import { activeUserConfigCategoryAtom } from "@/components/app-config/user-config-form";
-import { settingDialogAtom } from "@/components/app-config/app-config-button";
import { toast } from "@/components/ui/use-toast";
import { getCopilotClient } from "@/core/codemirror/copilot/client";
import { Logger } from "@/utils/Logger";
import { Button } from "@/components/ui/button";
import { useOnMount } from "@/hooks/useLifecycle";
+import { useOpenSettingsToTab } from "@/components/app-config/state";
export const AIStatusIcon: React.FC = () => {
const ai = useAtomValue(aiAtom);
const aiEnabled = useAtomValue(aiEnabledAtom);
const model = ai?.open_ai?.model || "gpt-4-turbo";
- const { handleClick } = useOpenAISettings();
+ const { handleClick } = useOpenSettingsToTab();
if (!aiEnabled) {
return (
<FooterItem
tooltip="Assist is disabled"
selected={false}
- onClick={handleClick}
+ onClick={() => handleClick("ai")}
>
<SparklesIcon className="h-4 w-4 opacity-60" />
</FooterItem>
@@ -44,7 +43,7 @@ export const AIStatusIcon: React.FC = () => {
<b>Assist model:</b> {model}
</>
}
- onClick={handleClick}
+ onClick={() => handleClick("ai")}
selected={false}
>
<SparklesIcon className="h-4 w-4" />
@@ -59,16 +58,6 @@ const aiAtom = atom((get) => {
return get(resolvedMarimoConfigAtom).ai;
});
-export function useOpenAISettings() {
- const setActiveCategory = useSetAtom(activeUserConfigCategoryAtom);
- const setSettingsDialog = useSetAtom(settingDialogAtom);
- const handleClick = () => {
- setActiveCategory("ai");
- setSettingsDialog(true);
- };
- return { handleClick };
-}
-
export const CopilotStatusIcon: React.FC = () => {
const copilot = useAtomValue(copilotAtom);
@@ -84,7 +73,8 @@ export const CopilotStatusIcon: React.FC = () => {
const GitHubCopilotStatus: React.FC = () => {
const isGitHubCopilotSignedIn = useAtomValue(isGitHubCopilotSignedInState);
const isLoading = useAtomValue(githubCopilotLoadingVersion) !== null;
- const { handleClick } = useOpenAISettings();
+ const { handleClick } = useOpenSettingsToTab();
+ const openSettings = () => handleClick("ai");
const label = isGitHubCopilotSignedIn ? "Ready" : "Not connected";
const setCopilotSignedIn = useSetAtom(isGitHubCopilotSignedInState);
@@ -128,7 +118,7 @@ const GitHubCopilotStatus: React.FC = () => {
"Failed to connect to GitHub Copilot. Check settings and try again.",
variant: "danger",
action: (
- <Button variant="link" onClick={handleClick}>
+ <Button variant="link" onClick={openSettings}>
Settings
</Button>
),
@@ -151,7 +141,7 @@ const GitHubCopilotStatus: React.FC = () => {
</>
}
selected={false}
- onClick={handleClick}
+ onClick={openSettings}
>
<span>
{isLoading ? (
diff --git a/frontend/src/core/codemirror/copilot/copilot-config.tsx b/frontend/src/core/codemirror/copilot/copilot-config.tsx
index 13f7c044da..6965d9b125 100644
--- a/frontend/src/core/codemirror/copilot/copilot-config.tsx
+++ b/frontend/src/core/codemirror/copilot/copilot-config.tsx
@@ -4,19 +4,19 @@ import { copilotSignedInState, isGitHubCopilotSignedInState } from "./state";
import { memo, useState } from "react";
import { getCopilotClient } from "./client";
import { Button, buttonVariants } from "@/components/ui/button";
-import { useOpenAISettings } from "@/components/editor/chrome/wrapper/copilot-status";
import { CheckIcon, CopyIcon, Loader2Icon, XIcon } from "lucide-react";
import { Label } from "@/components/ui/label";
import { toast } from "@/components/ui/use-toast";
import { copyToClipboard } from "@/utils/copy";
import { Logger } from "@/utils/Logger";
+import { useOpenSettingsToTab } from "@/components/app-config/state";
export const CopilotConfig = memo(() => {
const [copilotSignedIn, copilotChangeSignIn] = useAtom(
isGitHubCopilotSignedInState,
);
const [step, setStep] = useAtom(copilotSignedInState);
- const { handleClick: openSettings } = useOpenAISettings();
+ const { handleClick: openSettings } = useOpenSettingsToTab();
const [localData, setLocalData] = useState<{ url: string; code: string }>();
const [loading, setLoading] = useState(false);
@@ -125,7 +125,7 @@ export const CopilotConfig = memo(() => {
"Lost connection during sign-in. Please check settings and try again.",
variant: "danger",
action: (
- <Button variant="link" onClick={openSettings}>
+ <Button variant="link" onClick={() => openSettings("ai")}>
Settings
</Button>
),
diff --git a/marimo/_config/packages.py b/marimo/_config/packages.py
index 93ae956534..71acb7f01f 100644
--- a/marimo/_config/packages.py
+++ b/marimo/_config/packages.py
@@ -4,10 +4,14 @@ from __future__ import annotations
import os
import sys
from pathlib import Path
-from typing import Literal
+from typing import Literal, Optional
+from marimo._config.utils import read_toml
-def infer_package_manager() -> Literal["pip", "rye", "uv", "poetry", "pixi"]:
+PackageManagerKind = Literal["pip", "rye", "uv", "poetry", "pixi"]
+
+
+def infer_package_manager() -> PackageManagerKind:
"""Infer the package manager from the current project."""
try:
@@ -22,18 +26,25 @@ def infer_package_manager() -> Literal["pip", "rye", "uv", "poetry", "pixi"]:
break
root_dir = root_dir.parent
- # Check for Poetry
- if (root_dir / "poetry.lock").exists():
- return "poetry"
+ # If there is a pyproject.toml, try to infer the package manager
+ pyproject_toml = root_dir / "pyproject.toml"
+ if pyproject_toml.exists():
+ package_manager = infer_package_manager_from_pyproject(
+ pyproject_toml
+ )
+ if package_manager is not None:
+ return package_manager
- # Check for Rye
- if (root_dir / ".rye").exists():
- return "rye"
+ # Try to infer from lockfiles
+ package_manager = infer_package_manager_from_lockfile(root_dir)
+ if package_manager is not None:
+ return package_manager
- # Check for Pixi
+ # misc - Check for pixi.toml
if (root_dir / "pixi.toml").exists():
return "pixi"
+ # misc - Check for virtualenv/pip
VIRTUAL_ENV = os.environ.get("VIRTUAL_ENV", "")
# Check for '/uv/' in VIRTUAL_ENV
@@ -51,3 +62,49 @@ def infer_package_manager() -> Literal["pip", "rye", "uv", "poetry", "pixi"]:
except Exception:
# Fallback to pip
return "pip"
+
+
+def infer_package_manager_from_pyproject(
+ pyproject_toml: Path,
+) -> Optional[PackageManagerKind]:
+ """Infer the package manager from a pyproject.toml file."""
+ try:
+ data = read_toml(pyproject_toml)
+
+ if "tool" not in data:
+ return None
+
+ to_check: list[PackageManagerKind] = [
+ "poetry",
+ "pixi",
+ "uv",
+ "rye",
+ ]
+
+ for manager in to_check:
+ if manager in data["tool"]:
+ return manager
+
+ return None
+ except Exception:
+ # Fallback to None
+ return None
+
+
+def infer_package_manager_from_lockfile(
+ root_dir: Path,
+) -> Optional[PackageManagerKind]:
+ """Infer the package manager from a lockfile."""
+ lockfile_map: dict[str, PackageManagerKind] = {
+ "poetry.lock": "poetry",
+ "pixi.lock": "pixi",
+ ".uv": "uv",
+ "requirements.lock": "rye",
+ }
+ try:
+ for lockfile, manager in lockfile_map.items():
+ if (root_dir / lockfile).exists():
+ return manager
+ return None
+ except Exception:
+ return None
diff --git a/marimo/_config/reader.py b/marimo/_config/reader.py
index 822421789c..675cd3f412 100644
--- a/marimo/_config/reader.py
+++ b/marimo/_config/reader.py
@@ -1,21 +1,14 @@
# Copyright 2024 Marimo. All rights reserved.
from pathlib import Path
-from typing import Any, Dict, Optional, Union, cast
+from typing import Optional, Union, cast
from marimo import _loggers
from marimo._config.config import PartialMarimoConfig
+from marimo._config.utils import read_toml
LOGGER = _loggers.marimo_logger()
-def read_toml(file_path: Union[str, Path]) -> Dict[str, Any]:
- """Read and parse a TOML file."""
- import tomlkit
-
- with open(file_path, "rb") as file:
- return tomlkit.load(file)
-
-
def read_marimo_config(path: str) -> PartialMarimoConfig:
"""Read the marimo.toml configuration."""
return cast(PartialMarimoConfig, read_toml(path))
diff --git a/marimo/_config/utils.py b/marimo/_config/utils.py
index 699d6a879b..432879d89d 100644
--- a/marimo/_config/utils.py
+++ b/marimo/_config/utils.py
@@ -2,15 +2,26 @@
from __future__ import annotations
import os
-from typing import Any, Optional
+from typing import TYPE_CHECKING, Any, Dict, Optional, Union
from marimo import _loggers
+if TYPE_CHECKING:
+ from pathlib import Path
+
LOGGER = _loggers.marimo_logger()
CONFIG_FILENAME = ".marimo.toml"
+def read_toml(file_path: Union[str, Path]) -> Dict[str, Any]:
+ """Read and parse a TOML file."""
+ import tomlkit
+
+ with open(file_path, "rb") as file:
+ return tomlkit.load(file)
+
+
def _is_parent(parent_path: str, child_path: str) -> bool:
# Check if parent is actually a parent of child
# paths must be real/absolute paths
diff --git a/marimo/_utils/config/config.py b/marimo/_utils/config/config.py
index 54f6c63e77..39acbe3ca6 100644
--- a/marimo/_utils/config/config.py
+++ b/marimo/_utils/config/config.py
@@ -6,6 +6,7 @@ from dataclasses import asdict
from tempfile import TemporaryDirectory
from typing import Any, Optional, Type, TypeVar
+from marimo._config.utils import read_toml
from marimo._utils.parse_dataclass import parse_raw
ROOT_DIR = ".marimo"
@@ -33,9 +34,8 @@ class ConfigReader:
import tomlkit
try:
- with open(self.filepath, "r") as file:
- data = tomlkit.parse(file.read())
- return parse_raw(data, cls, allow_unknown_keys=True)
+ data = read_toml(self.filepath)
+ return parse_raw(data, cls, allow_unknown_keys=True)
except (FileNotFoundError, tomlkit.exceptions.TOMLKitError):
return fallback
diff --git a/tests/_config/test_config_packages.py b/tests/_config/test_config_packages.py
new file mode 100644
index 0000000000..6548a2b859
--- /dev/null
+++ b/tests/_config/test_config_packages.py
@@ -0,0 +1,130 @@
+from __future__ import annotations
+
+import os
+import sys
+from pathlib import Path
+from typing import Any
+from unittest.mock import patch
+
+import pytest
+
+from marimo._config.packages import (
+ infer_package_manager,
+ infer_package_manager_from_lockfile,
+ infer_package_manager_from_pyproject,
+)
+
+
+def mock_cwd(tmp_path: Path):
+ """Creates a temporary directory and sets it as CWD"""
+ old_cwd = os.getcwd()
+ os.chdir(tmp_path)
+ yield tmp_path
+ os.chdir(old_cwd)
+
+
+def test_infer_package_manager_from_pyproject():
+ # Test poetry detection
+ with patch(
+ "marimo._config.packages.read_toml",
+ return_value={"tool": {"poetry": {}}},
+ ):
+ assert (
+ infer_package_manager_from_pyproject(Path("pyproject.toml"))
+ == "poetry"
+ )
+
+ # Test no tool section
+ with patch("marimo._config.packages.read_toml", return_value={}):
+ assert (
+ infer_package_manager_from_pyproject(Path("pyproject.toml"))
+ is None
+ )
+
+ # Test exception handling
+ with patch("marimo._config.packages.read_toml", side_effect=Exception):
+ assert (
+ infer_package_manager_from_pyproject(Path("pyproject.toml"))
+ is None
+ )
+
+
+def test_infer_package_manager_from_lockfile(mock_cwd: Path):
+ # Test poetry.lock
+ (mock_cwd / "poetry.lock").touch()
+ assert infer_package_manager_from_lockfile(mock_cwd) == "poetry"
+ (mock_cwd / "poetry.lock").unlink()
+
+ # Test pixi.lock
+ (mock_cwd / "pixi.lock").touch()
+ assert infer_package_manager_from_lockfile(mock_cwd) == "pixi"
+ (mock_cwd / "pixi.lock").unlink()
+
+ # Test no lockfile
+ for f in mock_cwd.iterdir():
+ f.unlink()
+ assert infer_package_manager_from_lockfile(mock_cwd) is None
+
+
+TEST_CASES: list[
+ tuple[dict[str, Any], dict[str, Any], dict[str, Any], str]
+] = [
+ # Test pyproject.toml with poetry
+ ({"pyproject.toml": {"tool": {"poetry": {}}}}, {}, {}, "poetry"),
+ # Test lockfile detection
+ ({"poetry.lock": ""}, {}, {}, "poetry"),
+ # Test pixi.toml
+ ({"pixi.toml": ""}, {}, {}, "pixi"),
+ # Test fallback to pip
+ ({}, {}, {}, "pip"),
+]
+
+if sys.platform != "win32":
+ TEST_CASES.extend(
+ [
+ # Test uv virtualenv
+ ({}, {"VIRTUAL_ENV": "/path/uv/env"}, {}, "uv"),
+ # Test regular virtualenv
+ ({}, {}, {"base_prefix": "/usr", "prefix": "/venv"}, "pip"),
+ ]
+ )
+
+
+ ("files", "env_vars", "sys_attrs", "expected"),
+ TEST_CASES,
+)
+def test_infer_package_manager(
+ mock_cwd: Path,
+ files: dict[str, Any],
+ env_vars: dict[str, Any],
+ sys_attrs: dict[str, Any],
+ expected: str,
+):
+ # Write a default pyproject.toml file
+ (mock_cwd / "pyproject.toml").write_text(
+ """
+ [project]
+ name = "test"
+ """
+ )
+
+ # Create test files
+ for filename, content in files.items():
+ if isinstance(content, dict):
+ import tomlkit
+
+ with open(mock_cwd / filename, "w") as f:
+ tomlkit.dump(content, f)
+ else:
+ (mock_cwd / filename).write_text(content)
+
+ # Mock environment variables
+ with patch.dict(os.environ, env_vars):
+ # Mock sys attributes
+ if sys_attrs:
+ with patch.multiple(sys, **sys_attrs):
+ assert infer_package_manager() == expected
+ else:
+ assert infer_package_manager() == expected
diff --git a/tests/_server/templates/snapshots/export1.txt b/tests/_server/templates/snapshots/export1.txt
index 9c3a7004ec..1c9ad32320 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": "pip"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "on_cell_change": "autorun"}, "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"}, "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.txt
index 993de9ab27..21e76164f7 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": "pip"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "on_cell_change": "autorun"}, "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"}, "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.txt
index bd251d193c..bb2f00d7ab 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": "pip"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "on_cell_change": "autorun"}, "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"}, "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.txt
index ff2d329754..cc12f97fce 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": "pip"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "on_cell_change": "autorun"}, "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"}, "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.txt
index 0761bc7a4a..ba7f3bfb95 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": "pip"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "on_cell_change": "autorun"}, "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"}, "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='{"html_head_file": "head.html", "width": "compact"}' hidden></marimo-app-config>
<marimo-server-token data-token='token' hidden></marimo-server-token>
<title>notebook</title>