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.

Revert "Remove global `hatch` CLI as required development dependency" (#5747)

Myles Scolnickdf2e8480972c
diff --git a/.github/workflows/dev-release.yml b/.github/workflows/dev-release.yml
index 7d6ae3bcf5..228a5d167d 100644
--- a/.github/workflows/dev-release.yml
+++ b/.github/workflows/dev-release.yml
@@ -44,8 +44,8 @@ jobs:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- - name: 🐍 Setup uv
- uses: astral-sh/setup-uv@v6
+ - name: 🥚 Install Hatch
+ uses: pypa/hatch@install
# patch __init__.py version to be of the form
# X.Y.<Z+1>-dev{n-commits-since-last-tag}
@@ -64,19 +64,19 @@ jobs:
sed -i "s/__version__ = \".*\"/__version__ = \"$MARIMO_VERSION\"/" marimo/__init__.py
- name: 📦 Build marimo
- run: uv build
+ run: hatch build
- name: 📤 Upload to TestPyPI (marimo)
env:
HATCH_INDEX_USER: ${{ secrets.TEST_PYPI_USER }}
HATCH_INDEX_AUTH: ${{ secrets.TEST_PYPI_PASSWORD }}
- run: uvx hatch publish --repo test
+ run: hatch publish --repo test
- name: Adapt pyproject.toml to build marimo-base
run: ./scripts/modify_pyproject_for_marimo_base.sh
- name: 📦 Build marimo
- run: uv build
+ run: hatch build --clean
- name: 📦 Validate wheel under 2mb
run: ./scripts/validate_base_wheel_size.sh
@@ -85,7 +85,7 @@ jobs:
env:
HATCH_INDEX_USER: ${{ secrets.TEST_PYPI_USER }}
HATCH_INDEX_AUTH: ${{ secrets.TEST_PYPI_MARIMO_BASE_PASSWORD }}
- run: uvx hatch publish --repo test
+ run: hatch publish --repo test
- name: 📦 Update package.json version from CLI
working-directory: frontend
diff --git a/.github/workflows/marimo-bot.yml b/.github/workflows/marimo-bot.yml
index 8e9072b9c8..4e9124dbe1 100644
--- a/.github/workflows/marimo-bot.yml
+++ b/.github/workflows/marimo-bot.yml
@@ -88,8 +88,8 @@ jobs:
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
- - name: 🐍 Setup uv
- uses: astral-sh/setup-uv@v6
+ - name: 🥚 Install Hatch
+ uses: pypa/hatch@install
- name: Adapt pyproject.toml to build marimo-base
run: ./scripts/modify_pyproject_for_marimo_base.sh
@@ -112,7 +112,7 @@ jobs:
sed -i "s/__version__ = \".*\"/__version__ = \"$MARIMO_VERSION\"/" marimo/__init__.py
- name: 📦 Build marimo
- run: uv build
+ run: hatch build --clean
- name: 📦 Validate wheel under 2mb
run: ./scripts/validate_base_wheel_size.sh
@@ -121,7 +121,7 @@ jobs:
env:
HATCH_INDEX_USER: ${{ secrets.TEST_PYPI_USER }}
HATCH_INDEX_AUTH: ${{ secrets.TEST_PYPI_MARIMO_BASE_PASSWORD }}
- run: uvx hatch publish --repo test
+ run: hatch publish --repo test
- name: 📦 Update package.json version from CLI
working-directory: frontend
diff --git a/.github/workflows/release-marimo-base.yml b/.github/workflows/release-marimo-base.yml
index a2b4898eae..3927a3ef69 100644
--- a/.github/workflows/release-marimo-base.yml
+++ b/.github/workflows/release-marimo-base.yml
@@ -28,14 +28,14 @@ jobs:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- - name: 🐍 Setup uv
- uses: astral-sh/setup-uv@v6
+ - name: 🥚 Install Hatch
+ uses: pypa/hatch@install
- name: Adapt pyproject.toml to build marimo-base
run: ./scripts/modify_pyproject_for_marimo_base.sh
- name: 📦 Build marimo-base
- run: uv build
+ run: hatch build --clean
- name: 📦 Validate wheel under 2mb
run: ./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: uvx hatch publish
+ run: hatch publish
- name: 📤 Upload to TestPyPI
env:
HATCH_INDEX_USER: ${{ secrets.TEST_PYPI_USER }}
HATCH_INDEX_AUTH: ${{ secrets.TEST_PYPI_MARIMO_BASE_PASSWORD }}
- run: uvx hatch publish --repo test
+ run: hatch publish --repo test
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 80d0b41366..ed50370a92 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -48,22 +48,22 @@ jobs:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- - name: 🐍 Setup uv
- uses: astral-sh/setup-uv@v6
+ - name: 🥚 Install Hatch
+ uses: pypa/hatch@install
- name: 📦 Build marimo
- run: uv build
+ run: hatch build
- name: 📤 Upload to PyPI
env:
HATCH_INDEX_USER: ${{ secrets.PYPI_USER }}
HATCH_INDEX_AUTH: ${{ secrets.PYPI_PASSWORD }}
- run: uvx hatch publish
+ run: hatch publish
- name: 🔨 Get version
id: get_version
run: |
- echo "marimo_version=$(uvx hatch version)" >> $GITHUB_OUTPUT
+ echo "marimo_version=$(hatch version)" >> $GITHUB_OUTPUT
- name: 📦 Update package.json version from CLI
working-directory: frontend
diff --git a/.github/workflows/test_be.yaml b/.github/workflows/test_be.yaml
index d149002e17..221fa4450f 100644
--- a/.github/workflows/test_be.yaml
+++ b/.github/workflows/test_be.yaml
@@ -40,11 +40,11 @@ jobs:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- - name: 🐍 Setup uv
- uses: astral-sh/setup-uv@v6
+ - name: ⬇️ Install Hatch
+ uses: pypa/hatch@install
- name: 📚 Build docs
- run: uvx hatch run docs:build --strict
+ run: hatch run docs:build --strict
test_python:
needs: changes
@@ -95,8 +95,8 @@ jobs:
- uses: actions/checkout@v4
- - name: 🐍 Setup uv
- uses: astral-sh/setup-uv@v6
+ - name: 🥚 Install Hatch
+ uses: pypa/hatch@install
# This step is needed since some of our tests rely on the index.html file
- name: Create assets directory, copy over index.html
@@ -107,23 +107,23 @@ jobs:
- name: Lint
if: ${{ matrix.python-version == '3.12' }}
- run: uvx hatch run lint
+ run: hatch run lint
- name: Typecheck
if: ${{ matrix.python-version == '3.12' }}
- run: uvx hatch run typecheck:check
+ run: hatch run typecheck:check
# Test with minimal dependencies
- name: Test with minimal dependencies
if: ${{ matrix.dependencies == 'core' }}
run: |
- uvx hatch run +py=${{ matrix.python-version }} test:test -v tests/ -k "not test_cli" --durations=10
+ hatch run +py=${{ matrix.python-version }} test:test -v tests/ -k "not test_cli" --durations=10
# Test with optional dependencies
- name: Test with optional dependencies
if: ${{ matrix.dependencies == 'core,optional' }}
run: |
- uvx hatch run +py=${{ matrix.python-version }} test-optional:test -v tests/ -k "not test_cli" --durations=10
+ hatch run +py=${{ matrix.python-version }} test-optional:test -v tests/ -k "not test_cli" --durations=10
# Only run coverage on `main` so it is not blocking
test_coverage:
@@ -138,8 +138,8 @@ jobs:
- uses: actions/checkout@v4
- - name: 🐍 Setup uv
- uses: astral-sh/setup-uv@v6
+ - name: 🥚 Install Hatch
+ uses: pypa/hatch@install
# This step is needed since some of our tests rely on the index.html file
- name: Create assets directory, copy over index.html
@@ -150,7 +150,7 @@ jobs:
- name: Test with optional dependencies
run: |
- uvx hatch run +py=3.12 test-optional:test -v tests/ -k "not test_cli" --durations=10 \
+ hatch run +py=3.12 test-optional:test -v tests/ -k "not test_cli" --durations=10 \
--cov=marimo --cov-report=xml --junitxml=junit.xml -o junit_family=legacy
# Only upload coverage on `main` so it is not blocking
diff --git a/.github/workflows/test_cli.yaml b/.github/workflows/test_cli.yaml
index 93cbe58eda..b69eea666f 100644
--- a/.github/workflows/test_cli.yaml
+++ b/.github/workflows/test_cli.yaml
@@ -58,11 +58,11 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
NODE_OPTIONS: '--max_old_space_size=8192'
- - name: 🐍 Setup uv
- uses: astral-sh/setup-uv@v6
+ - name: 🥚 Install Hatch
+ uses: pypa/hatch@install
- name: 📦 Build marimo wheel
- run: uv build --wheel
+ run: hatch build -t wheel
- name: Check for _static/_lsp directory in wheel
run: |
diff --git a/Makefile b/Makefile
index 833dbb2a8d..baf8ca47d5 100644
--- a/Makefile
+++ b/Makefile
@@ -26,6 +26,7 @@ check-prereqs:
@command -v pnpm >/dev/null 2>&1 || { echo "pnpm is required. See https://pnpm.io/installation"; exit 1; }
@pnpm -v | grep -vq "^[0-8]\." || { echo "pnpm v9+ is required. Current version: $(shell pnpm -v)"; exit 1; }
@command -v uv >/dev/null 2>&1 || { echo "uv is required. See https://docs.astral.sh/uv/getting-started/installation/"; exit 1; }
+ @command -v hatch >/dev/null 2>&1 || { echo "hatch is required. See https://hatch.pypa.io/dev/install/"; exit 1; }
@command -v node >/dev/null 2>&1 || { echo "Node.js is required. See https://nodejs.org/en/download/"; exit 1; }
@node -v | grep -q "v2[0-9]" || { echo "Node.js v20+ is required. Current version: $(shell node -v)"; exit 1; }
@echo "✅ All prerequisites are installed!"
@@ -89,7 +90,7 @@ e2e:
.PHONY: fe-lint
# 🧹 Lint frontend
fe-lint:
- cd frontend/src && uvx hatch run typos && cd - && pnpm --filter @marimo-team/frontend lint
+ cd frontend/src && hatch run typos && cd - && pnpm --filter @marimo-team/frontend lint
.PHONY: fe-typecheck
# 🔍 Typecheck frontend
@@ -111,18 +112,18 @@ py-check:
.PHONY: typos
# 🔍 Check for typos
typos:
- uvx hatch run typos
+ hatch run typos
.PHONY: py-test
# 🧪 Test python
py-test:
@command -v hatch >/dev/null 2>&1 || { echo "hatch is required. See https://hatch.pypa.io/dev/install/"; exit 1; }
- uvx hatch run typos && hatch run +py=3.12 test-optional:test $(ARGS)
+ hatch run typos && hatch run +py=3.12 test-optional:test $(ARGS)
.PHONY: py-snapshots
# 📸 Update snapshots
py-snapshots:
- uvx hatch run +py=3.12 test:test \
+ hatch run +py=3.12 test:test \
tests/_server/templates/test_templates.py \
tests/_server/api/endpoints/test_export.py \
tests/test_api.py
@@ -134,7 +135,7 @@ py-snapshots:
.PHONY: wheel
# 📦 Build wheel
wheel:
- uv build
+ hatch build
#################
@@ -144,12 +145,12 @@ wheel:
.PHONY: docs
# 📚 Build docs
docs:
- uvx hatch run docs:build
+ hatch run docs:build
.PHONY: docs-serve
# 📚 Serve docs
docs-serve:
- uvx hatch run docs:serve
+ hatch run docs:serve
.PHONY: storybook
# 🧩 Start Storybook for UI development