Skip to content

Commit 541b97f

Browse files
fix(mise): initialize Python dependencies in fresh worktrees (#2429)
* fix(mise): Properly initialize venv for fresh worktrees Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> * fix(mise): use uv sync for protobuf generation Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> * docs: remove redundant worktree setup note Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> --------- Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
1 parent 8a14b3a commit 541b97f

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

‎architecture/build.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,11 @@ do not infer from kube context.
138138
## Python Wheel Packaging
139139

140140
The generated protobuf/gRPC stubs under `python/openshell/_proto/` are gitignored
141-
build outputs of `mise run python:proto`. maturin honors `.gitignore` when
142-
collecting `python-source` files, so native builds (Linux CI, local
143-
`pip install .`) would drop them and ship an unimportable wheel. `pyproject.toml`
141+
build outputs of `mise run python:proto`. The task uses `uv run --frozen` to
142+
synchronize the current worktree's `.venv` from `uv.lock` before generation.
143+
maturin honors `.gitignore` when collecting `python-source` files, so native
144+
builds (Linux CI, local `pip install .`) would drop them and ship an unimportable
145+
wheel. `pyproject.toml`
144146
pins them back in with `[tool.maturin].include` globs. The release workflows
145147
install each Linux wheel in a clean image and import `openshell.sandbox` as a
146148
smoke check.

‎tasks/python.toml‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,10 @@ hide = true
218218

219219
["python:proto"]
220220
description = "Generate Python protobuf stubs from .proto files"
221-
env = { UV_NO_SYNC = "1" }
222221
run = """
223222
#!/usr/bin/env bash
224223
set -euo pipefail
225-
uv run python -m grpc_tools.protoc \
224+
uv run --frozen python -m grpc_tools.protoc \
226225
-Iproto \
227226
--python_out=python/openshell/_proto \
228227
--pyi_out=python/openshell/_proto \
@@ -233,7 +232,7 @@ uv run python -m grpc_tools.protoc \
233232
proto/options.proto \
234233
proto/sandbox.proto
235234
# Fix absolute imports in generated stubs to use package-relative imports
236-
uv run python - <<'PY'
235+
uv run --frozen python - <<'PY'
237236
from pathlib import Path
238237
import re
239238

0 commit comments

Comments
 (0)