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.

fix: include index.html in marimo-base for html export (#2781)

Myles Scolnick74397c4fe08c
diff --git a/.github/workflows/dev-release.yml b/.github/workflows/dev-release.yml
index 0ecc2a79de..de2a3d8f66 100644
--- a/.github/workflows/dev-release.yml
+++ b/.github/workflows/dev-release.yml
@@ -68,7 +68,10 @@ jobs:
sed -i "s/__version__ = \".*\"/__version__ = \"$MARIMO_VERSION\"/" marimo/__init__.py
- name: 📦 Build marimo
- run: hatch build
+ run: hatch build --clean
+
+ - name: 📦 Validate wheel under 2mb
+ run: ./scripts/validate_base_wheel_size.sh
- name: 📤 Upload to TestPyPI
env:
diff --git a/.github/workflows/marimo-bot.yml b/.github/workflows/marimo-bot.yml
index 89962607e9..80a539756e 100644
--- a/.github/workflows/marimo-bot.yml
+++ b/.github/workflows/marimo-bot.yml
@@ -83,7 +83,10 @@ jobs:
sed -i "s/__version__ = \".*\"/__version__ = \"$MARIMO_VERSION\"/" marimo/__init__.py
- name: 📦 Build marimo
- run: hatch build
+ run: hatch build --clean
+
+ - name: 📦 Validate wheel under 2mb
+ run: ./scripts/validate_base_wheel_size.sh
- name: 📤 Upload to TestPyPI
env:
diff --git a/.github/workflows/release-marimo-base.yml b/.github/workflows/release-marimo-base.yml
index 828b2b5919..edb30d7ec7 100644
--- a/.github/workflows/release-marimo-base.yml
+++ b/.github/workflows/release-marimo-base.yml
@@ -35,7 +35,10 @@ jobs:
run: ./scripts/modify_pyproject_for_marimo_base.sh
- name: 📦 Build marimo-base
- run: hatch build
+ run: hatch build --clean
+
+ - name: 📦 Validate wheel under 2mb
+ run: ./scripts/validate_base_wheel_size.sh
- name: 📤 Upload to PyPI
env:
diff --git a/scripts/modify_pyproject_for_marimo_base.sh b/scripts/modify_pyproject_for_marimo_base.sh
index 53541de8b3..18df539530 100755
--- a/scripts/modify_pyproject_for_marimo_base.sh
+++ b/scripts/modify_pyproject_for_marimo_base.sh
@@ -4,11 +4,11 @@
# per Python project. This modifies the pyproject.toml
# to build marimo-base, a slimmed down marimo distribution with
# no static artifacts.
-#
+#
# Adapted from https://github.com/cvxpy/cvxpy/blob/297278e2a88db3c0084750052a16e60672074da3/.github/workflows/build.yml#L169C1-L180C1
#
# Mac has a different syntax for sed -i, this works across oses
sed -i.bak -e 's/name = "marimo"/name = "marimo-base"/g' pyproject.toml
-# Remove static artifacts
-sed -i.bak '/artifacts = /d' pyproject.toml
+# Replace static artifacts with just index.html
+sed -i.bak 's/artifacts = \[.*\]/artifacts = ["marimo\/_static\/index.html"]/' pyproject.toml
rm -rf pyproject.toml.bak
diff --git a/scripts/validate_base_wheel_size.sh b/scripts/validate_base_wheel_size.sh
new file mode 100755
index 0000000000..cfb2b09d01
--- /dev/null
+++ b/scripts/validate_base_wheel_size.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+wheel_file=$(ls dist/*.whl)
+if [[ "$OSTYPE" == "darwin"* ]]; then
+ # macOS
+ size=$(stat -f%z "$wheel_file")
+else
+ # Linux
+ size=$(stat -c%s "$wheel_file")
+fi
+
+if [ $size -gt 2097152 ]; then
+ echo "Wheel file is larger than 2mb"
+ exit 1
+fi
+
+echo "Wheel file is $size bytes"