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
Switch to `uv_build` as PEP 517 build-system (#5778)
Trevor Manzc9dc88cea64b
diff --git a/.github/workflows/dev-release.yml b/.github/workflows/dev-release.ymlindex 228a5d167d..2c308395de 100644--- a/.github/workflows/dev-release.yml+++ b/.github/workflows/dev-release.yml@@ -44,16 +44,16 @@ jobs:env:CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}- - name: 🥚 Install Hatch- uses: pypa/hatch@install+ - name: Install uv+ uses: astral-sh/setup-uv@v6- # patch __init__.py version to be of the form+ # patch pyproject.toml version to be of the form# X.Y.<Z+1>-dev{n-commits-since-last-tag}- name: 🔨 Patch version numberrun: |# Get the version number and increment patch# - assumes version is on a line of the form __version__ == "x.y.z"- incremented_version=`grep '__version__' marimo/__init__.py | awk '{print $3}' | awk -F. '{printf "%d.%d.%d", $1, $2, $3+1}'`+ incremented_version=`uv version --short | awk -F. '{printf "%d.%d.%d", $1, $2, $3+1}'`# Get the number of commits since last tagn_commits=`git rev-list $(git describe --tags --abbrev=0)..HEAD --count`# Form the new version, which is one patch ahead of the last version@@ -61,22 +61,24 @@ jobs:MARIMO_VERSION="${incremented_version}-dev${n_commits}"# Set the version in the environment for later stepsecho "MARIMO_VERSION=$MARIMO_VERSION" >> $GITHUB_ENV- sed -i "s/__version__ = \".*\"/__version__ = \"$MARIMO_VERSION\"/" marimo/__init__.py+ uv version "$MARIMO_VERSION"+ env:+ NO_COLOR: 1- name: 📦 Build marimo- run: hatch build+ run: uv build- name: 📤 Upload to TestPyPI (marimo)env:HATCH_INDEX_USER: ${{ secrets.TEST_PYPI_USER }}HATCH_INDEX_AUTH: ${{ secrets.TEST_PYPI_PASSWORD }}- run: hatch publish --repo test+ run: uvx hatch publish --repo test- name: Adapt pyproject.toml to build marimo-base- run: ./scripts/modify_pyproject_for_marimo_base.sh+ run: ./scripts/modify_pyproject_for_marimo_base.py- name: 📦 Build marimo- run: hatch build --clean+ run: uvx hatch build --clean- name: 📦 Validate wheel under 2mbrun: ./scripts/validate_base_wheel_size.sh@@ -85,7 +87,7 @@ jobs:env:HATCH_INDEX_USER: ${{ secrets.TEST_PYPI_USER }}HATCH_INDEX_AUTH: ${{ secrets.TEST_PYPI_MARIMO_BASE_PASSWORD }}- run: hatch publish --repo test+ run: uvx hatch publish --repo test- name: 📦 Update package.json version from CLIworking-directory: frontenddiff --git a/.github/workflows/marimo-bot.yml b/.github/workflows/marimo-bot.ymlindex 4e9124dbe1..2d691dc278 100644--- a/.github/workflows/marimo-bot.yml+++ b/.github/workflows/marimo-bot.yml@@ -88,31 +88,32 @@ jobs:env:TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}- - name: 🥚 Install Hatch- uses: pypa/hatch@install+ - name: Install uv+ uses: astral-sh/setup-uv@v6- name: Adapt pyproject.toml to build marimo-base- run: ./scripts/modify_pyproject_for_marimo_base.sh+ run: ./scripts/modify_pyproject_for_marimo_base.py- # patch __init__.py version to be of the form+ # patch pyproject.toml version to be of the form# X.Y.Z-dev9{4random digits}# This must be a valid semver version from# https://packaging.python.org/en/latest/discussions/versioning/- name: 🔨 Patch version numberrun: |# Get the version number- # - assumes version is on a line of the form __version__ == "x.y.z"- current_version=`grep '__version__' marimo/__init__.py | awk '{print $3}' | tr -d '"'`+ current_version=`uv version --short`# Generate a random 4-digit numberrandom_digits=`shuf -i 1000-9999 -n 1`# Form the new version with the random digitsMARIMO_VERSION="${current_version}-dev9${random_digits}"# Set the version in the environment for later stepsecho "MARIMO_VERSION=$MARIMO_VERSION" >> $GITHUB_ENV- sed -i "s/__version__ = \".*\"/__version__ = \"$MARIMO_VERSION\"/" marimo/__init__.py+ uv version "$MARIMO_VERSION"+ env:+ NO_COLOR: 1- name: 📦 Build marimo- run: hatch build --clean+ run: uv build- name: 📦 Validate wheel under 2mbrun: ./scripts/validate_base_wheel_size.sh@@ -121,7 +122,7 @@ jobs:env:HATCH_INDEX_USER: ${{ secrets.TEST_PYPI_USER }}HATCH_INDEX_AUTH: ${{ secrets.TEST_PYPI_MARIMO_BASE_PASSWORD }}- run: hatch publish --repo test+ run: uvx hatch publish --repo test- name: 📦 Update package.json version from CLIworking-directory: frontenddiff --git a/.github/workflows/release-marimo-base.yml b/.github/workflows/release-marimo-base.ymlindex 3927a3ef69..6c8453597b 100644--- a/.github/workflows/release-marimo-base.yml+++ b/.github/workflows/release-marimo-base.yml@@ -28,14 +28,14 @@ jobs:- name: ⬇️ Checkout repouses: actions/checkout@v4- - name: 🥚 Install Hatch- uses: pypa/hatch@install+ - name: Install uv+ uses: astral-sh/setup-uv@v6- name: Adapt pyproject.toml to build marimo-base- run: ./scripts/modify_pyproject_for_marimo_base.sh+ run: ./scripts/modify_pyproject_for_marimo_base.py- name: 📦 Build marimo-base- run: hatch build --clean+ run: uv build- name: 📦 Validate wheel under 2mbrun: ./scripts/validate_base_wheel_size.sh@@ -44,10 +44,10 @@ jobs:env:HATCH_INDEX_USER: ${{ secrets.PYPI_USER }}HATCH_INDEX_AUTH: ${{ secrets.PYPI_MARIMO_BASE_PASSWORD }}- run: hatch publish+ run: uvx hatch publish- name: 📤 Upload to TestPyPIenv:HATCH_INDEX_USER: ${{ secrets.TEST_PYPI_USER }}HATCH_INDEX_AUTH: ${{ secrets.TEST_PYPI_MARIMO_BASE_PASSWORD }}- run: hatch publish --repo test+ run: uvx hatch publish --repo testdiff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 01f7399e56..4a1a026cc6 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -318,24 +318,6 @@ If you use vscode, you might find the following `settings.json` useful:}```-## Testing a branch from GitHub--This requires `uv` to be installed. This may take a bit to install frontend dependencies and build the frontend.--```bash-MARIMO_BUILD_FRONTEND=true \-uvx --with git+https://github.com/marimo-team/marimo.git@BRANCH_NAME \-marimo edit-```--Additionally, you can run `marimo` from the main branch:--```bash-MARIMO_BUILD_FRONTEND=true \-uvx --with git+https://github.com/marimo-team/marimo.git \-marimo edit-```-## Your first PRMarimo has a variety of CI jobs that run on pull requests. All new PRs will fail until you have signed the [CLA](https://marimo.io/cla). Don't fret. You can sign the CLA by leaving a comment in the PR with text of `I have read the CLA Document and I hereby sign the CLA`diff --git a/build_hook.py b/build_hook.pydeleted file mode 100644index 9e1475a8ff..0000000000--- a/build_hook.py+++ /dev/null@@ -1,76 +0,0 @@-from __future__ import annotations--import os-import subprocess-from typing import Any--from hatchling.builders.hooks.plugin.interface import BuildHookInterface---class FrontendBuildHook(BuildHookInterface[Any]):- def initialize(self, version: str, build_data: dict[str, Any]) -> None:- # Only build frontend if MARIMO_BUILD_FRONTEND variable exists- MARIMO_BUILD_FRONTEND = os.getenv("MARIMO_BUILD_FRONTEND")- if not MARIMO_BUILD_FRONTEND:- self.app.display_debug(- "MARIMO_BUILD_FRONTEND is not set, skipping frontend build"- )- return-- self.app.display_info(f"Build data: {str(build_data)}")- self.app.display_info(f"Project root: {self.root}")- self.app.display_info(f"Build dir: {self.directory}")-- self.app.display_info(- "Starting frontend build process. This may take a minute..."- )- try:- self._check_binary("node", "Node.js")- self._check_binary("pnpm", "pnpm")- self._run_frontend_build()- except Exception as e:- self.app.display_error(f"Frontend build failed: {e}")- raise-- self.app.display_info("Frontend build completed successfully")- return super().initialize(version, build_data)-- def _check_binary(self, binary: str, display_name: str) -> None:- try:- subprocess.run(- [binary, "--version"],- check=True,- capture_output=True,- text=True,- )- except FileNotFoundError:- raise RuntimeError(- f"{display_name} is not installed. Please install {display_name} and try again."- ) from None- except subprocess.CalledProcessError as e:- raise RuntimeError(- f"{display_name} check failed: {e.stderr}"- ) from None-- def _run_frontend_build(self) -> None:- try:- # Uncomment to hide output- capture_output = True- result = subprocess.run(- ["make", "fe"],- check=True,- capture_output=capture_output,- text=True,- cwd=self.root,- )- if capture_output:- self.app.display_debug(f"Build output: {result.stdout}")- except subprocess.CalledProcessError as e:- self.app.display_error(f"Build script stderr: {e.stderr}")- raise RuntimeError("Frontend build script failed") from e-- def clean(self, versions: list[str]) -> None:- """Clean up build artifacts"""- self.app.display_info("Cleaning frontend build artifacts...")- # Add any frontend cleanup logic here if needed- super().clean(versions)diff --git a/marimo/__init__.py b/marimo/__init__.pyindex 3befb8577e..c5e610a443 100644--- a/marimo/__init__.py+++ b/marimo/__init__.py@@ -84,9 +84,8 @@ __all__ = ["video","vstack","watch",+ "__version__",]-__version__ = "0.14.13"-import marimo._ai as aiimport marimo._islands as islandsimport marimo._runtime.watch as watch@@ -146,3 +145,4 @@ from marimo._runtime.threads import Thread, current_threadfrom marimo._save.save import cache, lru_cache, persistent_cachefrom marimo._server.asgi import create_asgi_appfrom marimo._sql.sql import sql+from marimo._version import __version__diff --git a/marimo/_ast/codegen.py b/marimo/_ast/codegen.pyindex 4454e4e5cd..3d47dc403f 100644--- a/marimo/_ast/codegen.py+++ b/marimo/_ast/codegen.py@@ -8,7 +8,6 @@ import sysimport textwrapfrom typing import TYPE_CHECKING, Any, Literal, Optional-from marimo import __version__from marimo._ast.app_config import _AppConfigfrom marimo._ast.cell import CellConfig, CellImplfrom marimo._ast.compiler import compile_cell@@ -19,6 +18,7 @@ from marimo._ast.visitor import Name, VariableDatafrom marimo._convert.converters import MarimoConvertfrom marimo._schemas.serialization import NotebookSerializationV1from marimo._types.ids import CellId_t+from marimo._version import __version__if TYPE_CHECKING:from pathlib import Pathdiff --git a/marimo/_cli/cli.py b/marimo/_cli/cli.pyindex 80910fe3ee..e9c82bbefe 100644--- a/marimo/_cli/cli.py+++ b/marimo/_cli/cli.py@@ -12,7 +12,7 @@ from typing import Any, Optionalimport clickimport marimo._cli.cli_validators as validators-from marimo import __version__, _loggers+from marimo import _loggersfrom marimo._ast import codegenfrom marimo._ast.load import get_notebook_statusfrom marimo._cli.config.commands import config@@ -39,6 +39,7 @@ from marimo._tutorials import () # type: ignorefrom marimo._utils.marimo_path import MarimoPath, create_temp_notebook_filefrom marimo._utils.platform import is_windows+from marimo._version import __version__def helpful_usage_error(self: Any, file: Any = None) -> None:diff --git a/marimo/_cli/development/commands.py b/marimo/_cli/development/commands.pyindex 1290f829a1..fb602f84ed 100644--- a/marimo/_cli/development/commands.py+++ b/marimo/_cli/development/commands.py@@ -37,7 +37,6 @@ def _generate_server_api_schema() -> dict[str, Any]:import marimo._server.models.packages as packagesimport marimo._server.models.secrets as secretsimport marimo._snippets.snippets as snippets- from marimo import __version__from marimo._ast.cell import CellConfig, RuntimeStateTypefrom marimo._config.config import MarimoConfigfrom marimo._messaging.cell_output import CellChannel, CellOutput@@ -49,6 +48,7 @@ def _generate_server_api_schema() -> dict[str, Any]:from marimo._utils.dataclass_to_openapi import (PythonTypeToOpenAPI,)+ from marimo._version import __version__# dataclass components used in websocket messages# these are always snake_casediff --git a/marimo/_cli/envinfo.py b/marimo/_cli/envinfo.pyindex 1eac123386..8848d804d4 100644--- a/marimo/_cli/envinfo.py+++ b/marimo/_cli/envinfo.py@@ -5,7 +5,7 @@ import platformimport sysfrom typing import Any, Union, cast-from marimo import __version__, _loggers+from marimo import _loggersfrom marimo._config.manager import get_default_config_managerfrom marimo._utils.health import (get_chrome_version,@@ -14,6 +14,7 @@ from marimo._utils.health import (get_required_modules_list,)from marimo._utils.versions import is_editable+from marimo._version import __version__LOGGER = _loggers.marimo_logger()diff --git a/marimo/_cli/sandbox.py b/marimo/_cli/sandbox.pyindex 58990a57f8..2895b68583 100644--- a/marimo/_cli/sandbox.py+++ b/marimo/_cli/sandbox.py@@ -12,7 +12,7 @@ from typing import Any, Literal, Optionalimport click-from marimo import __version__, _loggers+from marimo import _loggersfrom marimo._cli.print import bold, echo, green, mutedfrom marimo._config.settings import GLOBAL_SETTINGSfrom marimo._dependencies.dependencies import DependencyManager@@ -22,6 +22,7 @@ from marimo._utils.inline_script_metadata import ()from marimo._utils.uv import find_uv_binfrom marimo._utils.versions import is_editable+from marimo._version import __version__LOGGER = _loggers.marimo_logger()diff --git a/marimo/_cli/upgrade.py b/marimo/_cli/upgrade.pyindex 03d6696079..efb227b2cc 100644--- a/marimo/_cli/upgrade.py+++ b/marimo/_cli/upgrade.py@@ -9,7 +9,7 @@ from datetime import datetimefrom typing import Any, Callable, castimport marimo._utils.requests as requests-from marimo import __version__ as current_version, _loggers+from marimo import _loggersfrom marimo._cli.print import echo, green, orangefrom marimo._config.cli_state import (MarimoCLIState,@@ -17,6 +17,7 @@ from marimo._config.cli_state import (write_cli_state,)from marimo._tracer import server_tracer+from marimo._version import __version__ as current_versionFETCH_TIMEOUT = 3diff --git a/marimo/_convert/notebook.py b/marimo/_convert/notebook.pyindex 1683b0441b..019c33f76d 100644--- a/marimo/_convert/notebook.py+++ b/marimo/_convert/notebook.py@@ -1,5 +1,4 @@# Copyright 2025 Marimo. All rights reserved.-from marimo import __version__from marimo._schemas.notebook import (NotebookCell,NotebookCellConfig,@@ -13,6 +12,7 @@ from marimo._schemas.serialization import (NotebookSerializationV1,)from marimo._utils.code import hash_code+from marimo._version import __version__def convert_from_ir_to_notebook_v1(diff --git a/marimo/_islands/_island_generator.py b/marimo/_islands/_island_generator.pyindex 075ad956cd..317f821824 100644--- a/marimo/_islands/_island_generator.py+++ b/marimo/_islands/_island_generator.py@@ -7,7 +7,7 @@ import sysfrom textwrap import dedentfrom typing import TYPE_CHECKING, Optional, Union, cast-from marimo import __version__, _loggers+from marimo import _loggersfrom marimo._ast.app import App, InternalAppfrom marimo._ast.app_config import _AppConfigfrom marimo._ast.cell import Cell, CellConfig@@ -18,6 +18,7 @@ from marimo._server.file_manager import AppFileManagerfrom marimo._server.file_router import AppFileRouterfrom marimo._types.ids import CellId_tfrom marimo._utils.marimo_path import MarimoPath+from marimo._version import __version__if sys.platform == "win32": # handling for windowsasyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())diff --git a/marimo/_save/stores/rest.py b/marimo/_save/stores/rest.pyindex a2d14fe9e4..d8cc6f30a2 100644--- a/marimo/_save/stores/rest.py+++ b/marimo/_save/stores/rest.py@@ -5,8 +5,9 @@ import urllib.errorimport urllib.requestfrom typing import Optional-from marimo import __version__, _loggers+from marimo import _loggersfrom marimo._save.stores.store import Store+from marimo._version import __version__LOGGER = _loggers.marimo_logger()diff --git a/marimo/_server/api/endpoints/health.py b/marimo/_server/api/endpoints/health.pyindex a12372b701..05b96eaa5e 100644--- a/marimo/_server/api/endpoints/health.py+++ b/marimo/_server/api/endpoints/health.py@@ -8,7 +8,7 @@ from typing import TYPE_CHECKING, Any, Optionalfrom starlette.authentication import requiresfrom starlette.responses import JSONResponse, PlainTextResponse-from marimo import __version__, _loggers+from marimo import _loggersfrom marimo._dependencies.dependencies import DependencyManagerfrom marimo._server.api.deps import AppStatefrom marimo._server.router import APIRouter@@ -17,6 +17,7 @@ from marimo._utils.health import (get_python_version,get_required_modules_list,)+from marimo._version import __version__if TYPE_CHECKING:from starlette.requests import Requestdiff --git a/marimo/_server/export/exporter.py b/marimo/_server/export/exporter.pyindex 3a62f090ec..1e650f2daa 100644--- a/marimo/_server/export/exporter.py+++ b/marimo/_server/export/exporter.py@@ -15,7 +15,7 @@ from typing import (cast,)-from marimo import __version__, _loggers+from marimo import _loggersfrom marimo._ast.app import InternalAppfrom marimo._ast.cell import Cell, CellImplfrom marimo._ast.names import DEFAULT_CELL_NAME, is_internal_cell_name@@ -56,6 +56,7 @@ from marimo._utils.code import hash_codefrom marimo._utils.data_uri import build_data_urlfrom marimo._utils.marimo_path import MarimoPathfrom marimo._utils.paths import marimo_package_path+from marimo._version import __version__LOGGER = _loggers.marimo_logger()diff --git a/marimo/_server/session/serialize.py b/marimo/_server/session/serialize.pyindex 1488436b3d..6081c3c477 100644--- a/marimo/_server/session/serialize.py+++ b/marimo/_server/session/serialize.py@@ -9,7 +9,7 @@ from dataclasses import dataclassfrom pathlib import Pathfrom typing import TYPE_CHECKING, Any, Optional, Union, cast-from marimo import __version__, _loggers+from marimo import _loggersfrom marimo._ast.cell_manager import CellManagerfrom marimo._messaging.cell_output import CellChannel, CellOutputfrom marimo._messaging.errors import (@@ -41,6 +41,7 @@ from marimo._types.ids import CellId_tfrom marimo._utils.async_path import AsyncPathfrom marimo._utils.background_task import AsyncBackgroundTaskfrom marimo._utils.lists import as_list+from marimo._version import __version__if TYPE_CHECKING:from collections.abc import Iterablediff --git a/marimo/_server/sessions.py b/marimo/_server/sessions.pyindex a478abaae4..5239bc896f 100644--- a/marimo/_server/sessions.py+++ b/marimo/_server/sessions.py@@ -706,7 +706,7 @@ class Session:Overwrites the existing session view.Mutates the existing session."""- from marimo import __version__+ from marimo._version import __version__LOGGER.debug("Syncing session view from cache")self.session_cache_manager = SessionCacheManager(diff --git a/marimo/_server/templates/templates.py b/marimo/_server/templates/templates.pyindex 69262dedc4..228334f3aa 100644--- a/marimo/_server/templates/templates.py+++ b/marimo/_server/templates/templates.py@@ -8,7 +8,6 @@ from pathlib import Pathfrom textwrap import dedentfrom typing import Any, Literal, Optional, Union, cast-from marimo import __version__from marimo._ast.app_config import _AppConfigfrom marimo._config.config import MarimoConfig, PartialMarimoConfigfrom marimo._convert.converters import MarimoConvert@@ -20,6 +19,7 @@ from marimo._server.file_manager import read_css_file, read_html_head_filefrom marimo._server.model import SessionModefrom marimo._server.tokens import SkewProtectionTokenfrom marimo._utils.versions import is_editable+from marimo._version import __version__MOUNT_CONFIG_TEMPLATE = "'{{ mount_config }}'"diff --git a/marimo/_utils/requests.py b/marimo/_utils/requests.pyindex 3f1978d03d..2ddc546568 100644--- a/marimo/_utils/requests.py+++ b/marimo/_utils/requests.py@@ -5,7 +5,7 @@ import urllib.parseimport urllib.requestfrom typing import Any, Optional, Union-from marimo import __version__+from marimo._version import __version__# Utility functions for making HTTP requests,# without using the requests library or any other external dependencies.diff --git a/marimo/_version.py b/marimo/_version.pynew file mode 100644index 0000000000..f49c93d2fe--- /dev/null+++ b/marimo/_version.py@@ -0,0 +1,10 @@+# Copyright 2024 Marimo. All rights reserved.+from __future__ import annotations++from importlib.metadata import PackageNotFoundError, version++try:+ __version__ = version("marimo")+except PackageNotFoundError:+ # package is not installed+ __version__ = "unknown"diff --git a/third_party.txt b/marimo/third_party.txtsimilarity index 100%rename from third_party.txtrename to marimo/third_party.txtdiff --git a/third_party_licenses.txt b/marimo/third_party_licenses.txtsimilarity index 100%rename from third_party_licenses.txtrename to marimo/third_party_licenses.txtdiff --git a/pyproject.toml b/pyproject.tomlindex fe3e9dc130..7fb770aa5d 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -1,11 +1,11 @@[build-system]-requires = ["hatchling"]-build-backend = "hatchling.build"+requires = ["uv_build>=0.8.3,<0.9.0"]+build-backend = "uv_build"[project]name = "marimo"+version = "0.14.13"description = "A library for making reactive notebooks and apps"-dynamic = ["version"]# We try to keep dependencies to a minimum, to avoid conflicts with# user environments;we need a very compelling reason for each dependency added.# Dependencies should have lower bounds, which should be as loose as possible.@@ -140,24 +140,6 @@ docs = [[tool.hatch]installer = "uv"-[tool.hatch.build.hooks.custom]-path = "build_hook.py"--[tool.hatch.version]-path = "marimo/__init__.py"--[tool.hatch.build.targets.sdist]-include = ["/marimo"]-artifacts = ["marimo/_static/", "marimo/_lsp/", "third_party.txt", "third_party_licenses.txt"]-exclude = ["marimo/_smoke_tests"]-force-include = { "build_hook.py" = "build_hook.py" }--[tool.hatch.build.targets.wheel]-include = ["/marimo"]-artifacts = ["marimo/_static/", "marimo/_lsp/", "third_party.txt", "third_party_licenses.txt"]-exclude = ["marimo/_smoke_tests"]-force-include = { "build_hook.py" = "build_hook.py" }-# Override the default uv version to use the latest version[tool.hatch.envs.hatch-uv]dependencies = ["uv>=0.4.17"]@@ -305,6 +287,12 @@ dependencies = [[tool.uv.sources]marimo_docs = { path = "./docs", editable = true }+[tool.uv.build-backend]+module-name = "marimo"+module-root = ""+source-include = ["third_party.txt", "third_party_licenses.txt"]+wheel-exclude = ["marimo/_smoke_tests/**"]+[tool.hatch.envs.docs.scripts]build = "mkdocs build {args}"serve = "mkdocs serve --clean {args}"diff --git a/scripts/modify_pyproject_for_marimo_base.py b/scripts/modify_pyproject_for_marimo_base.pynew file mode 100755index 0000000000..9718992556--- /dev/null+++ b/scripts/modify_pyproject_for_marimo_base.py@@ -0,0 +1,50 @@+#!/usr/bin/env uv run+"""+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+"""+# /// script+# requires-python = ">=3.13"+# dependencies = ["tomlkit"]+#+# [tool.uv]+# exclude-newer = "2025-07-28T10:17:41.85442-04:00"+# ///++import pathlib+import tomlkit+++root = pathlib.Path(__file__).parent.parent++force_exclude = [+ str(item.relative_to(root))+ for item in (root / "marimo/_static").iterdir()+ if item.name != "index.html"+]++with (root / "pyproject.toml").open(encoding="utf-8", mode="r") as f:+ data = tomlkit.load(f)+++data["project"]["name"] = "marimo-base"+build_backend = data["tool"]["uv"]["build-backend"]++if "source-exclude" not in build_backend:+ build_backend["source-exclude"] = []+build_backend["source-exclude"].extend(force_exclude)++if "wheel-exclude" not in build_backend:+ build_backend["wheel-exclude"] = []+build_backend["wheel-exclude"].extend(force_exclude)++with (root / "pyproject.toml").open(encoding="utf-8", mode="w") as f:+ tomlkit.dump(data, f)++print("Successfully modified pyproject.toml for marimo-base build")diff --git a/scripts/modify_pyproject_for_marimo_base.sh b/scripts/modify_pyproject_for_marimo_base.shdeleted file mode 100755index 40e95f126b..0000000000--- a/scripts/modify_pyproject_for_marimo_base.sh+++ /dev/null@@ -1,15 +0,0 @@-#!/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-# Replace static artifacts with just index.html-# TODO: this should be a more robust by handling new lines-sed -i.bak 's/artifacts = \[.*\]/artifacts = ["marimo\/_static\/index.html"]/' pyproject.toml-rm -rf pyproject.toml.bakdiff --git a/scripts/release.sh b/scripts/release.shindex 7aac3974b7..e2cf612cfe 100755--- a/scripts/release.sh+++ b/scripts/release.sh@@ -75,15 +75,16 @@ git pull origin main# Run hatch versionprint_step "Updating version"-echo -e "Running: hatch version $VERSION_TYPE\n"-hatch version $VERSION_TYPE-NEW_VERSION=$(hatch --no-color version) # re-run to get the version+echo -e "Running: uv version --bump $VERSION_TYPE\n"+uv version --bump $VERSION_TYPE+NEW_VERSION=$(NO_COLOR=1 uv version --short) # re-run to get the version# Summary and confirmationecho -e "\n${BOLD}Release Summary:${NC}"echo " • New Version: $NEW_VERSION"echo " • Files to be committed:"-echo " - marimo/__init__.py"+echo " - pyproject.toml"+echo " - uv.lock"if ! confirm "Proceed with release?"; thenprint_warning "Release cancelled"@@ -92,7 +93,8 @@ fi# Commit version changeprint_step "Committing version change"-git add marimo/__init__.py+git add pyproject.toml+git add uv.lockgit commit -m "release: $NEW_VERSION"# Push changes