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.

smoke test: ipython display (#3368)

Myles Scolnick7c045525f8d5
diff --git a/marimo/_smoke_tests/compat/ipython_display.py b/marimo/_smoke_tests/compat/ipython_display.py
new file mode 100644
index 0000000000..3267f4be30
--- /dev/null
+++ b/marimo/_smoke_tests/compat/ipython_display.py
@@ -0,0 +1,46 @@
+# /// script
+# requires-python = ">=3.12"
+# dependencies = [
+# "ipython==8.31.0",
+# ]
+# ///
+
+import marimo
+
+__generated_with = "0.10.9"
+app = marimo.App(width="medium")
+
+
+def _():
+ from IPython.display import SVG, Markdown, display
+ return Markdown, SVG, display
+
+
+def _(SVG):
+ svg = SVG(
+ '<svg height="100" width="100"><circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" /></svg>'
+ )
+ svg
+ return (svg,)
+
+
+def _(Markdown):
+ markdown = Markdown(
+ "## This is a Markdown Example\nHere is a list:\n- Item 1\n- Item 2\n- Item 3"
+ )
+ markdown
+ return (markdown,)
+
+
+def _(display, markdown, svg):
+ display(markdown)
+ display(svg) # does not work, not sure why
+ return
+
+
+if __name__ == "__main__":
+ app.run()