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
ci: fix npm publish with --tag, reusable frontend build (#7714)
Myles Scolnick073039e1afef
diff --git a/.github/actions/build-frontend/action.yaml b/.github/actions/build-frontend/action.yamlnew file mode 100644index 0000000000..54b71750e3--- /dev/null+++ b/.github/actions/build-frontend/action.yaml@@ -0,0 +1,36 @@+name: Build Frontend+description: Setup pnpm, Node.js, and build the frontend++inputs:+ node-version:+ description: 'Node.js version to use'+ required: false+ default: '22'+ turbo-token:+ description: 'Turbo token for caching'+ required: false+ codecov-token:+ description: 'Codecov token'+ required: false++runs:+ using: 'composite'++ steps:+ - name: ⎔ Setup pnpm+ uses: pnpm/action-setup@v4++ - name: ⎔ Setup Node.js+ uses: actions/setup-node@v4+ with:+ node-version: ${{ inputs.node-version }}+ cache: pnpm+ cache-dependency-path: '**/pnpm-lock.yaml'++ - name: 📦 Build frontend+ shell: bash+ run: make fe+ env:+ TURBO_TOKEN: ${{ inputs.turbo-token }}+ TURBO_TEAM: marimo+ CODECOV_TOKEN: ${{ inputs.codecov-token }}diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.ymlindex 1d16f02198..9dbd57a216 100644--- a/.github/workflows/cla.yml+++ b/.github/workflows/cla.yml@@ -5,6 +5,10 @@ on:pull_request_target:types: [opened, closed, synchronize]+concurrency:+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.issue.number }}+ cancel-in-progress: false # Don't cancel CLA checks+# explicitly configure permissions, in case your GITHUB_TOKEN workflow permissions are set to read-only in repository settingspermissions:actions: writediff --git a/.github/workflows/dev-release.yml b/.github/workflows/dev-release.ymlindex 129129b252..6cd01d8aa6 100644--- a/.github/workflows/dev-release.yml+++ b/.github/workflows/dev-release.yml@@ -6,13 +6,15 @@ on:branches:- main+concurrency:+ group: ${{ github.workflow }}-${{ github.ref }}+ cancel-in-progress: true+permissions:contents: readpull-requests: write- id-token: write # Required for OIDCenv:- TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}TURBO_TEAM: marimojobs:@@ -27,27 +29,17 @@ jobs:marimo_version: ${{ steps.get_version.outputs.marimo_version }}steps:- - name: 🛑 Cancel Previous Runs- uses: styfle/[email protected]-- name: ⬇️ Checkout repouses: actions/checkout@v4with:# get tag history for version numberfetch-depth: 0- - uses: pnpm/action-setup@v4- - name: ⎔ Setup Node.js- uses: actions/setup-node@v4- with:- node-version: 22- cache: 'pnpm'- cache-dependency-path: '**/pnpm-lock.yaml'-- name: 📦 Build frontend- run: make fe- env:- CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}+ uses: ./.github/actions/build-frontend+ with:+ turbo-token: ${{ secrets.TURBO_TOKEN }}+ codecov-token: ${{ secrets.CODECOV_TOKEN }}- name: Install uvuses: astral-sh/setup-uv@v7@@ -141,8 +133,9 @@ jobs:with:package-artifact-name: frontend-devworking-directory: '.'+ npm-tag: 'dev'permissions:- id-token: write+ id-token: write # Required for OIDCcontents: readpublish_islands_dev:@@ -152,8 +145,9 @@ jobs:with:package-artifact-name: frontend-islands-devworking-directory: '.'+ npm-tag: 'dev'permissions:- id-token: write+ id-token: write # Required for OIDCcontents: readcomment_pr:@@ -169,6 +163,7 @@ jobs:with:script: |try {+ const marimoVersion = process.env.MARIMO_VERSION || 'unknown';const pullRequest = await github.rest.search.issuesAndPullRequests({q: `sha:${context.sha} is:pr is:merged`});@@ -178,7 +173,7 @@ jobs:owner: context.repo.owner,repo: context.repo.repo,issue_number: pullRequest.data.items[0].number,- body: `🚀 Development release published. You may be able to view the changes at https://marimo.app?v=${process.env.MARIMO_VERSION}`+ body: `🚀 Development release published. You may be able to view the changes at https://marimo.app?v=${encodeURIComponent(marimoVersion)}`});} else {console.log("No merged PR found for this SHA.");diff --git a/.github/workflows/discord-release.yml b/.github/workflows/discord-release.ymlindex fcde3c5ad9..a815246b0f 100644--- a/.github/workflows/discord-release.yml+++ b/.github/workflows/discord-release.yml@@ -4,6 +4,10 @@ on:release:types: [published]+concurrency:+ group: ${{ github.workflow }}-${{ github.event.release.id }}+ cancel-in-progress: false # Don't cancel release notifications+permissions:contents: readdiff --git a/.github/workflows/docs.yml b/.github/workflows/docs.ymlindex 123cba1cb0..216c3059a4 100644--- a/.github/workflows/docs.yml+++ b/.github/workflows/docs.yml@@ -7,13 +7,13 @@ on:# Deploy on workflow dispatchworkflow_dispatch: {}+concurrency:+ group: ${{ github.workflow }}-${{ github.ref }}+ cancel-in-progress: true+permissions:contents: read-env:- VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}- VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}-jobs:deploy:runs-on: ubuntu-latest@@ -32,9 +32,15 @@ jobs:- name: ⬇️ Pull Vercel Environment Informationrun: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}+ env:+ VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}+ VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}- name: 📚 Build docsrun: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}+ env:+ VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}+ VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}- name: 📚 llms.txt# This is technically off by 1 commit, but generating the llms.txt file is easiest from a@@ -50,3 +56,6 @@ jobs:- name: 🚀 Deploy to Vercelif: github.ref == 'refs/heads/main'run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}+ env:+ VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}+ VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.ymlindex 3321227381..5575d773cd 100644--- a/.github/workflows/labeler.yml+++ b/.github/workflows/labeler.yml@@ -9,6 +9,10 @@ on:pull_request:types: [labeled, unlabeled, opened, reopened, edited, synchronize]+concurrency:+ group: ${{ github.workflow }}-${{ github.event.pull_request.number }}+ cancel-in-progress: true+permissions:contents: readpull-requests: writediff --git a/.github/workflows/marimo-bot.yml b/.github/workflows/marimo-bot.ymlindex 03cdf32c8c..dd52d8af84 100644--- a/.github/workflows/marimo-bot.yml+++ b/.github/workflows/marimo-bot.yml@@ -4,10 +4,13 @@ on:issue_comment:types: [created]+concurrency:+ group: ${{ github.workflow }}-${{ github.event.issue.number }}+ cancel-in-progress: true+permissions:contents: readpull-requests: write- id-token: write # Required for OIDCenv:TURBO_TEAM: marimo@@ -37,9 +40,6 @@ jobs:comment_id: ${{ steps.comment.outputs.result }}steps:- - name: 🛑 Cancel Previous Runs- uses: styfle/[email protected]-- name: 📝 Get PR Infoid: prenv:@@ -80,19 +80,10 @@ jobs:console.log(`Comment created with ID: ${comment.data.id}`);return comment.data.id;- - uses: pnpm/action-setup@v4-- - name: ⎔ Setup Node.js- uses: actions/setup-node@v4- with:- node-version: 22- cache: 'pnpm'- cache-dependency-path: '**/pnpm-lock.yaml'-- name: 📦 Build frontend- run: make fe- env:- TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}+ uses: ./.github/actions/build-frontend+ with:+ turbo-token: ${{ secrets.TURBO_TOKEN }}- name: Install uvuses: astral-sh/setup-uv@v7@@ -152,8 +143,9 @@ jobs:with:package-artifact-name: frontend-test-branchworking-directory: '.'+ npm-tag: 'dev'permissions:- id-token: write+ id-token: write # Required for OIDCcontents: readupdate_pr_comment:@@ -171,16 +163,18 @@ jobs:continue-on-error: trueenv:MARIMO_VERSION: ${{ needs.create-test-release.outputs.marimo_version }}+ COMMENT_ID: ${{ needs.create-test-release.outputs.comment_id }}with:script: |try {- const commentId = ${{ needs.create-test-release.outputs.comment_id }}+ const commentId = parseInt(process.env.COMMENT_ID, 10);+ const marimoVersion = process.env.MARIMO_VERSION || 'unknown';console.log(`Updating comment with ID: ${commentId}`);await github.rest.issues.updateComment({owner: context.repo.owner,repo: context.repo.repo,comment_id: commentId,- body: `🚀 Test release published. You may be able to view the changes at https://marimo.app?v=${process.env.MARIMO_VERSION}`+ body: `🚀 Test release published. You may be able to view the changes at https://marimo.app?v=${encodeURIComponent(marimoVersion)}`});} catch (err) {console.error(err);@@ -190,10 +184,12 @@ jobs:if: needs.create-test-release.result == 'failure' || needs.publish_wasm_test.result == 'failure'uses: actions/github-script@v7continue-on-error: true+ env:+ COMMENT_ID: ${{ needs.create-test-release.outputs.comment_id }}with:script: |try {- const commentId = ${{ needs.create-test-release.outputs.comment_id }}+ const commentId = parseInt(process.env.COMMENT_ID, 10);console.log(`Updating comment with ID: ${commentId}`);await github.rest.issues.updateComment({owner: context.repo.owner,diff --git a/.github/workflows/notify-readme-owners.yml b/.github/workflows/notify-readme-owners.ymlindex 7f7aef0d06..a9b43c48b4 100644--- a/.github/workflows/notify-readme-owners.yml+++ b/.github/workflows/notify-readme-owners.yml@@ -5,6 +5,10 @@ on:paths:- 'README.md'+concurrency:+ group: ${{ github.workflow }}-${{ github.event.pull_request.number }}+ cancel-in-progress: true+permissions:contents: readpull-requests: writediff --git a/.github/workflows/pages.yml b/.github/workflows/pages.ymlindex e742164536..0b1d140716 100644--- a/.github/workflows/pages.yml+++ b/.github/workflows/pages.yml@@ -8,6 +8,10 @@ on:# Allow manual triggerworkflow_dispatch: {}+concurrency:+ group: ${{ github.workflow }}-${{ github.ref }}+ cancel-in-progress: true+env:UV_SYSTEM_PYTHON: 1diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.ymlindex 828838b24d..3b35e5c6fb 100644--- a/.github/workflows/playwright.yml+++ b/.github/workflows/playwright.yml@@ -5,6 +5,10 @@ on:branches: [main]pull_request:+concurrency:+ group: ${{ github.workflow }}-${{ github.ref }}+ cancel-in-progress: true+permissions:contents: read@@ -39,9 +43,6 @@ jobs:DEBUG: "pw:webserver"steps:- - name: 🛑 Cancel Previous Runs- uses: styfle/[email protected]-- name: ⬇️ Checkout repouses: actions/checkout@v4- name: Write TOML@@ -56,21 +57,11 @@ jobs:run: |sed -i 's/auto_instantiate = false/auto_instantiate = true/' pyproject.toml- - uses: pnpm/action-setup@v4-- - name: ⎔ Setup Node.js- uses: actions/setup-node@v4- with:- node-version: 22- cache: "pnpm"- cache-dependency-path: "**/pnpm-lock.yaml"-- name: 📦 Build frontend- run: make fe- env:- TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}- TURBO_TEAM: marimo- CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}+ uses: ./.github/actions/build-frontend+ with:+ turbo-token: ${{ secrets.TURBO_TOKEN }}+ codecov-token: ${{ secrets.CODECOV_TOKEN }}- name: 🐍 Setup uvuses: astral-sh/setup-uv@v7diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.ymlindex 7579a1b0b0..23b205d624 100644--- a/.github/workflows/publish-npm.yml+++ b/.github/workflows/publish-npm.yml@@ -12,6 +12,11 @@ on:type: stringdefault: '.'description: 'Directory within the artifact to publish from'+ npm-tag:+ required: false+ type: string+ default: ''+ description: 'npm tag to use when publishing (e.g., "dev", "next"). Leave empty for default (latest)'jobs:publish:@@ -38,8 +43,13 @@ jobs:- name: 📤 Publish to npmworking-directory: ${{ inputs.working-directory }}run: |+ TAG_FLAG=""+ if [ -n "${{ inputs.npm-tag }}" ]; then+ TAG_FLAG="--tag ${{ inputs.npm-tag }}"+ fi+for i in {1..3}; do- npm publish --access public --provenance && break || {+ npm publish --access public --provenance $TAG_FLAG && break || {echo "Publish attempt $i failed, retrying..."sleep 10}diff --git a/.github/workflows/release-marimo-base.yml b/.github/workflows/release-marimo-base.ymlindex 335a0272ce..41d1854a4d 100644--- a/.github/workflows/release-marimo-base.yml+++ b/.github/workflows/release-marimo-base.yml@@ -7,11 +7,14 @@ on:- "[0-9]+.[0-9]+.[0-9]+"workflow_dispatch: {}+concurrency:+ group: ${{ github.workflow }}-${{ github.ref }}+ cancel-in-progress: true+permissions:contents: readenv:- TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}TURBO_TEAM: marimoREGISTRY: ghcr.ioIMAGE_NAME: marimo-team/marimo@@ -25,24 +28,14 @@ jobs:shell: bashsteps:- - name: 🛑 Cancel Previous Runs- uses: styfle/[email protected]-- name: ⬇️ Checkout repouses: actions/checkout@v4- - uses: pnpm/action-setup@v4- - name: ⎔ Setup Node.js- uses: actions/setup-node@v4- with:- node-version: 22- cache: "pnpm"- cache-dependency-path: "**/pnpm-lock.yaml"-- name: 📦 Build frontend- run: make fe- env:- CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}+ uses: ./.github/actions/build-frontend+ with:+ turbo-token: ${{ secrets.TURBO_TOKEN }}+ codecov-token: ${{ secrets.CODECOV_TOKEN }}- name: Install uvuses: astral-sh/setup-uv@v7diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex a14eb7bffb..8c23940102 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -7,12 +7,14 @@ on:- '[0-9]+.[0-9]+.[0-9]+'workflow_dispatch: {}+concurrency:+ group: ${{ github.workflow }}-${{ github.ref }}+ cancel-in-progress: true+permissions:contents: read- id-token: write # Required for OIDCenv:- TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}TURBO_TEAM: marimoREGISTRY: ghcr.ioIMAGE_NAME: marimo-team/marimo@@ -29,25 +31,14 @@ jobs:marimo_version: ${{ steps.get_version.outputs.marimo_version }}steps:- - name: 🛑 Cancel Previous Runs- uses: styfle/[email protected]-- name: ⬇️ Checkout repouses: actions/checkout@v4- - uses: pnpm/action-setup@v4-- - name: ⎔ Setup Node.js- uses: actions/setup-node@v4- with:- node-version: 22- cache: 'pnpm'- cache-dependency-path: '**/pnpm-lock.yaml'-- name: 📦 Build frontend- run: make fe- env:- CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}+ uses: ./.github/actions/build-frontend+ with:+ turbo-token: ${{ secrets.TURBO_TOKEN }}+ codecov-token: ${{ secrets.CODECOV_TOKEN }}- name: 🥚 Install Hatchuses: pypa/hatch@install@@ -109,7 +100,7 @@ jobs:package-artifact-name: frontendworking-directory: '.'permissions:- id-token: write+ id-token: write # Required for OIDCcontents: readpublish_islands:@@ -120,7 +111,7 @@ jobs:package-artifact-name: frontend-islandsworking-directory: '.'permissions:- id-token: write+ id-token: write # Required for OIDCcontents: readpublish_docker:@@ -134,9 +125,6 @@ jobs:packages: writesteps:- - name: 🛑 Cancel Previous Runs- uses: styfle/[email protected]-- name: ⬇️ Checkout repouses: actions/checkout@v4diff --git a/.github/workflows/test_be.yaml b/.github/workflows/test_be.yamlindex bafbb2bfbc..a98efcfb6f 100644--- a/.github/workflows/test_be.yaml+++ b/.github/workflows/test_be.yaml@@ -5,6 +5,10 @@ on:branches: [main]pull_request:+concurrency:+ group: ${{ github.workflow }}-${{ github.ref }}+ cancel-in-progress: true+permissions:contents: readpull-requests: write@@ -37,9 +41,6 @@ jobs:name: Test docsruns-on: ubuntu-lateststeps:- - name: 🛑 Cancel Previous Runs- uses: styfle/[email protected]-- name: ⬇️ Checkout repouses: actions/checkout@v4@@ -64,9 +65,6 @@ jobs:name: Test lint and typecheckruns-on: ubuntu-lateststeps:- - name: 🛑 Cancel Previous Runs- uses: styfle/[email protected]-- name: ⬇️ Checkout repouses: actions/checkout@v4@@ -144,9 +142,6 @@ jobs:dependencies: "core,optional"# TODO: Add in 3.14 optional once there is broader wheel supportsteps:- - name: 🛑 Cancel Previous Runs- uses: styfle/[email protected]-- uses: actions/checkout@v4with:fetch-depth: 0 # Fetch all history for git diff@@ -237,9 +232,6 @@ jobs:runs-on: ubuntu-latesttimeout-minutes: 25steps:- - name: 🛑 Cancel Previous Runs- uses: styfle/[email protected]-- uses: actions/checkout@v4- name: 🥚 Install Hatchdiff --git a/.github/workflows/test_cli.yaml b/.github/workflows/test_cli.yamlindex 72e5c4be89..90034510a7 100644--- a/.github/workflows/test_cli.yaml+++ b/.github/workflows/test_cli.yaml@@ -5,6 +5,10 @@ on:branches: [main]pull_request:+concurrency:+ group: ${{ github.workflow }}-${{ github.ref }}+ cancel-in-progress: true+permissions:contents: read@@ -38,27 +42,16 @@ jobs:shell: bashsteps:- - name: 🛑 Cancel Previous Runs- uses: styfle/[email protected]-- name: ⬇️ Checkout repouses: actions/checkout@v4with:fetch-depth: 0 # so we can run --since on the main branch and turbo can do faster cache hashing- - uses: pnpm/action-setup@v4-- - name: ⎔ Setup Node.js- uses: actions/setup-node@v4- with:- node-version: 22- cache: "pnpm"- cache-dependency-path: "**/pnpm-lock.yaml"-- name: 📦 Build frontend- run: make fe- env:- CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}+ uses: ./.github/actions/build-frontend+ with:+ turbo-token: ${{ secrets.TURBO_TOKEN }}+ codecov-token: ${{ secrets.CODECOV_TOKEN }}- name: 🥚 Install Hatchuses: pypa/hatch@install@@ -145,8 +138,6 @@ jobs:timeout-minutes: 3 # 2024-01-18 avg: 0.3m max: 0.5msteps:- - name: 🛑 Cancel Previous Runs- uses: styfle/[email protected]- uses: actions/checkout@v4- name: 🐍 Setup uvdiff --git a/.github/workflows/test_fe.yaml b/.github/workflows/test_fe.yamlindex 2906b15cfd..997e00c3fc 100644--- a/.github/workflows/test_fe.yaml+++ b/.github/workflows/test_fe.yaml@@ -1,13 +1,18 @@name: Test FE-permissions:- contents: read- pull-requests: writeon:push:branches: [main]pull_request:+concurrency:+ group: ${{ github.workflow }}-${{ github.ref }}+ cancel-in-progress: true++permissions:+ contents: read+ pull-requests: write+env:TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}TURBO_TEAM: marimo@@ -87,9 +92,6 @@ jobs:shell: bashsteps:- - name: 🛑 Cancel Previous Runs- uses: styfle/[email protected]-- name: ⬇️ Checkout repouses: actions/checkout@v4with:@@ -134,9 +136,6 @@ jobs:shell: bashsteps:- - name: 🛑 Cancel Previous Runs- uses: styfle/[email protected]-- name: ⬇️ Checkout repouses: actions/checkout@v4with:diff --git a/.github/workflows/test_schemas.yaml b/.github/workflows/test_schemas.yamlindex fab7029813..ffcbc11f7f 100644--- a/.github/workflows/test_schemas.yaml+++ b/.github/workflows/test_schemas.yaml@@ -7,6 +7,10 @@ on:- "packages/openapi/api.yaml"- ".github/workflows/test_schemas.yaml"+concurrency:+ group: ${{ github.workflow }}-${{ github.ref }}+ cancel-in-progress: true+permissions:contents: readpull-requests: write@@ -111,11 +115,19 @@ jobs:- name: Comment on PRif: ${{ failure() && matrix.schema.condition }}uses: actions/github-script@v7+ env:+ BREAKING_CHANGES: ${{ steps.compare.outputs.breaking_changes }}+ DISPLAY_NAME: ${{ matrix.schema.display_name }}with:script: |- const output = `Breaking changes detected in the ${{ matrix.schema.display_name }}!+ const breakingChanges = process.env.BREAKING_CHANGES || 'No details available';+ const displayName = process.env.DISPLAY_NAME || 'Schema';++ const output = `Breaking changes detected in the ${displayName}!- ${{ steps.compare.outputs.breaking_changes }}`+ \`\`\`+ ${breakingChanges}+ \`\`\``;github.rest.issues.createComment({issue_number: context.issue.number,diff --git a/.github/workflows/test_typos.yaml b/.github/workflows/test_typos.yamlindex ba946de556..b06ac16959 100644--- a/.github/workflows/test_typos.yaml+++ b/.github/workflows/test_typos.yaml@@ -4,6 +4,10 @@ name: Typoson:pull_request: {}+concurrency:+ group: ${{ github.workflow }}-${{ github.ref }}+ cancel-in-progress: true+permissions:contents: read@@ -12,7 +16,5 @@ jobs:name: Check for typosruns-on: ubuntu-lateststeps:- - name: 🛑 Cancel Previous Runs- uses: styfle/[email protected]- uses: actions/checkout@v4- uses: crate-ci/[email protected]