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.

ci: remove hatch and dead code (#8971)

Myles Scolnick493a79e9c05e
diff --git a/.github/workflows/release-prod.yml b/.github/workflows/release-prod.yml
index 0ad7349eda..074f312584 100644
--- a/.github/workflows/release-prod.yml
+++ b/.github/workflows/release-prod.yml
@@ -36,9 +36,6 @@ jobs:
turbo-token: ${{ secrets.TURBO_TOKEN }}
codecov-token: ${{ secrets.CODECOV_TOKEN }}
- - name: 🥚 Install Hatch
- uses: pypa/hatch@install
-
- name: 🐍 Setup uv
uses: astral-sh/setup-uv@v7
@@ -113,4 +110,3 @@ jobs:
permissions:
id-token: write # Required for OIDC
contents: read
-
diff --git a/.github/workflows/test_be_dagger.yaml.skip b/.github/workflows/test_be_dagger.yaml.skip
deleted file mode 100644
index 98eae021e5..0000000000
--- a/.github/workflows/test_be_dagger.yaml.skip
+++ /dev/null
@@ -1,39 +0,0 @@
-name: Test BE Dagger
-
-on:
- push:
- branches: [main]
- pull_request:
-
-jobs:
- changes:
- runs-on: ubuntu-latest
- outputs:
- backend: ${{ steps.filter.outputs.backend }}
- steps:
- - uses: actions/checkout@v4
- - uses: dorny/paths-filter@v3
- id: filter
- with:
- filters: |
- backend:
- - 'marimo/**'
- - 'tests/**'
- - 'pyproject.toml'
- - 'dagger/**'
-
- test_python:
- needs: changes
- if: ${{ needs.changes.outputs.backend == 'true' }}
- name: Daggerized Backend Test
- runs-on: ubuntu-latest
- timeout-minutes: 15
- continue-on-error: true
-
- steps:
- - uses: actions/checkout@v4
-
- - uses: dagger/dagger-for-github@v6
- name: 🚀 Dagger
- with:
- args: backend test
diff --git a/.github/workflows/test_fe_dagger.yaml.skip b/.github/workflows/test_fe_dagger.yaml.skip
deleted file mode 100644
index cc37e22362..0000000000
--- a/.github/workflows/test_fe_dagger.yaml.skip
+++ /dev/null
@@ -1,42 +0,0 @@
-name: Test FE Dagger
-
-on:
- push:
- branches: [main]
- pull_request:
-
-env:
- TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
-
-jobs:
- changes:
- runs-on: ubuntu-latest
- outputs:
- frontend: ${{ steps.filter.outputs.frontend }}
- steps:
- - uses: actions/checkout@v4
- - uses: dorny/paths-filter@v3
- id: filter
- with:
- filters: |
- frontend:
- - 'frontend/**'
- - 'packages/**'
- - 'dagger/**'
-
- test_frontend:
- needs: changes
- if: ${{ needs.changes.outputs.frontend == 'true' }}
- name: 🖥️ Lint, test, build frontend
- runs-on: ubuntu-latest
- timeout-minutes: 15
- continue-on-error: true
-
- steps:
- - name: ⬇️ Checkout repo
- uses: actions/checkout@v4
-
- - uses: dagger/dagger-for-github@v6
- name: 🚀 Dagger
- with:
- args: frontend test
diff --git a/dagger.json b/dagger.json
deleted file mode 100644
index c6632e9191..0000000000
--- a/dagger.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "name": "marimo",
- "sdk": "python",
- "source": "dagger",
- "engineVersion": "v0.13.0"
-}
diff --git a/dagger/.gitattributes b/dagger/.gitattributes
deleted file mode 100644
index 827418463f..0000000000
--- a/dagger/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-/sdk/** linguist-generated
diff --git a/dagger/.gitignore b/dagger/.gitignore
deleted file mode 100644
index 78f6c8dd39..0000000000
--- a/dagger/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/sdk
diff --git a/dagger/README.md b/dagger/README.md
deleted file mode 100644
index 3826cb590f..0000000000
--- a/dagger/README.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# Dagger
-
-This directory contains Dagger scripts for building and testing marimo in a
-containerized environment. This allows for running tests and builds in an
-environment that is similar to CI.
-
-To run a Dagger script, you need to have the Dagger CLI installed. You can install
-it by following the instructions [here](https://docs.dagger.io/install).
-
-To run a Dagger script, you can use the following command:
-
-```bash
-dagger functions # see what functions are available in the module
-dagger call make <any make task> # run make task in a dev environment
-dagger call frontend test # run frontend tests
-dagger call backend test # run backend tests
-# run frontend tests on a remote pull request
-dagger call --src https://github.com/marimo-team/marimo\#pull/2542/head frontend test
-```
diff --git a/dagger/pyproject.toml b/dagger/pyproject.toml
deleted file mode 100644
index e9bfc92bd4..0000000000
--- a/dagger/pyproject.toml
+++ /dev/null
@@ -1,9 +0,0 @@
-[project]
-name = "main"
-version = "0.0.0"
-dependencies = []
-
-[build-system]
-requires = ["hatchling"]
-build-backend = "hatchling.build"
-
diff --git a/dagger/requirements.lock b/dagger/requirements.lock
deleted file mode 100644
index c88329fcf5..0000000000
--- a/dagger/requirements.lock
+++ /dev/null
@@ -1,94 +0,0 @@
-# This file was autogenerated by uv via the following command:
-# uv pip compile --universal -o requirements.lock sdk/pyproject.toml pyproject.toml
-anyio==4.4.0
- # via
- # dagger-io (sdk/pyproject.toml)
- # gql
- # httpx
-attrs==24.2.0
- # via cattrs
-backoff==2.2.1
- # via gql
-beartype==0.18.5
- # via dagger-io (sdk/pyproject.toml)
-cattrs==24.1.0
- # via dagger-io (sdk/pyproject.toml)
-certifi==2024.8.30
- # via
- # httpcore
- # httpx
-deprecated==1.2.14
- # via
- # opentelemetry-api
- # opentelemetry-exporter-otlp-proto-grpc
- # opentelemetry-semantic-conventions
-googleapis-common-protos==1.65.0
- # via opentelemetry-exporter-otlp-proto-grpc
-gql==3.5.0
- # via dagger-io (sdk/pyproject.toml)
-graphql-core==3.2.4
- # via gql
-grpcio==1.66.1
- # via opentelemetry-exporter-otlp-proto-grpc
-h11==0.14.0
- # via httpcore
-httpcore==1.0.5
- # via httpx
-httpx==0.27.2
- # via gql
-idna==3.8
- # via
- # anyio
- # httpx
- # yarl
-importlib-metadata==8.4.0
- # via opentelemetry-api
-markdown-it-py==3.0.0
- # via rich
-mdurl==0.1.2
- # via markdown-it-py
-multidict==6.0.5
- # via yarl
-opentelemetry-api==1.27.0
- # via
- # opentelemetry-exporter-otlp-proto-grpc
- # opentelemetry-sdk
- # opentelemetry-semantic-conventions
-opentelemetry-exporter-otlp-proto-common==1.27.0
- # via opentelemetry-exporter-otlp-proto-grpc
-opentelemetry-exporter-otlp-proto-grpc==1.27.0
- # via dagger-io (sdk/pyproject.toml)
-opentelemetry-proto==1.27.0
- # via
- # opentelemetry-exporter-otlp-proto-common
- # opentelemetry-exporter-otlp-proto-grpc
-opentelemetry-sdk==1.27.0
- # via
- # dagger-io (sdk/pyproject.toml)
- # opentelemetry-exporter-otlp-proto-grpc
-opentelemetry-semantic-conventions==0.48b0
- # via opentelemetry-sdk
-platformdirs==4.3.2
- # via dagger-io (sdk/pyproject.toml)
-protobuf==4.25.4
- # via
- # googleapis-common-protos
- # opentelemetry-proto
-pygments==2.18.0
- # via rich
-rich==13.8.0
- # via dagger-io (sdk/pyproject.toml)
-sniffio==1.3.1
- # via
- # anyio
- # httpx
-typing-extensions==4.12.2
- # via
- # dagger-io (sdk/pyproject.toml)
- # opentelemetry-sdk
-wrapt==1.16.0
- # via deprecated
-yarl==1.11.0
- # via gql
-zipp==3.20.1
- # via importlib-metadata
diff --git a/dagger/src/main/__init__.py b/dagger/src/main/__init__.py
deleted file mode 100644
index 628253650d..0000000000
--- a/dagger/src/main/__init__.py
+++ /dev/null
@@ -1,5 +0,0 @@
-"""A module for Marimo functions"""
-
-from .main import Marimo
-
-__all__ = ["Marimo"]
diff --git a/dagger/src/main/backend.py b/dagger/src/main/backend.py
deleted file mode 100644
index 96d7a02b6f..0000000000
--- a/dagger/src/main/backend.py
+++ /dev/null
@@ -1,77 +0,0 @@
-from typing import Annotated
-
-import dagger
-from dagger import Doc, field, function, object_type
-
-from .env import Env
-
-
-@object_type
-class Backend:
- src: Annotated[dagger.Directory, Doc("The marimo source tree to use")] = (
- field()
- )
-
- @function
- async def test(self) -> dagger.Container:
- env = (
- Env()
- .py()
- .with_directory("/src", self.src, owner="nonroot")
- .with_workdir("/src")
- # from GHA: This step is needed since some of our tests rely on the index.html file
- .with_exec(["mkdir", "-p", "marimo/_static/assets"])
- .with_exec(
- ["cp", "frontend/index.html", "marimo/_static/index.html"]
- )
- .with_exec(
- [
- "cp",
- "frontend/public/favicon.ico",
- "marimo/_static/favicon.ico",
- ]
- )
- .with_exec(["make", "py"])
- .with_exec(["uv", "run", "ruff", "check", "--fix"])
- .with_exec(
- [
- "uv",
- "run",
- "--only-group",
- "typecheck",
- "mypy",
- "marimo",
- "--exclude=marimo/_tutorials/",
- ]
- )
- )
-
- await env.sync()
-
- # test:test
- await env.with_exec(
- [
- "hatch",
- "run",
- "+py=3.12",
- "test:test",
- "-v",
- "tests/",
- "-k",
- "not test_cli",
- ]
- ).sync()
-
- # test-optional:test
- return env.with_exec(
- [
- "hatch",
- "run",
- "+py=3.12",
- "test-optional:test",
- "-v",
- "tests/",
- "-k",
- "not test_cli",
- ]
- )
diff --git a/dagger/src/main/cli.py b/dagger/src/main/cli.py
deleted file mode 100644
index 18c77dc6d3..0000000000
--- a/dagger/src/main/cli.py
+++ /dev/null
@@ -1,21 +0,0 @@
-from typing import Annotated
-
-import dagger
-from dagger import DefaultPath, Doc, Ignore, dag, field, function, object_type
-
-
-@object_type
-class Cli:
- src: Annotated[
- dagger.Directory,
- Doc("The marimo source tree to use"),
- DefaultPath("/"),
- Ignore(["/dagger", ".venv"]),
- ] = field()
-
- @function
- def test(self) -> dagger.Container:
- return (
- # python base
- dag.container().from_("python:3-bookworm")
- )
diff --git a/dagger/src/main/env.py b/dagger/src/main/env.py
deleted file mode 100644
index 93221b8b13..0000000000
--- a/dagger/src/main/env.py
+++ /dev/null
@@ -1,76 +0,0 @@
-import dagger
-from dagger import dag, function, object_type
-
-
-@object_type
-class Env:
- @function
- def dev(self) -> dagger.Container:
- """Dev container with dependencies for the full stack"""
- return (
- # python base
- self.py()
- .with_mounted_cache(
- "/root/.local/share/pnpm", dag.cache_volume("pnpm")
- )
- # package deps
- .with_exec(["apt", "update"])
- .with_exec(["apt", "install", "-y", "curl"])
- # install node 20+
- .with_exec(
- [
- "sh",
- "-c",
- "curl -fsSL https://deb.nodesource.com/setup_20.x | bash -", # noqa: E501
- ]
- )
- .with_exec(["apt", "install", "-y", "nodejs"])
- # install pnpm@9
- .with_exec(["npm", "install", "-g", "pnpm@9"])
- )
-
- @function
- def py(self) -> dagger.Container:
- """Python container with dependencies for the backend"""
- return (
- # python base
- dag.container()
- .from_("python:3.12-bookworm")
- .with_exec(["apt-get", "update"])
- .with_exec(
- [
- "apt-get",
- "install",
- "-y",
- "make",
- "libgdal-dev",
- "python3-gdal",
- ]
- )
- .with_exec(["adduser", "nonroot"])
- .with_mounted_cache(
- "/home/nonroot/.cache/pip",
- dag.cache_volume("python-312"),
- owner="nonroot",
- )
- .with_mounted_cache(
- "/home/nonroot/.cache/uv",
- dag.cache_volume("uv-python-312"),
- owner="nonroot",
- )
- .with_exec(["pip", "install", "hatch", "typos"])
- .with_user("nonroot")
- )
-
- @function
- def pnpm(self) -> dagger.Container:
- """A pnpm container with dependencies for the frontend"""
- return (
- dag.container()
- .from_("node:20-slim")
- .with_env_variable("CI", "true")
- .with_mounted_cache(
- "/root/.local/share/pnpm", dag.cache_volume("pnpm")
- )
- .with_exec(["corepack", "enable"]) # this enables pnpm
- )
diff --git a/dagger/src/main/frontend.py b/dagger/src/main/frontend.py
deleted file mode 100644
index 0a87879979..0000000000
--- a/dagger/src/main/frontend.py
+++ /dev/null
@@ -1,43 +0,0 @@
-from typing import Annotated
-
-import dagger
-from dagger import Doc, dag, field, function, object_type
-
-from .env import Env
-
-
-@object_type
-class Frontend:
- src: Annotated[dagger.Directory, Doc("The marimo source tree to use")] = (
- field()
- )
-
- @function
- def test(
- self,
- turbo_token: dagger.Secret = dag.set_secret("DEFAULT", ""), # noqa: B008
- ) -> dagger.Container:
- """
- Replace .github/workflows/test_fe.yaml
- """
- return (
- Env()
- .pnpm()
- .with_env_variable("MARIMO_SKIP_UPDATE_CHECK", "true")
- .with_secret_variable("TURBO_TOKEN", turbo_token)
- .with_env_variable("TURBO_TEAM", "marimo")
- .with_workdir("/src/frontend")
- .with_directory("/src", self.src)
- .with_exec(["pnpm", "install"])
- .with_exec(["pnpm", "dedupe", "--check"])
- .with_exec(["pnpm", "turbo", "lint"])
- .with_exec(["pnpm", "turbo", "typecheck"])
- .with_exec(["pnpm", "test"])
- .with_env_variable("NODE_ENV", "production")
- .with_exec(["pnpm", "turbo", "build"])
- .with_env_variable("VITE_MARIMO_ISLANDS", "true")
- .with_env_variable("VITE_MARIMO_VERSION", "0.0.0")
- .with_exec(["npm", "version", "0.0.0", "--no-git-tag-version"])
- .with_exec(["pnpm", "turbo", "build:islands"])
- .with_exec(["./islands/validate.sh"])
- )
diff --git a/dagger/src/main/main.py b/dagger/src/main/main.py
deleted file mode 100644
index b5c9a15d72..0000000000
--- a/dagger/src/main/main.py
+++ /dev/null
@@ -1,54 +0,0 @@
-from typing import Annotated
-
-import dagger
-from dagger import DefaultPath, Doc, Ignore, field, function, object_type
-
-from .backend import Backend
-from .cli import Cli
-from .env import Env
-from .frontend import Frontend
-
-
-@object_type
-class Marimo:
- """A collection of tasks for the Marimo project."""
-
- src: Annotated[dagger.Directory, Doc("The marimo source tree to use")] = (
- field()
- )
- frontend: Annotated[Frontend, Doc("Frontend components")] = field()
- backend: Annotated[Backend, Doc("Backend components")] = field()
- cli: Annotated[Cli, Doc("CLI components")] = field()
- env: Annotated[Env, Doc("Test and Build environments")] = field()
-
- @classmethod
- def create(
- cls,
- src: Annotated[
- dagger.Directory,
- Doc("The marimo source tree to use"),
- DefaultPath("/"),
- Ignore(["**/dagger", "**/.venv"]),
- ],
- ) -> "Marimo":
- return cls(
- src=src,
- frontend=Frontend(src=src),
- backend=Backend(src=src),
- cli=Cli(src=src),
- env=Env(),
- )
-
- @function
- def make(
- self,
- task: Annotated[str, Doc("The make task to run")],
- ) -> dagger.Container:
- """A container that runs a make task."""
- return (
- self.env.dev()
- .with_directory("/src", self.src)
- .with_workdir("/src")
- .with_exec(["make", "install-all"])
- .with_exec(["make", task])
- )
diff --git a/docs/__init__.py b/docs/__init__.py
deleted file mode 100644
index e738d2041e..0000000000
--- a/docs/__init__.py
+++ /dev/null
@@ -1,5 +0,0 @@
-"""marimo documentation package."""
-
-from . import blocks
-
-__all__ = ["blocks"]
diff --git a/docs/blocks.py b/docs/blocks/__init__.py
similarity index 100%
rename from docs/blocks.py
rename to docs/blocks/__init__.py
diff --git a/docs/pyproject.toml b/docs/pyproject.toml
index 3a5d39680a..3dbe858cfa 100644
--- a/docs/pyproject.toml
+++ b/docs/pyproject.toml
@@ -1,11 +1,12 @@
[build-system]
-build-backend = "hatchling.build"
-requires = ["hatchling"]
+build-backend = "uv_build"
+requires = ["uv_build>=0.8.3,<0.11.0"]
[project]
dependencies = ["lzstring>=1.0.4"]
name = "marimo_docs"
version = "0.1.0"
-[tool.hatch.build.targets.wheel]
-include = ["blocks.py"]
+[tool.uv.build-backend]
+module-name = "blocks"
+module-root = ""
diff --git a/pyodide/build_and_serve.py b/pyodide/build_and_serve.py
index 54dc9403b7..a0476e58dd 100644
--- a/pyodide/build_and_serve.py
+++ b/pyodide/build_and_serve.py
@@ -37,7 +37,7 @@ class WheelBuilderHandler(PatternMatchingEventHandler):
def on_any_event(self, event) -> None:
print(f"Change detected: {event.src_path}") # noqa: T201
print("Building wheel...") # noqa: T201
- subprocess.run(["hatch", "build"])
+ subprocess.run(["uv", "build"])
print("Wheel built successfully.") # noqa: T201
diff --git a/pyproject.toml b/pyproject.toml
index c81318334f..898dcb9103 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -548,7 +548,6 @@ platforms = ["osx-arm64", "linux-64", "linux-aarch64"]
[tool.pixi.dependencies]
nodejs = "22.*"
pnpm = "10.*"
-hatch = ">=1.16.3,<2"
make = ">=4.4.1,<5"
pre_commit = ">=4.2.0,<5"
uv = ">=0.6.12,<0.7"