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
do not prompt for overwrite when exporting wasm to an empty directory (#8591)
Michael Chavindab9cb2c912ff4
diff --git a/marimo/_cli/export/commands.py b/marimo/_cli/export/commands.pyindex df9128a11f..54d3868d74 100644--- a/marimo/_cli/export/commands.py+++ b/marimo/_cli/export/commands.py@@ -885,12 +885,10 @@ def html_wasm(out_dir = outputfilename = "index.html"- ignore_index_html = False# If ends with .html, get the directoryif output.suffix == ".html":out_dir = output.parentfilename = output.name- ignore_index_html = Truemarimo_file = MarimoPath(name)@@ -898,7 +896,7 @@ def html_wasm(return export_as_wasm(file_path, mode, show_code=show_code)# Export assets first- Exporter().export_assets(out_dir, ignore_index_html=ignore_index_html)+ Exporter().export_assets(out_dir)# Create .nojekyll file to prevent GitHub Pages from interfering with asset# resolutiondiff --git a/marimo/_server/export/exporter.py b/marimo/_server/export/exporter.pyindex 9f51da679d..cbf3804763 100644--- a/marimo/_server/export/exporter.py+++ b/marimo/_server/export/exporter.py@@ -555,9 +555,7 @@ class Exporter:return Nonereturn pdf_data- def export_assets(- self, directory: Path, ignore_index_html: bool = False- ) -> None:+ def export_assets(self, directory: Path) -> None:# Copy assets to the same directory as the notebookdirpath = Path(directory)LOGGER.debug(f"Copying assets to {dirpath}")@@ -570,11 +568,7 @@ class Exporter:ROOT,dirpath,dirs_exist_ok=True,- ignore=(- shutil.ignore_patterns("index.html")- if ignore_index_html- else None- ),+ ignore=(shutil.ignore_patterns("index.html")),)def export_public_folder(diff --git a/tests/_cli/test_cli_export.py b/tests/_cli/test_cli_export.pyindex c2278110e1..5c4edbfad2 100644--- a/tests/_cli/test_cli_export.py+++ b/tests/_cli/test_cli_export.py@@ -107,6 +107,7 @@ class TestExportHTML:)_assert_success(p)html = Path(out_dir / "index.html").read_text()+ assert "{ filename }" not in htmlassert '"mode": "edit"' in htmlassert '<marimo-code hidden=""></marimo-code>' not in htmlassert "<marimo-wasm" in html