From dc0a686412215b07943f956dd606ac411f102dcd Mon Sep 17 00:00:00 2001 From: Matthew Grossman Date: Wed, 22 Jul 2026 13:40:31 -0700 Subject: [PATCH 1/3] fix(mise): Properly initialize venv for fresh worktrees Signed-off-by: Matthew Grossman --- CONTRIBUTING.md | 4 ++++ architecture/build.md | 8 +++++--- tasks/python.toml | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e20d618d20..47598f382e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -181,6 +181,10 @@ mise trust mise run gateway ``` +Python tasks install the locked development dependencies into the current +worktree's `.venv` when needed. You do not need to share or manually populate a +virtual environment across worktrees. + ## Building the `openshell` CLI Inside this repository, `openshell` is a local shortcut script at `scripts/bin/openshell`. The script will diff --git a/architecture/build.md b/architecture/build.md index 63d4e56849..529b503ec4 100644 --- a/architecture/build.md +++ b/architecture/build.md @@ -133,9 +133,11 @@ do not infer from kube context. ## Python Wheel Packaging The generated protobuf/gRPC stubs under `python/openshell/_proto/` are gitignored -build outputs of `mise run python:proto`. maturin honors `.gitignore` when -collecting `python-source` files, so native builds (Linux CI, local -`pip install .`) would drop them and ship an unimportable wheel. `pyproject.toml` +build outputs of `mise run python:proto`. Before generation, the task installs +the locked development dependencies into the current worktree's `.venv`; its +subsequent `uv run` commands disable implicit synchronization. maturin honors +`.gitignore` when collecting `python-source` files, so native builds (Linux CI, +local `pip install .`) would drop them and ship an unimportable wheel. `pyproject.toml` pins them back in with `[tool.maturin].include` globs. The release workflows install each Linux wheel in a clean image and import `openshell.sandbox` as a smoke check. diff --git a/tasks/python.toml b/tasks/python.toml index 3aa9727ebf..a57f8f0aac 100644 --- a/tasks/python.toml +++ b/tasks/python.toml @@ -222,6 +222,7 @@ env = { UV_NO_SYNC = "1" } run = """ #!/usr/bin/env bash set -euo pipefail +uv sync --frozen --group dev uv run python -m grpc_tools.protoc \ -Iproto \ --python_out=python/openshell/_proto \ From d2987925c632691e37a7ab7af08036937575a2f2 Mon Sep 17 00:00:00 2001 From: Matthew Grossman Date: Wed, 22 Jul 2026 15:41:09 -0700 Subject: [PATCH 2/3] fix(mise): use uv sync for protobuf generation Signed-off-by: Matthew Grossman --- architecture/build.md | 10 +++++----- tasks/python.toml | 6 ++---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/architecture/build.md b/architecture/build.md index 529b503ec4..cc94d17eaa 100644 --- a/architecture/build.md +++ b/architecture/build.md @@ -133,11 +133,11 @@ do not infer from kube context. ## Python Wheel Packaging The generated protobuf/gRPC stubs under `python/openshell/_proto/` are gitignored -build outputs of `mise run python:proto`. Before generation, the task installs -the locked development dependencies into the current worktree's `.venv`; its -subsequent `uv run` commands disable implicit synchronization. maturin honors -`.gitignore` when collecting `python-source` files, so native builds (Linux CI, -local `pip install .`) would drop them and ship an unimportable wheel. `pyproject.toml` +build outputs of `mise run python:proto`. The task uses `uv run --frozen` to +synchronize the current worktree's `.venv` from `uv.lock` before generation. +maturin honors `.gitignore` when collecting `python-source` files, so native +builds (Linux CI, local `pip install .`) would drop them and ship an unimportable +wheel. `pyproject.toml` pins them back in with `[tool.maturin].include` globs. The release workflows install each Linux wheel in a clean image and import `openshell.sandbox` as a smoke check. diff --git a/tasks/python.toml b/tasks/python.toml index a57f8f0aac..e04bf27bb4 100644 --- a/tasks/python.toml +++ b/tasks/python.toml @@ -218,12 +218,10 @@ hide = true ["python:proto"] description = "Generate Python protobuf stubs from .proto files" -env = { UV_NO_SYNC = "1" } run = """ #!/usr/bin/env bash set -euo pipefail -uv sync --frozen --group dev -uv run python -m grpc_tools.protoc \ +uv run --frozen python -m grpc_tools.protoc \ -Iproto \ --python_out=python/openshell/_proto \ --pyi_out=python/openshell/_proto \ @@ -234,7 +232,7 @@ uv run python -m grpc_tools.protoc \ proto/options.proto \ proto/sandbox.proto # Fix absolute imports in generated stubs to use package-relative imports -uv run python - <<'PY' +uv run --frozen python - <<'PY' from pathlib import Path import re From 647a1a2378149c2359550cb1643d2571be534868 Mon Sep 17 00:00:00 2001 From: Matthew Grossman Date: Wed, 22 Jul 2026 15:47:39 -0700 Subject: [PATCH 3/3] docs: remove redundant worktree setup note Signed-off-by: Matthew Grossman --- CONTRIBUTING.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 47598f382e..e20d618d20 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -181,10 +181,6 @@ mise trust mise run gateway ``` -Python tasks install the locked development dependencies into the current -worktree's `.venv` when needed. You do not need to share or manually populate a -virtual environment across worktrees. - ## Building the `openshell` CLI Inside this repository, `openshell` is a local shortcut script at `scripts/bin/openshell`. The script will