Skip to content

Commit 0b00bcf

Browse files
committed
Proto regen
1 parent 3e0af65 commit 0b00bcf

6 files changed

Lines changed: 99 additions & 87 deletions

File tree

scripts/gen_protos.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
re.compile(r"'__module__' : 'temporal\.api\.").sub,
5555
r"'__module__' : 'temporalio.api.",
5656
),
57+
partial(
58+
re.compile(r"'__module__' : 'nexusannotations\.").sub,
59+
r"'__module__' : 'temporalio.api.dependencies.nexusannotations.",
60+
),
5761
]
5862

5963
pyi_fixes = [
@@ -201,10 +205,11 @@ def generate_protos(output_dir: Path):
201205
fix_generated_output(output_dir)
202206
# Move dependency protos
203207
deps_out_dir = api_out_dir / "dependencies"
208+
shutil.rmtree(deps_out_dir / "protoc_gen_openapiv2", ignore_errors=True)
209+
shutil.rmtree(deps_out_dir / "nexusannotations", ignore_errors=True)
204210
deps_out_dir.mkdir(exist_ok=True)
205-
for dep in ["protoc_gen_openapiv2", "nexusannotations"]:
206-
shutil.rmtree(deps_out_dir / dep, ignore_errors=True)
207-
(output_dir / dep).replace(deps_out_dir / dep)
211+
(output_dir / "protoc_gen_openapiv2").replace(deps_out_dir / "protoc_gen_openapiv2")
212+
(output_dir / "nexusannotations").replace(deps_out_dir / "nexusannotations")
208213
(deps_out_dir / "__init__.py").touch()
209214
# Move protos
210215
for p in (output_dir / "temporal" / "api").iterdir():

scripts/gen_protos_docker.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,28 @@
1717
)
1818
image_id = result.stdout.strip()
1919

20-
subprocess.run(
20+
docker_run_command = [
21+
"docker",
22+
"run",
23+
"--rm",
24+
]
25+
26+
getuid = getattr(os, "getuid", None)
27+
getgid = getattr(os, "getgid", None)
28+
if callable(getuid) and callable(getgid):
29+
docker_run_command.extend(["--user", f"{getuid()}:{getgid()}"])
30+
31+
docker_run_command.extend(
2132
[
22-
"docker",
23-
"run",
24-
"--rm",
2533
"-v",
2634
os.path.join(os.getcwd(), "temporalio", "api") + ":/api_new",
2735
"-v",
2836
os.path.join(os.getcwd(), "temporalio", "bridge", "proto") + ":/bridge_new",
2937
image_id,
30-
],
38+
]
39+
)
40+
41+
subprocess.run(
42+
docker_run_command,
3143
check=True,
3244
)

temporalio/api/activity/v1/message_pb2.py

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporalio/api/activity/v1/message_pb2.pyi

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ class ActivityExecutionInfo(google.protobuf.message.Message):
209209
TOTAL_HEARTBEAT_COUNT_FIELD_NUMBER: builtins.int
210210
SDK_NAME_FIELD_NUMBER: builtins.int
211211
SDK_VERSION_FIELD_NUMBER: builtins.int
212-
START_DELAY_FIELD_NUMBER: builtins.int
213212
activity_id: builtins.str
214213
"""Unique identifier of this activity within its namespace along with run ID (below)."""
215214
run_id: builtins.str
@@ -342,9 +341,6 @@ class ActivityExecutionInfo(google.protobuf.message.Message):
342341
"""The version of the SDK of the worker that most recently picked up an attempt of this activity.
343342
Overwritten on each new attempt. Empty if unknown.
344343
"""
345-
@property
346-
def start_delay(self) -> google.protobuf.duration_pb2.Duration:
347-
"""Time to wait before dispatching the first activity task. This delay is not applied to retry attempts."""
348344
def __init__(
349345
self,
350346
*,
@@ -390,7 +386,6 @@ class ActivityExecutionInfo(google.protobuf.message.Message):
390386
total_heartbeat_count: builtins.int = ...,
391387
sdk_name: builtins.str = ...,
392388
sdk_version: builtins.str = ...,
393-
start_delay: google.protobuf.duration_pb2.Duration | None = ...,
394389
) -> None: ...
395390
def HasField(
396391
self,

temporalio/api/dependencies/nexusannotations/v1/options_pb2.py

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporalio/api/workflowservice/v1/request_response_pb2.py

Lines changed: 62 additions & 62 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)