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
feat: argparse support when running as a notebook (#4306)
Akshay Agrawal9f9655d573cf
diff --git a/docs/api/cli_args.md b/docs/api/cli_args.mdindex 0e9c1a5aa2..9f8ac02fec 100644--- a/docs/api/cli_args.md+++ b/docs/api/cli_args.md@@ -1,13 +1,34 @@# Command Line Arguments-Use `mo.cli_args` to access command-line arguments passed to the notebook. This-allows you to pass arguments to the notebook that are not controllable by the-user. The arguments will be parsed from the command line when running the-notebook as an application with `marimo run` or `marimo edit`; they will also-be parsed from the command line when running as a script.+When running as a script with `python notebook.py`, command-line arguments+are available to your program in `sys.argv`, just like any other Python+program. This means you can use+[`argparse`](https://docs.python.org/3/library/argparse.html),+[`simple-parsing`](https://github.com/lebrice/SimpleParsing), and other tools+for specifying and parsing arguments.-Some examples passing command-line arguments to the notebook when running-as a script:+You can also use tools like `argparse` when running as a notebook (`marimo+edit` or `marimo run`) or exporting to HTML, IPYNB or another format (`marimo+export`). In these cases, `sys.argv` is set to the notebook filename followed by any args+following the `--` separator.++For example, for++```bash+marimo edit notebook.py -- --lr 1e-4 --epochs 15+```++sets `sys.argv` to `["notebook.py", "--lr", "1e-4", "--epochs", "15"]`.++For usage examples, see the guide on [running as a script](../guides/scripts.md).++## Utility function for parsing arguments++marimo provides a utility function called `mo.cli_args()` for parsing arguments+from strings into primitive data types (`int`, `bool`, `float`, `str`).+However, unlike `argparse` and `simple-parsing`, this function does not let you+declare your program's arguments, nor does it generate help text. **For these+reasons, we recommend using `argparse` or `simple-parsing` instead.**```bashpython notebook.py -- --arg1 value1 --arg2 value2@@ -20,9 +41,6 @@ python notebook.py -- --arg1 10.5 --arg2 hello --arg2 world# mo.cli_args() == {'arg1': 10.5, 'arg2': ['hello', 'world']}```-In each example, `python` can be replaced as `marimo run` (for running as-an app) or `marimo edit` (for running as a notebook).-::: marimo.cli_args!!! note "Query Parameters"diff --git a/docs/guides/scripts.md b/docs/guides/scripts.mdindex 5fa748dbb9..02ba54817c 100644--- a/docs/guides/scripts.md+++ b/docs/guides/scripts.md@@ -12,20 +12,27 @@ like writing to disk. Print statements and other console outputs will showup in your terminal.-!!! note "Producing notebook outputs"+!!! note "Saving notebook outputs"- To run as a script while also producing HTML of the notebook outputs, use+ To run as a script while also saving HTML of the notebook outputs, use```bashmarimo export html notebook.py -o notebook.html```- Separate CLI args for your notebook with two dashes:+ You can also pass command-line arguments to your notebook during export.+ Separate these args from the command with two dashes:```bashmarimo export html notebook.py -o notebook.html -- -arg value```+ Exporting to other formats, such as ipynb, is also possible:++ ```bash+ marimo export ipynb notebook.py -o notebook.ipynb -- -arg value+ ```+## Command-line argumentsWhen run as a script, you can access your notebook's command-line arguments@@ -44,16 +51,8 @@ running as a notebook.filepath: examples/running_as_a_script/with_argparse.py///-### simpler-parsing+### simple-parsing/// marimo-embed-filefilepath: examples/running_as_a_script/with_simple_parsing.py///---### Parsing extra command-line arguments passed to marimo edit--You can also parametrize `marimo edit` and `marimo run` sessions with command-line-arguments; however, tools like argparse don't work out of the box, since they are-expecting the first argument to be the notebook executable. For these cases,-see the [docs page on CLI args](../api/cli_args.md) to learn more.diff --git a/docs/guides/troubleshooting.md b/docs/guides/troubleshooting.mdindex 7b2d8630bf..3ef6ac3cb3 100644--- a/docs/guides/troubleshooting.md+++ b/docs/guides/troubleshooting.md@@ -101,6 +101,9 @@ If you find yourself needing to force execution order often, it might be a sign## General debugging tips++### Understanding dependencies+- Use the Variables Panel to inspect variable values and see where they're defined and used.- Add print statements or use `mo.md()` to output debug information in cell outputs.- Temporarily disable cells to isolate issues.@@ -108,6 +111,33 @@ If you find yourself needing to force execution order often, it might be a signRemember, marimo's reactivity is based on global variable definitions and references, and mutations to objects aren't tracked. Keeping this in mind can help you understand and debug unexpected behaviors in your notebooks.+## Patches made by marimo++### Why can't I import a local library?++When using `marimo edit path/to/notebook.py` or `marimo run+path/to/notebook.py`, marimo sets `sys.path` to match what you would get with+`python path/to/notebook.py`. In particular, setting `sys.path[0]` to the notebook+directory:++```+sys.path[0] == 'path/to/'+```++You can add entries to `sys.path` in your pyproject.toml [runtime configuration](../guides/configuration/runtime_configuration.md).+++### Other patches++When running as a notebook, marimo makes the following changes to variables:++- marimo patches `pdb.Pdb` with a custom class to enable interactive debugging+ with the `breakpoint()` function+- marimo patches `sys.argv` when running as a notebook to match what you would+ see when [running as a script](../guides/scripts.md).+- local variables currently have their names mangled, meaning source code introspection+ that uses local variables may not work; this behavior may change in the future.+## Why is the notebook returning 404s on the web assets?If you're seeing 404 errors for web assets like JS or CSS files, it may be due to symlink settings or proxy settings.diff --git a/examples/running_as_a_script/sharing_arguments.py b/examples/running_as_a_script/sharing_arguments.pynew file mode 100644index 0000000000..39068c05b8--- /dev/null+++ b/examples/running_as_a_script/sharing_arguments.py@@ -0,0 +1,73 @@+import marimo++__generated_with = "0.11.31"+app = marimo.App(width="medium")+++def _():+ import marimo as mo+ return (mo,)+++def _():+ import argparse+ return (argparse,)++[email protected](hide_code=True)+def _(mo):+ mo.md(+ """+ This notebook shows how to parametrize a notebook with optional command-line arguments.++ Run the notebook with++ ```bash+ marimo edit sharing_arguments.py+ ```++ or++ ```bash+ marimo edit sharing_arguments.py -- -learning_rate=1e-3+ ```++ (Note the `--` separating the filename from the arguments.)++ or++ ```bash+ python sharing_arguments.py -learning_rate=1e-3+ ```++ See help for the notebook's arguments with++ ```python+ python sharing_arguments.py --help+ ```+ """+ )+ return+++def _(mo):+ default = mo.ui.number(1000, step=100)+ default+ return (default,)+++def _(argparse, default):+ parser = argparse.ArgumentParser()++ parser.add_argument("-iterations", default=default.value)+ args = parser.parse_args()+ print(args.iterations)+ return args, parser+++if __name__ == "__main__":+ app.run()diff --git a/marimo/_cli/cli.py b/marimo/_cli/cli.pyindex 4082783512..d3b42391ff 100644--- a/marimo/_cli/cli.py+++ b/marimo/_cli/cli.py@@ -434,6 +434,7 @@ def edit(include_code=True,watch=watch,cli_args=parse_args(args),+ argv=list(args),auth_token=_resolve_token(token, token_password),base_url=base_url,allow_origins=allow_origins,@@ -531,6 +532,7 @@ def new(include_code=True,watch=False,cli_args={},+ argv=[],auth_token=_resolve_token(token, token_password),base_url=base_url,redirect_console_to_browser=True,@@ -720,6 +722,7 @@ def run(base_url=base_url,allow_origins=allow_origins,cli_args=parse_args(args),+ argv=list(args),auth_token=_resolve_token(token, token_password),redirect_console_to_browser=redirect_console_to_browser,)@@ -823,6 +826,7 @@ def tutorial(headless=headless,watch=False,cli_args={},+ argv=[],auth_token=_resolve_token(token, token_password),redirect_console_to_browser=False,ttl_seconds=None,diff --git a/marimo/_cli/export/commands.py b/marimo/_cli/export/commands.pyindex 3f76f88f96..86baa39337 100644--- a/marimo/_cli/export/commands.py+++ b/marimo/_cli/export/commands.py@@ -183,6 +183,7 @@ def html(file_path,include_code=include_code,cli_args=cli_args,+ argv=list(args),))@@ -426,7 +427,10 @@ def ipynb(if include_outputs:return asyncio_run(run_app_then_export_as_ipynb(- file_path, sort_mode=sort, cli_args={}+ file_path,+ sort_mode=sort,+ cli_args={},+ argv=None,))return export_as_ipynb(file_path, sort_mode=sort)diff --git a/marimo/_cli/parse_args.py b/marimo/_cli/parse_args.pyindex 2bf7db641d..12b2725fad 100644--- a/marimo/_cli/parse_args.py+++ b/marimo/_cli/parse_args.py@@ -18,7 +18,6 @@ def parse_args(This does not support lists as values."""-args_dict: SerializedCLIArgs = {}# Combine any arguments that are split by spacesdiff --git a/marimo/_islands/_island_generator.py b/marimo/_islands/_island_generator.pyindex 6ae7acc312..3de241a800 100644--- a/marimo/_islands/_island_generator.py+++ b/marimo/_islands/_island_generator.py@@ -316,6 +316,7 @@ class MarimoIslandGenerator:(session, did_error) = await run_app_until_completion(file_manager=AppFileManager.from_app(self._app),cli_args={},+ argv=None,)del did_errorself.has_run = Truediff --git a/marimo/_pyodide/bootstrap.py b/marimo/_pyodide/bootstrap.pyindex 5f5527f64a..57eb4b1022 100644--- a/marimo/_pyodide/bootstrap.py+++ b/marimo/_pyodide/bootstrap.py@@ -121,7 +121,12 @@ def create_session(app_file_manager,SessionMode.EDIT,write_kernel_message,- AppMetadata(query_params=query_params, filename=filename, cli_args={}),+ AppMetadata(+ query_params=query_params,+ filename=filename,+ cli_args={},+ argv=[""],+ ),user_config,)diff --git a/marimo/_runtime/app/kernel_runner.py b/marimo/_runtime/app/kernel_runner.pyindex 59a9134fe6..f97f672045 100644--- a/marimo/_runtime/app/kernel_runner.py+++ b/marimo/_runtime/app/kernel_runner.py@@ -67,7 +67,9 @@ class AppKernelRunner:filename = "<unknown>"self._kernel = Kernel(cell_configs={},- app_metadata=AppMetadata({}, {}, filename),+ app_metadata=AppMetadata(+ {}, ctx.cli_args.to_dict(), argv=ctx.argv, filename=filename+ ),stream=ctx.stream,stdout=None,stderr=None,diff --git a/marimo/_runtime/context/kernel_context.py b/marimo/_runtime/context/kernel_context.pyindex 1b2f3802f5..8995e1d03f 100644--- a/marimo/_runtime/context/kernel_context.py+++ b/marimo/_runtime/context/kernel_context.py@@ -80,6 +80,11 @@ class KernelRuntimeContext(RuntimeContext):"""Get the CLI args."""return self._kernel.cli_args+ @property+ def argv(self) -> list[str]:+ """The original argv the kernel was created with."""+ return self._kernel.argv+@propertydef query_params(self) -> QueryParams:"""Get the query params."""diff --git a/marimo/_runtime/context/script_context.py b/marimo/_runtime/context/script_context.pyindex ba556e1682..cb4ad2a833 100644--- a/marimo/_runtime/context/script_context.py+++ b/marimo/_runtime/context/script_context.py@@ -43,6 +43,7 @@ class ScriptRuntimeContext(RuntimeContext):def __post_init__(self) -> None:self._cli_args: CLIArgs | None = None+ self._argv = sys.argvself._query_params = QueryParams({}, _registry=self.state_registry)@property@@ -84,6 +85,11 @@ class ScriptRuntimeContext(RuntimeContext):self._cli_args = CLIArgs(args_from_argv())return self._cli_args+ @property+ def argv(self) -> list[str]:+ """Get the original argv."""+ return self._argv+@propertydef query_params(self) -> QueryParams:"""Get the query params."""diff --git a/marimo/_runtime/context/types.py b/marimo/_runtime/context/types.pyindex 6293ba5a2d..11fae46d98 100644--- a/marimo/_runtime/context/types.py+++ b/marimo/_runtime/context/types.py@@ -119,6 +119,12 @@ class RuntimeContext(abc.ABC):"""Get the cell id of the currently executing cell, if any."""pass+ @property+ @abc.abstractmethod+ def argv(self) -> list[str]:+ """The original argv the context was created with."""+ pass+@property@abc.abstractmethoddef cli_args(self) -> CLIArgs:diff --git a/marimo/_runtime/requests.py b/marimo/_runtime/requests.pyindex 94456f3bc3..1fb81d44cb 100644--- a/marimo/_runtime/requests.py+++ b/marimo/_runtime/requests.py@@ -233,6 +233,7 @@ class AppMetadata:query_params: SerializedQueryParamscli_args: SerializedCLIArgs+ argv: Union[list[str], None] = Nonefilename: Optional[str] = Nonediff --git a/marimo/_runtime/runtime.py b/marimo/_runtime/runtime.pyindex 35f9acae02..1283dcb32e 100644--- a/marimo/_runtime/runtime.py+++ b/marimo/_runtime/runtime.py@@ -448,6 +448,20 @@ class Kernel:self.app_metadata = app_metadataself.query_params = QueryParams(app_metadata.query_params)self.cli_args = CLIArgs(app_metadata.cli_args)+ self.argv = (+ [app_metadata.filename or ""] + app_metadata.argv+ if app_metadata.argv is not None+ else sys.argv+ )++ # We update sys.argv to be [filename, args after '--'] so modules like+ # argparse, simple-parser work out of the box.+ #+ # TODO(akshayka): The notebook globals share modules with the kernel+ # process; if we ever isolate them, push this mutation down into the+ # kernel globals.+ sys.argv = self.argv+self.stream = streamself.stdout = stdoutself.stderr = stderrdiff --git a/marimo/_server/asgi.py b/marimo/_server/asgi.pyindex 1a43336534..cff53e9b13 100644--- a/marimo/_server/asgi.py+++ b/marimo/_server/asgi.py@@ -458,6 +458,7 @@ def create_asgi_app(# since we don't want to read arbitrary args and apply them# to each applicationcli_args={},+ argv=None,auth_token=auth_token,redirect_console_to_browser=False,ttl_seconds=None,diff --git a/marimo/_server/export/__init__.py b/marimo/_server/export/__init__.pyindex d4751cfc14..1cb5669300 100644--- a/marimo/_server/export/__init__.py+++ b/marimo/_server/export/__init__.py@@ -119,6 +119,7 @@ async def run_app_then_export_as_ipynb(path_or_file_manager: Union[MarimoPath, AppFileManager],sort_mode: Literal["top-down", "topological"],cli_args: SerializedCLIArgs,+ argv: list[str] | None,) -> ExportResult:if isinstance(path_or_file_manager, AppFileManager):file_manager = path_or_file_manager@@ -132,6 +133,7 @@ async def run_app_then_export_as_ipynb((session_view, did_error) = await run_app_until_completion(file_manager,cli_args,+ argv,)result = Exporter().export_as_ipynb(@@ -148,6 +150,7 @@ async def run_app_then_export_as_html(path: MarimoPath,include_code: bool,cli_args: SerializedCLIArgs,+ argv: list[str],) -> ExportResult:# Create a file router and file managerfile_router = AppFileRouter.from_filename(path)@@ -162,6 +165,7 @@ async def run_app_then_export_as_html(session_view, did_error = await run_app_until_completion(file_manager,cli_args,+ argv=argv,)# Export the session as HTMLhtml, filename = Exporter().export_as_html(@@ -204,6 +208,7 @@ async def run_app_then_export_as_reactive_html(async def run_app_until_completion(file_manager: AppFileManager,cli_args: SerializedCLIArgs,+ argv: list[str] | None,) -> tuple[SessionView, bool]:from marimo._server.sessions import Session@@ -285,6 +290,7 @@ async def run_app_until_completion(query_params={},filename=file_manager.path,cli_args=cli_args,+ argv=argv,),app_file_manager=file_manager,config_manager=config_manager,diff --git a/marimo/_server/sessions.py b/marimo/_server/sessions.pyindex 40ec829ac0..b08c2e28d8 100644--- a/marimo/_server/sessions.py+++ b/marimo/_server/sessions.py@@ -757,6 +757,7 @@ class SessionManager:lsp_server: LspServer,config_manager: MarimoConfigManager,cli_args: SerializedCLIArgs,+ argv: list[str] | None,auth_token: Optional[AuthToken],redirect_console_to_browser: bool,ttl_seconds: Optional[int],@@ -774,6 +775,7 @@ class SessionManager:self.watch = watchself.recents = RecentFilesManager()self.cli_args = cli_args+ self.argv = argvself.redirect_console_to_browser = redirect_console_to_browser# We should access the config_manager from the session if possible@@ -835,6 +837,7 @@ class SessionManager:query_params=query_params,filename=app_file_manager.path,cli_args=self.cli_args,+ argv=self.argv,),app_file_manager=app_file_manager,config_manager=self._config_manager,diff --git a/marimo/_server/start.py b/marimo/_server/start.pyindex 7a8ef61407..04d026842f 100644--- a/marimo/_server/start.py+++ b/marimo/_server/start.py@@ -81,6 +81,7 @@ def start(proxy: Optional[str],watch: bool,cli_args: SerializedCLIArgs,+ argv: list[str],base_url: str = "",allow_origins: Optional[tuple[str, ...]] = None,auth_token: Optional[AuthToken],@@ -146,6 +147,7 @@ def start(lsp_server=lsp_composite_server,config_manager=config_reader,cli_args=cli_args,+ argv=argv,auth_token=auth_token,redirect_console_to_browser=redirect_console_to_browser,watch=watch,diff --git a/openapi/api.yaml b/openapi/api.yamlindex 55c48acf4d..2865f4d6c2 100644--- a/openapi/api.yaml+++ b/openapi/api.yaml@@ -78,6 +78,11 @@ components:type: objectAppMetadata:properties:+ argv:+ items:+ type: string+ nullable: true+ type: arraycliArgs:additionalProperties:oneOf:@@ -2402,7 +2407,7 @@ components:type: objectinfo:title: marimo API- version: 0.11.26+ version: 0.11.31openapi: 3.1.0paths:/@file/{filename_and_length}:diff --git a/tests/_runtime/test_runtime.py b/tests/_runtime/test_runtime.pyindex 692e992453..cad261bb76 100644--- a/tests/_runtime/test_runtime.py+++ b/tests/_runtime/test_runtime.py@@ -1155,7 +1155,10 @@ class TestExecution:cell_configs={},user_config=DEFAULT_CONFIG,app_metadata=AppMetadata(- query_params={}, filename=filename, cli_args={}+ query_params={},+ filename=filename,+ cli_args={},+ argv=None,),enqueue_control_request=lambda _: None,module=create_main_module(None, None, None),@@ -1216,7 +1219,10 @@ class TestExecution:cell_configs={},user_config=DEFAULT_CONFIG,app_metadata=AppMetadata(- query_params={}, filename=filename, cli_args={}+ query_params={},+ filename=filename,+ cli_args={},+ argv=None,),enqueue_control_request=lambda _: None,module=create_main_module(None, None, None),@@ -1227,6 +1233,65 @@ class TestExecution:if str(tmp_path) in sys.path:sys.path.remove(str(tmp_path))+ def test_sys_argv_updated(self, tmp_path: pathlib.Path) -> None:+ old_argv = sys.argv+ try:+ filename = str(tmp_path / "notebook.py")+ Kernel(+ stream=NoopStream(),+ stdout=None,+ stderr=None,+ stdin=None,+ cell_configs={},+ user_config=DEFAULT_CONFIG,+ app_metadata=AppMetadata(+ query_params={},+ filename=filename,+ cli_args={},+ argv=["foo", "bar"],+ ),+ enqueue_control_request=lambda _: None,+ module=create_main_module(None, None, None),+ )++ assert len(sys.argv) == 3+ assert filename == sys.argv[0]+ assert sys.argv[1] == "foo"+ assert sys.argv[2] == "bar"+ finally:+ sys.argv = old_argv+ if str(tmp_path) in sys.path:+ sys.path.remove(str(tmp_path))++ def test_sys_argv_not_updated_when_none(+ self, tmp_path: pathlib.Path+ ) -> None:+ argv = sys.argv+ try:+ filename = str(tmp_path / "notebook.py")+ Kernel(+ stream=NoopStream(),+ stdout=None,+ stderr=None,+ stdin=None,+ cell_configs={},+ user_config=DEFAULT_CONFIG,+ app_metadata=AppMetadata(+ query_params={},+ filename=filename,+ cli_args={},+ argv=None,+ ),+ enqueue_control_request=lambda _: None,+ module=create_main_module(None, None, None),+ )+ assert argv == sys.argv+ finally:+ # restore argv in case test failed or accidentally mutated it+ sys.argv = argv+ if str(tmp_path) in sys.path:+ sys.path.remove(str(tmp_path))+async def test_sys_path_updated_with_exec_req(self, tmp_path: pathlib.Path, exec_req: ExecReqProvider) -> None:@@ -1248,7 +1313,10 @@ class TestExecution:},},app_metadata=AppMetadata(- query_params={}, filename=str(filename), cli_args={}+ query_params={},+ filename=str(filename),+ cli_args={},+ argv=None,),enqueue_control_request=lambda _: None,module=create_main_module(None, None, None),diff --git a/tests/_server/export/test_exporter.py b/tests/_server/export/test_exporter.pyindex ad2a14e7a9..430b0846c3 100644--- a/tests/_server/export/test_exporter.py+++ b/tests/_server/export/test_exporter.py@@ -225,7 +225,10 @@ async def test_export_ipynb_with_outputs():assert content is not Noneresult = await run_app_then_export_as_ipynb(- file_manager, sort_mode="top-down", cli_args={}+ file_manager,+ sort_mode="top-down",+ cli_args={},+ argv=None,)assert not result.did_errorassert result.download_filename == "notebook.ipynb"@@ -256,7 +259,9 @@ async def test_run_until_completion_with_stop():file_manager = AppFileManager.from_app(InternalApp(app))session_view, did_error = await run_app_until_completion(- file_manager, cli_args={}+ file_manager,+ cli_args={},+ argv=None,)assert did_error is Falsecell_ops = [op for op in session_view.operations if isinstance(op, CellOp)]@@ -294,7 +299,7 @@ async def test_run_until_completion_with_stack_trace():# When not redirected, the stack trace is not included in the outputsession_view, did_error = await run_app_until_completion(- file_manager, cli_args={}+ file_manager, cli_args={}, argv=None)assert did_error is Truecell_ops = [op for op in session_view.operations if isinstance(op, CellOp)]diff --git a/tests/_server/mocks.py b/tests/_server/mocks.pyindex 4258f6c02f..4d7496856b 100644--- a/tests/_server/mocks.py+++ b/tests/_server/mocks.py@@ -56,6 +56,7 @@ if __name__ == "__main__":lsp_server=lsp_server,config_manager=get_default_config_manager(current_path=None),cli_args={},+ argv=None,auth_token=AuthToken("fake-token"),redirect_console_to_browser=False,ttl_seconds=None,diff --git a/tests/_server/test_session_manager.py b/tests/_server/test_session_manager.pyindex 18d818e1a3..bac4785f51 100644--- a/tests/_server/test_session_manager.py+++ b/tests/_server/test_session_manager.py@@ -49,6 +49,7 @@ def session_manager():lsp_server=MagicMock(spec=LspServer),config_manager=get_default_config_manager(current_path=None),cli_args={},+ argv=None,auth_token=None,redirect_console_to_browser=False,ttl_seconds=None,diff --git a/tests/_server/test_sessions.py b/tests/_server/test_sessions.pyindex c2fe4377e1..6887c25101 100644--- a/tests/_server/test_sessions.py+++ b/tests/_server/test_sessions.py@@ -48,7 +48,10 @@ initialize_asyncio()F = TypeVar("F", bound=Callable[..., Any])app_metadata = AppMetadata(- query_params={"some_param": "some_value"}, filename="test.py", cli_args={}+ query_params={"some_param": "some_value"},+ filename="test.py",+ cli_args={},+ argv=None,)@@ -317,7 +320,7 @@ def test_session_disconnect_reconnect() -> None:queue_manager,SessionMode.RUN,{},- AppMetadata(query_params={}, cli_args={}),+ AppMetadata(query_params={}, cli_args={}, argv=None),get_default_config_manager(current_path=None),virtual_files_supported=True,redirect_console_to_browser=False,@@ -471,6 +474,7 @@ def __():}),cli_args={},+ argv=None,auth_token=None,redirect_console_to_browser=False,ttl_seconds=None,@@ -627,6 +631,7 @@ def test_watch_mode_config_override() -> None:lsp_server=MagicMock(),config_manager=config_reader_watch,cli_args={},+ argv=None,auth_token=None,redirect_console_to_browser=False,ttl_seconds=None,@@ -642,6 +647,7 @@ def test_watch_mode_config_override() -> None:lsp_server=MagicMock(),config_manager=config_reader,cli_args={},+ argv=None,auth_token=None,redirect_console_to_browser=False,ttl_seconds=None,@@ -709,6 +715,7 @@ def __():lsp_server=MagicMock(),config_manager=config_reader_autorun,cli_args={},+ argv=None,auth_token=None,redirect_console_to_browser=False,ttl_seconds=None,@@ -856,6 +863,7 @@ def __():lsp_server=MagicMock(),config_manager=get_default_config_manager(current_path=None),cli_args={},+ argv=None,auth_token=None,redirect_console_to_browser=False,ttl_seconds=None,diff --git a/tests/conftest.py b/tests/conftest.pyindex 42ccd62f51..e009cfdefb 100644--- a/tests/conftest.py+++ b/tests/conftest.py@@ -163,7 +163,10 @@ class MockedKernel:cell_configs={},user_config=DEFAULT_CONFIG,app_metadata=AppMetadata(- query_params={}, filename=None, cli_args={}+ query_params={},+ filename=None,+ cli_args={},+ argv=None,),debugger_override=MarimoPdb(stdout=self.stdout, stdin=self.stdin),enqueue_control_request=lambda _: None,