Skip to content
Open
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
6 changes: 6 additions & 0 deletions .github/workflows/branch-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,18 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Mark workspace as safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

- name: Install tools
run: mise install --locked

- name: Install dependencies
run: uv sync --frozen

- name: Proto stubs freshness
run: mise run python:proto:check

- name: Format
run: mise run python:format:check

Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,6 @@ dmypy.json
# Cython debug symbols
cython_debug/

# Generated Python protobuf stubs (keep package marker)
python/openshell/_proto/*
!python/openshell/_proto/__init__.py

# =============================================================================
# IDE / Editor
Expand Down
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,21 @@ These are the primary `mise` tasks for day-to-day development:
| `mise run helm:docs` | Regenerate the Helm chart README |
| `mise run clean` | Clean build artifacts |

### Protobuf Stubs

The Python SDK depends on generated protobuf/gRPC stubs committed under
`python/openshell/_proto/`. After changing any `.proto` file in `proto/`,
regenerate the stubs and commit the result:

```shell
mise run python:proto
git add python/openshell/_proto/
```

The generation output is deterministic across Python versions because
`grpcio-tools` is pinned via `uv.lock`. CI runs `mise run python:proto:check`
to reject PRs with stale stubs. The local `mise run pre-commit` also catches
this.
### Bazel targets (experimental)

> [!IMPORTANT]
Expand Down
19 changes: 10 additions & 9 deletions architecture/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,16 @@ for explicit publication.

## Python Wheel Packaging

The generated protobuf/gRPC stubs under `python/openshell/_proto/` are gitignored
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.
The generated protobuf/gRPC stubs under `python/openshell/_proto/` are committed
to the repository so that standard PEP 517 build frontends (pip, build, fromager)
can produce working wheels from the source tarball without replicating the mise
task graph. After modifying any `.proto` file under `proto/`, regenerate the stubs
with `mise run python:proto` and commit the result. The task uses
`uv run --frozen` to pin `grpcio-tools` via `uv.lock`, so the output is
deterministic regardless of the contributor's Python version. CI enforces
freshness: `mise run python:proto:check` regenerates the stubs and fails if the
working tree differs. The release workflows install each Linux wheel in a clean
image and import `openshell.sandbox` as a smoke check.

## CI and E2E

Expand Down
7 changes: 0 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,6 @@ bindings = "bin"
manifest-path = "crates/openshell-cli/Cargo.toml"
python-source = "python"
module-name = "openshell"
# _proto/ stubs are gitignored; force them into the wheel so git-aware
# maturin builds don't drop them (package-relative paths).
include = [
"openshell/_proto/*_pb2.py",
"openshell/_proto/*_pb2_grpc.py",
"openshell/_proto/*.pyi",
]

[tool.ruff]
target-version = "py311"
Expand Down
67 changes: 67 additions & 0 deletions python/openshell/_proto/datamodel_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

103 changes: 103 additions & 0 deletions python/openshell/_proto/datamodel_pb2.pyi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions python/openshell/_proto/datamodel_pb2_grpc.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading