Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions architecture/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 2 additions & 3 deletions tasks/python.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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

Expand Down
Loading