Commit 4458828
fix: detect missing proto outputs in iris hatch build hook (#3710)
## Summary
- The hatch build hook only compared timestamps to decide if proto
regeneration was needed. Adding `query.proto` (#3649) without a matching
`query_pb2.py` broke all local `iris` CLI usage with `ImportError:
cannot import name 'query_pb2'`.
- Add `_has_missing_outputs()` to detect `.proto` files without a
corresponding `_pb2.py`, and use it in the rebuild decision and fallback
paths (missing `npx`/generate script) so they raise instead of silently
continuing with incomplete outputs.
- Add the missing `query_pb2` import to `rpc/__init__.py` (descriptor
pool load order requires it before `cluster_pb2`).
Fixes #3709
## Test plan
- [x] Reproduced `ImportError` on main, confirmed fix resolves it
- [x] Verified `uv run iris --help` loads cleanly after fix
- [x] Verified `_has_missing_outputs` correctly returns `True` when a
`_pb2.py` is absent and `False` when all are present
- [x] Pre-commit passes on changed files
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 73970cc commit 4458828
2 files changed
+14
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
58 | 63 | | |
59 | 64 | | |
60 | 65 | | |
| |||
77 | 82 | | |
78 | 83 | | |
79 | 84 | | |
80 | | - | |
| 85 | + | |
81 | 86 | | |
82 | | - | |
| 87 | + | |
83 | 88 | | |
84 | 89 | | |
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
88 | | - | |
| 93 | + | |
89 | 94 | | |
90 | 95 | | |
91 | 96 | | |
| |||
94 | 99 | | |
95 | 100 | | |
96 | 101 | | |
97 | | - | |
| 102 | + | |
98 | 103 | | |
99 | 104 | | |
100 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
0 commit comments