-
Notifications
You must be signed in to change notification settings - Fork 141
Generate RPC calls in Bridge Client #1123
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
168aa7c
Add initial draft of rpc call generation
VegetarianOrc 8ac8f31
remove test log statement. Reorder gen_bridge_client.py
VegetarianOrc 3e01e9b
Add generation of python services. Update a couple tests to avoid rel…
VegetarianOrc f43225a
remove debug prints
VegetarianOrc 77c4dd8
run format after generating files
VegetarianOrc d34886b
Remove debug print. Remove unused imports. Fully qualify generated im…
VegetarianOrc 2812a80
add call to cargo fmt after generation. Move generated python service…
VegetarianOrc e427c15
Remove some prints. Add simple test that confirms start_batch_operati…
VegetarianOrc 888e1f8
remove simple test in favor of a more thorough check for 'unknown rpc…
VegetarianOrc bb4dca4
Add generated doc strings and remove exception from pydocstyle
VegetarianOrc 8a35b88
Merge branch 'main' into bridge/generate_rpc_calls
VegetarianOrc 257395c
Try out reference descriptors directly rather than using importlib
VegetarianOrc aa7c20e
Add googleapis-common-protos to dev dependencies.
VegetarianOrc b6ac958
Merge branch 'main' into bridge/generate_rpc_calls
VegetarianOrc 764cc3e
Update test to explicitly pass on RPCError and explictly fail on Valu…
VegetarianOrc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,29 +6,23 @@ authors = [{ name = "Temporal Technologies Inc", email = "sdk@temporal.io" }] | |
| requires-python = ">=3.9" | ||
| readme = "README.md" | ||
| license = { file = "LICENSE" } | ||
| keywords = [ | ||
| "temporal", | ||
| "workflow", | ||
| ] | ||
| keywords = ["temporal", "workflow"] | ||
| dependencies = [ | ||
| "nexus-rpc==1.1.0", | ||
| "protobuf>=3.20,<7.0.0", | ||
| "python-dateutil>=2.8.2,<3 ; python_version < '3.11'", | ||
| "types-protobuf>=3.20", | ||
| "typing-extensions>=4.2.0,<5", | ||
| "nexus-rpc==1.1.0", | ||
| "protobuf>=3.20,<7.0.0", | ||
| "python-dateutil>=2.8.2,<3 ; python_version < '3.11'", | ||
| "types-protobuf>=3.20", | ||
| "typing-extensions>=4.2.0,<5", | ||
| ] | ||
|
|
||
| [project.optional-dependencies] | ||
| grpc = ["grpcio>=1.48.2,<2"] | ||
| opentelemetry = [ | ||
| "opentelemetry-api>=1.11.1,<2", | ||
| "opentelemetry-sdk>=1.11.1,<2", | ||
| ] | ||
| opentelemetry = ["opentelemetry-api>=1.11.1,<2", "opentelemetry-sdk>=1.11.1,<2"] | ||
| pydantic = ["pydantic>=2.0.0,<3"] | ||
| openai-agents = [ | ||
| "openai-agents>=0.3,<0.4", | ||
| "eval-type-backport>=0.2.2; python_version < '3.10'", | ||
| "mcp>=1.9.4, <2; python_version >= '3.10'", | ||
| "openai-agents>=0.3,<0.4", | ||
| "eval-type-backport>=0.2.2; python_version < '3.10'", | ||
| "mcp>=1.9.4, <2; python_version >= '3.10'", | ||
| ] | ||
|
|
||
| [project.urls] | ||
|
|
@@ -39,48 +33,51 @@ Documentation = "https://docs.temporal.io/docs/python" | |
|
|
||
| [dependency-groups] | ||
| dev = [ | ||
| "cibuildwheel>=2.22.0,<3", | ||
| "grpcio-tools>=1.48.2,<2", | ||
| "mypy==1.4.1", | ||
| "mypy-protobuf>=3.3.0,<4", | ||
| "psutil>=5.9.3,<6", | ||
| "pydocstyle>=6.3.0,<7", | ||
| "pydoctor>=24.11.1,<25", | ||
| "pyright==1.1.403", | ||
| "pytest~=7.4", | ||
| "pytest-asyncio>=0.21,<0.22", | ||
| "pytest-timeout~=2.2", | ||
| "ruff>=0.5.0,<0.6", | ||
| "toml>=0.10.2,<0.11", | ||
| "twine>=4.0.1,<5", | ||
| "ruff>=0.5.0,<0.6", | ||
| "maturin>=1.8.2", | ||
| "pytest-cov>=6.1.1", | ||
| "httpx>=0.28.1", | ||
| "pytest-pretty>=1.3.0", | ||
| "openai-agents[litellm]>=0.3,<0.4" | ||
| "cibuildwheel>=2.22.0,<3", | ||
| "grpcio-tools>=1.48.2,<2", | ||
| "mypy==1.4.1", | ||
| "mypy-protobuf>=3.3.0,<4", | ||
| "psutil>=5.9.3,<6", | ||
| "pydocstyle>=6.3.0,<7", | ||
| "pydoctor>=24.11.1,<25", | ||
| "pyright==1.1.403", | ||
| "pytest~=7.4", | ||
| "pytest-asyncio>=0.21,<0.22", | ||
| "pytest-timeout~=2.2", | ||
| "ruff>=0.5.0,<0.6", | ||
| "toml>=0.10.2,<0.11", | ||
| "twine>=4.0.1,<5", | ||
| "maturin>=1.8.2", | ||
| "pytest-cov>=6.1.1", | ||
| "httpx>=0.28.1", | ||
| "pytest-pretty>=1.3.0", | ||
| "openai-agents[litellm]>=0.3,<0.4", | ||
| "googleapis-common-protos==1.70.0", | ||
| ] | ||
|
|
||
| [tool.poe.tasks] | ||
| build-develop = "uv run maturin develop --uv" | ||
| build-develop-with-release = { cmd = "uv run maturin develop --release --uv" } | ||
| format = [{cmd = "uv run ruff check --select I --fix"}, {cmd = "uv run ruff format"}, ] | ||
| format = [ | ||
| { cmd = "uv run ruff check --select I --fix" }, | ||
| { cmd = "uv run ruff format" }, | ||
| ] | ||
| gen-docs = "uv run scripts/gen_docs.py" | ||
| gen-protos = "uv run scripts/gen_protos.py" | ||
| gen-protos-docker = "uv run scripts/gen_protos_docker.py" | ||
|
Comment on lines
66
to
67
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @VegetarianOrc - to confirm, we decided to move the simple uv-run type of steps out of gen_protos_docker any as poe sub-commands to these two commands right? |
||
| lint = [ | ||
| {cmd = "uv run ruff check --select I"}, | ||
| {cmd = "uv run ruff format --check"}, | ||
| {ref = "lint-types"}, | ||
| {ref = "lint-docs"}, | ||
| { cmd = "uv run ruff check --select I" }, | ||
| { cmd = "uv run ruff format --check" }, | ||
| { ref = "lint-types" }, | ||
| { ref = "lint-docs" }, | ||
| ] | ||
| bridge-lint = { cmd = "cargo clippy -- -D warnings", cwd = "temporalio/bridge" } | ||
| # TODO(cretz): Why does pydocstyle complain about @overload missing docs after | ||
| # https://github.com/PyCQA/pydocstyle/pull/511? | ||
| lint-docs = "uv run pydocstyle --ignore-decorators=overload" | ||
| lint-types = [ | ||
| { cmd = "uv run pyright"}, | ||
| { cmd = "uv run mypy --namespace-packages --check-untyped-defs ."}, | ||
| { cmd = "uv run pyright" }, | ||
| { cmd = "uv run mypy --namespace-packages --check-untyped-defs ." }, | ||
| ] | ||
| run-bench = "uv run python scripts/run_bench.py" | ||
| test = "uv run pytest" | ||
|
|
@@ -120,7 +117,7 @@ ignore_missing_imports = true | |
| exclude = [ | ||
| # Ignore generated code | ||
| 'temporalio/api', | ||
| 'temporalio/bridge/proto' | ||
| 'temporalio/bridge/proto', | ||
| ] | ||
|
|
||
| [tool.pydocstyle] | ||
|
|
@@ -130,7 +127,8 @@ match_dir = "^(?!(docs|scripts|tests|api|proto|\\.)).*" | |
| add_ignore = [ | ||
| # We like to wrap at a certain number of chars, even long summary sentences. | ||
| # https://github.com/PyCQA/pydocstyle/issues/184 | ||
| "D205", "D415" | ||
| "D205", | ||
| "D415", | ||
| ] | ||
|
|
||
| [tool.pydoctor] | ||
|
|
@@ -226,9 +224,7 @@ manifest-path = "temporalio/bridge/Cargo.toml" | |
| module-name = "temporalio.bridge.temporal_sdk_bridge" | ||
| python-packages = ["temporalio"] | ||
| include = ["LICENSE"] | ||
| exclude = [ | ||
| "temporalio/bridge/target/**/*", | ||
| ] | ||
| exclude = ["temporalio/bridge/target/**/*"] | ||
|
|
||
| [tool.uv] | ||
| # Prevent uv commands from building the package by default | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@tconley1428 , want to confirm with you that adding this
googleapis-common-protosto this dev dependecy list won't cause any adverse effects. The new test that imports to proto descriptors relies on it, but if it's not reasonable to add, I'll modify the test to take a different approach.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 don't think there's any adverse impact. It would only affect folks working on the repo, not library users. If it is needed to improve the test coverage, worth it I'd say.