Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Commit 35db5bb

Browse files
rename and fix protobuf generation Makefile target
Use "make protobuf-gen" to be consistent with controller. In python the imports need to be post-processed, unfortunately.
1 parent 5bfe9fd commit 35db5bb

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

Makefile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ help:
88
@echo ""
99
@echo "Build targets:"
1010
@echo " build - Build all packages"
11-
@echo " generate - Generate code from protobuf definitions"
11+
@echo " protobuf-gen - Generate code from protobuf definitions"
1212
@echo " sync - Sync all packages and extras"
1313
@echo ""
1414
@echo "Documentation targets:"
@@ -75,8 +75,18 @@ pkg-ty-all: $(addprefix pkg-ty-,$(PKG_TARGETS))
7575
build:
7676
uv build --all --out-dir dist
7777

78-
generate:
79-
buf generate
78+
protobuf-gen:
79+
podman run --volume "$(shell pwd):/workspace" --workdir /workspace docker.io/bufbuild/buf:latest generate
80+
# Fix Python imports: convert absolute imports to relative imports
81+
# In jumpstarter/client/v1: from jumpstarter.v1 import -> from ...v1 import
82+
find packages/jumpstarter-protocol/jumpstarter_protocol/jumpstarter/client/v1 -name "*_pb2*.py" -type f -exec sed -i.bak \
83+
-e 's|^from jumpstarter\.v1 import|from ...v1 import|g' \
84+
-e 's|^from jumpstarter\.client\.v1 import|from . import|g' \
85+
{} \; -exec rm {}.bak \;
86+
# In jumpstarter/v1: from jumpstarter.v1 import -> from . import
87+
find packages/jumpstarter-protocol/jumpstarter_protocol/jumpstarter/v1 -name "*_pb2*.py" -type f -exec sed -i.bak \
88+
-e 's|^from jumpstarter\.v1 import|from . import|g' \
89+
{} \; -exec rm {}.bak \;
8090

8191
sync:
8292
uv sync --all-packages --all-extras

buf.gen.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ plugins:
88
out: ./packages/jumpstarter-protocol/jumpstarter_protocol
99
inputs:
1010
- git_repo: https://github.com/jumpstarter-dev/jumpstarter-protocol.git
11+
branch: main
1112
subdir: proto

0 commit comments

Comments
 (0)