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.

chore: move marimo-base logic into bash script (#2606)

Akshay Agrawal9511312fcef3
diff --git a/.github/workflows/dev-release.yml b/.github/workflows/dev-release.yml
index a5ca035415..0ecc2a79de 100644
--- a/.github/workflows/dev-release.yml
+++ b/.github/workflows/dev-release.yml
@@ -48,19 +48,8 @@ jobs:
- name: 🥚 Install Hatch
uses: pypa/hatch@install
- # Python build tools generally only allow building one project
- # 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
- name: Adapt pyproject.toml to build marimo-base
- run: |
- # 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
- rm -rf pyproject.toml.bak
+ run: ./scripts/modify_pyproject_for_marimo_base.sh
# patch __init__.py version to be of the form
# X.Y.<Z+1>-dev{n-commits-since-last-tag}
diff --git a/.github/workflows/marimo-bot.yml b/.github/workflows/marimo-bot.yml
index ea61cbd2d0..5b68bd2255 100644
--- a/.github/workflows/marimo-bot.yml
+++ b/.github/workflows/marimo-bot.yml
@@ -62,19 +62,8 @@ jobs:
- name: 🥚 Install Hatch
uses: pypa/hatch@install
- # Python build tools generally only allow building one project
- # 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
- name: Adapt pyproject.toml to build marimo-base
- run: |
- # 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
- rm -rf pyproject.toml.bak
+ run: ./scripts/modify_pyproject_for_marimo_base.sh
# patch __init__.py version to be of the form
# X.Y.Z-dev9{4random digits}
diff --git a/.github/workflows/release-marimo-base.yml b/.github/workflows/release-marimo-base.yml
index 7dda76bfeb..828b2b5919 100644
--- a/.github/workflows/release-marimo-base.yml
+++ b/.github/workflows/release-marimo-base.yml
@@ -31,19 +31,8 @@ jobs:
- name: 🥚 Install Hatch
uses: pypa/hatch@install
- # Python build tools generally only allow building one project
- # 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
- name: Adapt pyproject.toml to build marimo-base
- run: |
- # 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
- rm -rf pyproject.toml.bak
+ run: ./scripts/modify_pyproject_for_marimo_base.sh
- name: 📦 Build marimo-base
run: hatch build
diff --git a/scripts/modify_pyproject_for_marimo_base.sh b/scripts/modify_pyproject_for_marimo_base.sh
new file mode 100755
index 0000000000..53541de8b3
--- /dev/null
+++ b/scripts/modify_pyproject_for_marimo_base.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Python build tools generally only allow building one project
+# 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
+rm -rf pyproject.toml.bak