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.

Revert "improvement: remove base-url from index.html, instead infer it (#2969)"

Myles Scolnick5fc55409d6f7
diff --git a/frontend/index.html b/frontend/index.html
index 03261295ec..c59c69bfe7 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
+ <base href='{{ base_url }}/' />
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
<!-- Preload is necessary because we show these images when we disconnect from the server,
diff --git a/tests/_cli/test_cli_export.py b/tests/_cli/test_cli_export.py
index ac546fa26a..cb88f1ce40 100644
--- a/tests/_cli/test_cli_export.py
+++ b/tests/_cli/test_cli_export.py
@@ -442,12 +442,10 @@ class TestExportMarkdown:
class TestExportIpynb:
- # @pytest.mark.skipif(
- # not DependencyManager.nbformat.has(),
- # reason="This test requires nbformat.",
- # )
- # Flaky on CI
- @pytest.mark.skip
+ @pytest.mark.skipif(
+ not DependencyManager.nbformat.has(),
+ reason="This test requires nbformat.",
+ )
def test_export_ipynb(self, temp_marimo_file_with_md: str) -> None:
p = subprocess.run(
["marimo", "export", "ipynb", temp_marimo_file_with_md],
diff --git a/tests/_server/templates/data/index.html b/tests/_server/templates/data/index.html
index cfdff9ba2f..fd94e42184 100644
--- a/tests/_server/templates/data/index.html
+++ b/tests/_server/templates/data/index.html
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
+ <base href='{{ base_url }}/' />
<meta charset="utf-8" />
<link rel="icon" href="./favicon.ico" />
<!-- Preload is necessary because we show these images when we disconnect from the server,
diff --git a/tests/_server/templates/snapshots/export1.txt b/tests/_server/templates/snapshots/export1.txt
index faf2a20115..6e7b1a0ff6 100644
--- a/tests/_server/templates/snapshots/export1.txt
+++ b/tests/_server/templates/snapshots/export1.txt
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
+ <base href='/' />
<meta charset="utf-8" />
<link rel="icon" crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/@marimo-team/[email protected]/dist/favicon.ico" />
<!-- Preload is necessary because we show these images when we disconnect from the server,
diff --git a/tests/_server/templates/snapshots/export2.txt b/tests/_server/templates/snapshots/export2.txt
index 576adef7cd..9d8fceac5f 100644
--- a/tests/_server/templates/snapshots/export2.txt
+++ b/tests/_server/templates/snapshots/export2.txt
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
+ <base href='/' />
<meta charset="utf-8" />
<link rel="icon" crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/@marimo-team/[email protected]/dist/favicon.ico" />
<!-- Preload is necessary because we show these images when we disconnect from the server,
diff --git a/tests/_server/templates/snapshots/export3.txt b/tests/_server/templates/snapshots/export3.txt
index 05eb973035..692614b750 100644
--- a/tests/_server/templates/snapshots/export3.txt
+++ b/tests/_server/templates/snapshots/export3.txt
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
+ <base href='/' />
<meta charset="utf-8" />
<link rel="icon" crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/@marimo-team/[email protected]/dist/favicon.ico" />
<!-- Preload is necessary because we show these images when we disconnect from the server,
diff --git a/tests/_server/templates/snapshots/export4.txt b/tests/_server/templates/snapshots/export4.txt
index 773548f879..429b38da17 100644
--- a/tests/_server/templates/snapshots/export4.txt
+++ b/tests/_server/templates/snapshots/export4.txt
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
+ <base href='/' />
<meta charset="utf-8" />
<link rel="icon" crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/@marimo-team/[email protected]/dist/favicon.ico" />
<!-- Preload is necessary because we show these images when we disconnect from the server,
diff --git a/tests/_server/templates/snapshots/export5.txt b/tests/_server/templates/snapshots/export5.txt
index bcd2a29e37..359306edd4 100644
--- a/tests/_server/templates/snapshots/export5.txt
+++ b/tests/_server/templates/snapshots/export5.txt
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
+ <base href='/' />
<meta charset="utf-8" />
<link rel="icon" crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/@marimo-team/[email protected]/dist/favicon.ico" />
<!-- Preload is necessary because we show these images when we disconnect from the server,
diff --git a/tests/_server/templates/test_templates.py b/tests/_server/templates/test_templates.py
index 95ddf10da2..0b700e178c 100644
--- a/tests/_server/templates/test_templates.py
+++ b/tests/_server/templates/test_templates.py
@@ -45,7 +45,7 @@ class TestNotebookPageTemplate(unittest.TestCase):
self.mode,
)
- assert self.base_url not in result
+ assert self.base_url in result
assert str(self.server_token) in result
assert self.filename in result
assert "read" in result
@@ -61,7 +61,7 @@ class TestNotebookPageTemplate(unittest.TestCase):
self.mode,
)
- assert self.base_url not in result
+ assert self.base_url in result
assert str(self.server_token) in result
assert "<title>marimo</title>" in result
assert "read" in result
@@ -77,7 +77,7 @@ class TestNotebookPageTemplate(unittest.TestCase):
SessionMode.EDIT,
)
- assert self.base_url not in result
+ assert self.base_url in result
assert str(self.server_token) in result
assert self.filename in result
assert "edit" in result
@@ -160,7 +160,7 @@ class TestHomePageTemplate(unittest.TestCase):
self.server_token,
)
- assert self.base_url not in result
+ assert self.base_url in result
assert str(self.server_token) in result
assert json.dumps(self.user_config) in result
assert "marimo" in result