-
Notifications
You must be signed in to change notification settings - Fork 112
Rework grpc locations and add some different structure #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -0,0 +1,54 @@ | |||
import logging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can test just the protos since as I mentioned before we don't need to generate the grpc output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's reasonable not only to confirm the pure Python client works, but to show even what using a pure python gRPC client looks like. Not committing protos makes discovery horrible for code/repo readers.
@@ -0,0 +1 @@ | |||
from .core_interface_pb2 import ActivityHeartbeat, ActivityTaskCompletion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is part of the auto-generated code, but I think it still deserves to be checked in to keep the dir here. But if there's disagreement, I can remove this and add .gitkeep
to this dir instead (or just mkdir it during build).
- Install the package dependencies | ||
|
||
```bash | ||
poetry install | ||
``` | ||
|
||
- Build the project (only generate the protos for now) | ||
- Build the project | ||
|
||
```bash | ||
poe build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also a poetry build
command, I think we could integrate with that.
Not blocking this PR.
grpcio = "^1.43.0" | ||
python = "^3.7" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to restrict to python<3.10?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not 3.10? I use 3.10 successfully on Windows.
with (base_path / "__init__.py").open("w") as f: | ||
for stem, messages in imports.items(): | ||
for message in messages: | ||
f.write(f"from .{stem} import {message}\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice addition!
content = fix_api_import(content) | ||
content = fix_dependency_import(content) | ||
content = fix_sdk_import(content) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you can use a single re.sub
call with a callback https://docs.python.org/3/library/re.html#re.sub
Not blocking the PR of course.
What was changed
temporalio/proto/temporal/api
->temporalio/api
temporalio/proto/dependencies
->temporalio/api/dependencies
temporalio/proto/temporal/sdk
->temporalio/bridge/proto
LICENSE
isort
to format/lint taskmypy
lint check and mypy-protobuf supportpytest
task