Skip to content

Conversation

@cretz
Copy link
Member

@cretz cretz commented Jun 7, 2022

What was changed

  • Add all generated protos
  • Add CI check to confirm that they are accurate

Why?

  • macOS M1 doesn't have good grpcio tool support in Python so asking users to generate code is tough
  • Having all code available in the repo is good for people browsing code and for code tools that pull directly from the repo
  • Allows us to have source links on API docs if/when we want

cretz added 2 commits June 9, 2022 11:06
# Conflicts:
#	.github/workflows/ci.yml
#	README.md
#	temporalio/worker/workflow.py
#	tests/worker/test_workflow.py
@cretz cretz marked this pull request as ready for review June 9, 2022 16:42
@cretz cretz requested review from a team and bergundy June 9, 2022 16:42
@@ -0,0 +1,33 @@
from .message_pb2 import (
Copy link
Member Author

@cretz cretz Jun 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every file starting here is auto-generated

with (base_path / "__init__.py").open("w") as f:
# Add docstring to API's init
if str(base_path.as_posix()).endswith("/temporal/api"):
f.write('"""gRPC API."""\n')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Member Author

@cretz cretz Jun 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we fail my poe lint-docs test because it's a package with no API. Notice right now at https://python.temporal.io/ we don't have a summary doc for just the temporal.api package. That's because I had traditionally gen'd docs after protos (which is after the doc linter) and didn't have this here.

- os: ubuntu-latest
python: 3.10
docsTarget: true
protoCheckTarget: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this in TS and TBH it's probably better to just have a separate build for docs and proto check to avoid delaying the entire pipeline.

Copy link
Member Author

@cretz cretz Jun 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fast enough, and it's on the fastest target so still gets done before mac/windows. Proto gen is quite fast.

@cretz cretz merged commit 0f134e2 into temporalio:main Jun 9, 2022
@cretz cretz deleted the protos branch June 9, 2022 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants