diff --git a/architecture/build.md b/architecture/build.md index 63d4e56849..cc94d17eaa 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`. 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 3aa9727ebf..e04bf27bb4 100644 --- a/tasks/python.toml +++ b/tasks/python.toml @@ -218,11 +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 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 \ @@ -233,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