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
Force asyncio in edit mode (#2442)
Akshay Agrawalea0331faff1c
diff --git a/marimo/_server/start.py b/marimo/_server/start.pyindex 78261e814f..28abe060a7 100644--- a/marimo/_server/start.py+++ b/marimo/_server/start.py@@ -168,6 +168,11 @@ def start(# close the websocket if we don't receive a pong after 60 secondsws_ping_timeout=60,timeout_graceful_shutdown=1,+ # Under uvloop, reading the socket we monitor under add_reader()+ # occasionally throws BlockingIOError (errno 11, or errno 35,+ # ...). RUN mode no longer uses a socket (it has no IPC) but EDIT+ # does, so force asyncio.+ loop="asyncio" if mode == SessionMode.EDIT else "auto",))app.state.server = serverdiff --git a/tests/_convert/test_convert_utils.py b/tests/_convert/test_convert_utils.pyindex fbbad06089..f2a6e1eafb 100644--- a/tests/_convert/test_convert_utils.py+++ b/tests/_convert/test_convert_utils.py@@ -1,5 +1,6 @@from __future__ import annotations+import refrom textwrap import dedentfrom marimo._convert import utils@@ -25,12 +26,13 @@ def test_generate_from_sources():# Test with basic sourcessources = ["print('Hello')", "x = 5"]result = utils.generate_from_sources(sources)+ result = re.sub(r"__generated_with = .*", "", result)assert result == dedent("""import marimo-__generated_with = "0.8.20"+app = marimo.App()