From b99782fc3fcc2eb676b970617a48d19734ca61ca Mon Sep 17 00:00:00 2001 From: Tim Conley Date: Mon, 28 Jul 2025 15:59:40 -0700 Subject: [PATCH 1/3] Pin nexus version, revert change depending on latest --- pyproject.toml | 5 +---- temporalio/nexus/_decorators.py | 2 +- uv.lock | 8 ++++++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a7e7826ea..2d3f96068 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ keywords = [ "workflow", ] dependencies = [ - "nexus-rpc>=1.1.0", + "nexus-rpc==1.1.0", "protobuf>=3.20,<6", "python-dateutil>=2.8.2,<3 ; python_version < '3.11'", "types-protobuf>=3.20", @@ -231,6 +231,3 @@ exclude = [ [tool.uv] # Prevent uv commands from building the package by default package = false - -[tool.uv.sources] -nexus-rpc = { git = "https://github.com/nexus-rpc/sdk-python.git", rev = "35f574c711193a6e2560d3e6665732a5bb7ae92c" } diff --git a/temporalio/nexus/_decorators.py b/temporalio/nexus/_decorators.py index d8675afdb..1266fd29e 100644 --- a/temporalio/nexus/_decorators.py +++ b/temporalio/nexus/_decorators.py @@ -123,7 +123,7 @@ async def _start( return WorkflowRunOperationHandler(_start, input_type, output_type) method_name = get_callable_name(start) - nexusrpc.set_operation( + nexusrpc.set_operation_definition( operation_handler_factory, nexusrpc.Operation( name=name or method_name, diff --git a/uv.lock b/uv.lock index 07b4ac4bb..13cb7bed3 100644 --- a/uv.lock +++ b/uv.lock @@ -1602,10 +1602,14 @@ wheels = [ [[package]] name = "nexus-rpc" version = "1.1.0" -source = { git = "https://github.com/nexus-rpc/sdk-python.git?rev=35f574c711193a6e2560d3e6665732a5bb7ae92c#35f574c711193a6e2560d3e6665732a5bb7ae92c" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "typing-extensions" }, ] +sdist = { url = "https://files.pythonhosted.org/packages/ef/66/540687556bd28cf1ec370cc6881456203dfddb9dab047b8979c6865b5984/nexus_rpc-1.1.0.tar.gz", hash = "sha256:d65ad6a2f54f14e53ebe39ee30555eaeb894102437125733fb13034a04a44553", size = 77383, upload-time = "2025-07-07T19:03:58.368Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bf/2f/9e9d0dcaa4c6ffa22b7aa31069a8a264c753ff8027b36af602cce038c92f/nexus_rpc-1.1.0-py3-none-any.whl", hash = "sha256:d1b007af2aba186a27e736f8eaae39c03aed05b488084ff6c3d1785c9ba2ad38", size = 27743, upload-time = "2025-07-07T19:03:57.556Z" }, +] [[package]] name = "nh3" @@ -2754,7 +2758,7 @@ dev = [ requires-dist = [ { name = "eval-type-backport", marker = "python_full_version < '3.10' and extra == 'openai-agents'", specifier = ">=0.2.2" }, { name = "grpcio", marker = "extra == 'grpc'", specifier = ">=1.48.2,<2" }, - { name = "nexus-rpc", git = "https://github.com/nexus-rpc/sdk-python.git?rev=35f574c711193a6e2560d3e6665732a5bb7ae92c" }, + { name = "nexus-rpc", specifier = "==1.1.0" }, { name = "openai-agents", marker = "extra == 'openai-agents'", specifier = ">=0.2.3,<0.3" }, { name = "opentelemetry-api", marker = "extra == 'opentelemetry'", specifier = ">=1.11.1,<2" }, { name = "opentelemetry-sdk", marker = "extra == 'opentelemetry'", specifier = ">=1.11.1,<2" }, From 485068df879f562d17bc794902c594faf4e3b5e2 Mon Sep 17 00:00:00 2001 From: Tim Conley Date: Mon, 28 Jul 2025 16:00:32 -0700 Subject: [PATCH 2/3] Temporarily add build binaries to PR for validation --- .github/workflows/build-binaries.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index be818370f..1df9b82a8 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -1,5 +1,6 @@ name: Build Binaries on: + pull_request: push: branches: - main From 8f8e683f11bee77a28a5c94db2ec8e2e79715190 Mon Sep 17 00:00:00 2001 From: Tim Conley Date: Mon, 28 Jul 2025 16:08:58 -0700 Subject: [PATCH 3/3] Revert additional changes for compilation against 1.1.0 --- temporalio/worker/_interceptor.py | 4 ++-- tests/nexus/test_dynamic_creation_of_user_handler_classes.py | 4 ++-- tests/nexus/test_handler_operation_definitions.py | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/temporalio/worker/_interceptor.py b/temporalio/worker/_interceptor.py index 32ce66e0b..7ab5c056c 100644 --- a/temporalio/worker/_interceptor.py +++ b/temporalio/worker/_interceptor.py @@ -306,7 +306,7 @@ def __post_init__(self) -> None: if isinstance(self.operation, nexusrpc.Operation): self.output_type = self.operation.output_type elif callable(self.operation): - if op := nexusrpc.get_operation(self.operation): + if op := nexusrpc.get_operation_definition(self.operation): self.output_type = op.output_type else: raise ValueError( @@ -325,7 +325,7 @@ def operation_name(self) -> str: elif isinstance(self.operation, str): return self.operation elif callable(self.operation): - if op := nexusrpc.get_operation(self.operation): + if op := nexusrpc.get_operation_definition(self.operation): return op.name else: raise ValueError( diff --git a/tests/nexus/test_dynamic_creation_of_user_handler_classes.py b/tests/nexus/test_dynamic_creation_of_user_handler_classes.py index 3df085d01..37c2bf498 100644 --- a/tests/nexus/test_dynamic_creation_of_user_handler_classes.py +++ b/tests/nexus/test_dynamic_creation_of_user_handler_classes.py @@ -76,8 +76,8 @@ async def test_run_nexus_service_from_programmatically_created_service_handler( service_handler = nexusrpc.handler._core.ServiceHandler( service=nexusrpc.ServiceDefinition( name="MyService", - operation_definitions={ - "increment": nexusrpc.OperationDefinition[int, int]( + operations={ + "increment": nexusrpc.Operation[int, int]( name="increment", method_name="increment", input_type=int, diff --git a/tests/nexus/test_handler_operation_definitions.py b/tests/nexus/test_handler_operation_definitions.py index 82a0682fb..80f5160d1 100644 --- a/tests/nexus/test_handler_operation_definitions.py +++ b/tests/nexus/test_handler_operation_definitions.py @@ -95,7 +95,9 @@ async def test_collected_operation_names( assert isinstance(service_defn, nexusrpc.ServiceDefinition) assert service_defn.name == "Service" for method_name, expected_op in test_case.expected_operations.items(): - actual_op = nexusrpc.get_operation(getattr(test_case.Service, method_name)) + actual_op = nexusrpc.get_operation_definition( + getattr(test_case.Service, method_name) + ) assert isinstance(actual_op, nexusrpc.Operation) assert actual_op.name == expected_op.name assert actual_op.input_type == expected_op.input_type