cadence-python-client 0.2.2__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/.cursorrules +1 -1
  2. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/.github/workflows/ci_checks.yml +9 -4
  3. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/Makefile +15 -9
  4. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/PKG-INFO +54 -61
  5. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/README.md +50 -54
  6. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/rpc/error.py +24 -24
  7. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/rpc/retry.py +17 -13
  8. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/rpc/yarpc.py +7 -8
  9. cadence_python_client-0.3.0/cadence/_internal/workflow/context.py +305 -0
  10. cadence_python_client-0.3.0/cadence/_internal/workflow/memo.py +40 -0
  11. cadence_python_client-0.3.0/cadence/_internal/workflow/statemachine/child_workflow_execution_state_machine.py +184 -0
  12. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/workflow/statemachine/decision_manager.py +78 -13
  13. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/workflow/statemachine/event_dispatcher.py +30 -5
  14. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/workflow/statemachine/nondeterminism.py +88 -0
  15. cadence_python_client-0.3.0/cadence/_internal/workflow/statemachine/signal_external_workflow_state_machine.py +74 -0
  16. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/workflow/workflow_engine.py +26 -2
  17. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/workflow/workflow_instance.py +33 -0
  18. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/common_pb2.py +13 -31
  19. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/common_pb2.pyi +2 -31
  20. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/schedule_pb2.py +8 -8
  21. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/schedule_pb2.pyi +6 -2
  22. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/service_domain_pb2.py +32 -32
  23. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/service_domain_pb2.pyi +4 -2
  24. cadence_python_client-0.3.0/cadence/api/v1/tasklist_pb2.py +78 -0
  25. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/tasklist_pb2.pyi +4 -2
  26. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/client.py +317 -3
  27. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/contrib/openai/cadence_tool.py +6 -0
  28. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/error.py +39 -0
  29. cadence_python_client-0.3.0/cadence/query.py +103 -0
  30. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/worker/_decision_task_handler.py +114 -15
  31. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/workflow.py +227 -8
  32. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence_python_client.egg-info/PKG-INFO +54 -61
  33. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence_python_client.egg-info/SOURCES.txt +14 -1
  34. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence_python_client.egg-info/requires.txt +1 -4
  35. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/pyproject.toml +5 -6
  36. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/_internal/rpc/test_error.py +7 -5
  37. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/_internal/rpc/test_retry.py +7 -5
  38. cadence_python_client-0.3.0/tests/cadence/_internal/workflow/statemachine/test_child_workflow_execution_state_machine.py +331 -0
  39. cadence_python_client-0.3.0/tests/cadence/_internal/workflow/statemachine/test_decision_manager.py +535 -0
  40. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/_internal/workflow/statemachine/test_nondeterminism.py +90 -0
  41. cadence_python_client-0.3.0/tests/cadence/_internal/workflow/statemachine/test_signal_external_workflow_state_machine.py +101 -0
  42. cadence_python_client-0.3.0/tests/cadence/_internal/workflow/test_context_child_workflow.py +452 -0
  43. cadence_python_client-0.3.0/tests/cadence/_internal/workflow/test_context_signal_child_workflow.py +256 -0
  44. cadence_python_client-0.3.0/tests/cadence/_internal/workflow/test_memo.py +53 -0
  45. cadence_python_client-0.3.0/tests/cadence/_internal/workflow/test_query_handling.py +545 -0
  46. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/_internal/workflow/test_retry_policy.py +15 -16
  47. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/_internal/workflow/test_waiter.py +4 -2
  48. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/test_client.py +26 -0
  49. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/test_client_workflow.py +26 -0
  50. cadence_python_client-0.3.0/tests/cadence/test_schedule.py +350 -0
  51. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/worker/test_decision_task_handler.py +40 -9
  52. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/worker/test_decision_task_handler_integration.py +5 -5
  53. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/worker/test_task_handler_integration.py +50 -15
  54. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/integration_tests/docker-compose.yml +1 -1
  55. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/integration_tests/nondeterminism/test_nondeterministic_workflows.py +8 -9
  56. cadence_python_client-0.3.0/tests/integration_tests/test_schedule.py +183 -0
  57. cadence_python_client-0.3.0/tests/integration_tests/workflow/test_child_workflow.py +231 -0
  58. cadence_python_client-0.3.0/tests/integration_tests/workflow/test_query.py +435 -0
  59. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/integration_tests/workflow/test_retry_policy.py +2 -2
  60. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/integration_tests/workflow/test_signals.py +2 -1
  61. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/uv.lock +17 -173
  62. cadence_python_client-0.2.2/cadence/_internal/workflow/context.py +0 -148
  63. cadence_python_client-0.2.2/cadence/api/v1/tasklist_pb2.py +0 -78
  64. cadence_python_client-0.2.2/scripts/dev.py +0 -187
  65. cadence_python_client-0.2.2/tests/cadence/_internal/workflow/statemachine/test_decision_manager.py +0 -190
  66. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/.github/dco.yml +0 -0
  67. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/.github/pull_request_template.md +0 -0
  68. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/.github/workflows/python-publish.yml +0 -0
  69. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/.github/workflows/semantic-pr.yml +0 -0
  70. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/.gitignore +0 -0
  71. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/.gitmodules +0 -0
  72. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/CONTRIBUTING.md +0 -0
  73. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/LICENSE +0 -0
  74. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/NOTICE +0 -0
  75. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/__init__.py +0 -0
  76. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/__init__.py +0 -0
  77. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/activity/__init__.py +0 -0
  78. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/activity/_activity_executor.py +0 -0
  79. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/activity/_context.py +0 -0
  80. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/activity/_definition.py +0 -0
  81. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/activity/_heartbeat.py +0 -0
  82. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/fn_signature.py +0 -0
  83. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/rpc/__init__.py +0 -0
  84. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/workflow/__init__.py +0 -0
  85. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/workflow/active_cluster_selection_policy.py +0 -0
  86. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/workflow/decision_events_iterator.py +0 -0
  87. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/workflow/deterministic_event_loop.py +0 -0
  88. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/workflow/history_event_iterator.py +0 -0
  89. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/workflow/retry_policy.py +0 -0
  90. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/workflow/statemachine/__init__.py +0 -0
  91. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/workflow/statemachine/activity_state_machine.py +0 -0
  92. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/workflow/statemachine/cancellation.py +0 -0
  93. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/workflow/statemachine/completion_state_machine.py +0 -0
  94. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/workflow/statemachine/decision_state_machine.py +0 -0
  95. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/workflow/statemachine/timer_state_machine.py +0 -0
  96. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/_internal/workflow/waiter.py +0 -0
  97. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/activity.py +0 -0
  98. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/__init__.py +0 -0
  99. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/common_pb2_grpc.py +0 -0
  100. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/decision_pb2.py +0 -0
  101. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/decision_pb2.pyi +0 -0
  102. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/decision_pb2_grpc.py +0 -0
  103. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/domain_pb2.py +0 -0
  104. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/domain_pb2.pyi +0 -0
  105. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/domain_pb2_grpc.py +0 -0
  106. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/error_pb2.py +0 -0
  107. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/error_pb2.pyi +0 -0
  108. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/error_pb2_grpc.py +0 -0
  109. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/history_pb2.py +0 -0
  110. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/history_pb2.pyi +0 -0
  111. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/history_pb2_grpc.py +0 -0
  112. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/query_pb2.py +0 -0
  113. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/query_pb2.pyi +0 -0
  114. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/query_pb2_grpc.py +0 -0
  115. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/schedule_pb2_grpc.py +0 -0
  116. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/service_domain_pb2_grpc.py +0 -0
  117. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/service_meta_pb2.py +0 -0
  118. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/service_meta_pb2.pyi +0 -0
  119. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/service_meta_pb2_grpc.py +0 -0
  120. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/service_schedule_pb2.py +0 -0
  121. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/service_schedule_pb2.pyi +0 -0
  122. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/service_schedule_pb2_grpc.py +0 -0
  123. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/service_visibility_pb2.py +0 -0
  124. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/service_visibility_pb2.pyi +0 -0
  125. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/service_visibility_pb2_grpc.py +0 -0
  126. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/service_worker_pb2.py +0 -0
  127. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/service_worker_pb2.pyi +0 -0
  128. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/service_worker_pb2_grpc.py +0 -0
  129. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/service_workflow_pb2.py +0 -0
  130. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/service_workflow_pb2.pyi +0 -0
  131. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/service_workflow_pb2_grpc.py +0 -0
  132. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/tasklist_pb2_grpc.py +0 -0
  133. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/visibility_pb2.py +0 -0
  134. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/visibility_pb2.pyi +0 -0
  135. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/visibility_pb2_grpc.py +0 -0
  136. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/workflow_pb2.py +0 -0
  137. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/workflow_pb2.pyi +0 -0
  138. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/api/v1/workflow_pb2_grpc.py +0 -0
  139. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/contrib/__init__.py +0 -0
  140. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/contrib/openai/README.md +0 -0
  141. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/contrib/openai/__init__.py +0 -0
  142. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/contrib/openai/cadence_agent_runner.py +0 -0
  143. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/contrib/openai/cadence_handoff.py +0 -0
  144. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/contrib/openai/cadence_model.py +0 -0
  145. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/contrib/openai/cadence_registry.py +0 -0
  146. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/contrib/openai/images/cadence-web-agent-run.jpg +0 -0
  147. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/contrib/openai/openai_activities.py +0 -0
  148. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/contrib/openai/pydantic_data_converter.py +0 -0
  149. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/data_converter.py +0 -0
  150. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/metrics/__init__.py +0 -0
  151. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/metrics/constants.py +0 -0
  152. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/metrics/metrics.py +0 -0
  153. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/metrics/prometheus.py +0 -0
  154. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/sample/__init__.py +0 -0
  155. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/sample/client_example.py +0 -0
  156. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/sample/grpc_usage_example.py +0 -0
  157. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/sample/simple_usage_example.py +0 -0
  158. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/signal.py +0 -0
  159. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/worker/__init__.py +0 -0
  160. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/worker/_activity.py +0 -0
  161. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/worker/_base_task_handler.py +0 -0
  162. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/worker/_decision.py +0 -0
  163. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/worker/_poller.py +0 -0
  164. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/worker/_registry.py +0 -0
  165. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/worker/_types.py +0 -0
  166. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence/worker/_worker.py +0 -0
  167. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence_python_client.egg-info/dependency_links.txt +0 -0
  168. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/cadence_python_client.egg-info/top_level.txt +0 -0
  169. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/scripts/fix_pyi_imports.py +0 -0
  170. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/scripts/generate_proto.py +0 -0
  171. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/setup.cfg +0 -0
  172. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/_internal/activity/test_activity_executor.py +0 -0
  173. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/_internal/activity/test_heartbeat.py +0 -0
  174. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/_internal/test_fn_signature.py +0 -0
  175. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/_internal/workflow/statemachine/test_activity_state_machine.py +0 -0
  176. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/_internal/workflow/statemachine/test_timer_state_machine.py +0 -0
  177. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/_internal/workflow/test_context_retry_policy.py +0 -0
  178. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/_internal/workflow/test_decision_events_iterator.py +0 -0
  179. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/_internal/workflow/test_deterministic_event_loop.py +0 -0
  180. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/_internal/workflow/test_history_event_iterator.py +0 -0
  181. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/_internal/workflow/test_signal_handling.py +0 -0
  182. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/_internal/workflow/test_workflow_engine.py +0 -0
  183. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/common_activities.py +0 -0
  184. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/data_converter_test.py +0 -0
  185. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/metrics/test_metrics.py +0 -0
  186. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/metrics/test_prometheus.py +0 -0
  187. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/test_activity.py +0 -0
  188. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/worker/test_base_task_handler.py +0 -0
  189. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/worker/test_decision_worker_integration.py +0 -0
  190. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/worker/test_poller.py +0 -0
  191. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/worker/test_registry.py +0 -0
  192. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/cadence/worker/test_worker.py +0 -0
  193. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/conftest.py +0 -0
  194. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/integration_tests/conftest.py +0 -0
  195. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/integration_tests/helper.py +0 -0
  196. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/integration_tests/nondeterminism/success.json +0 -0
  197. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/integration_tests/test_client.py +0 -0
  198. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/integration_tests/workflow/test_activities.py +0 -0
  199. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/integration_tests/workflow/test_continue_as_new.py +0 -0
  200. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/integration_tests/workflow/test_heartbeat.py +0 -0
  201. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/integration_tests/workflow/test_serialization.py +0 -0
  202. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/integration_tests/workflow/test_timer.py +0 -0
  203. {cadence_python_client-0.2.2 → cadence_python_client-0.3.0}/tests/integration_tests/workflow/test_workflows.py +0 -0
@@ -32,7 +32,7 @@ pip install -e ".[dev]"
32
32
 
33
33
  ## Code Generation
34
34
  - Use `uv run python scripts/generate_proto.py` for protobuf generation
35
- - Use `uv run python scripts/dev.py` for development tasks
35
+ - Use `make` targets for development tasks
36
36
 
37
37
  ## Code Quality
38
38
  - **ALWAYS run linter and type checker after making code changes**
@@ -54,7 +54,7 @@ jobs:
54
54
  uv sync --extra dev --extra openai
55
55
  - name: Run mypy type checker
56
56
  run: |
57
- uv run mypy cadence/
57
+ uv run mypy cadence/ tests/
58
58
 
59
59
  test:
60
60
  name: Unit Tests
@@ -74,7 +74,12 @@ jobs:
74
74
  uv sync --extra dev
75
75
  - name: Run unit tests
76
76
  run: |
77
- uv run pytest -v
77
+ uv run pytest --integration-tests --cov --cov-branch --cov-report=xml
78
+ - name: Upload coverage reports to Codecov
79
+ uses: codecov/codecov-action@v5
80
+ with:
81
+ token: ${{ secrets.CODECOV_TOKEN }}
82
+ slug: cadence-workflow/cadence-python-client
78
83
 
79
84
  integration_test:
80
85
  name: Integration Tests
@@ -92,6 +97,6 @@ jobs:
92
97
  - name: Install dependencies
93
98
  run: |
94
99
  uv sync --extra dev
95
- - name: Run unit tests
100
+ - name: Run integration tests
96
101
  run: |
97
- uv run pytest -v --integration-tests
102
+ uv run pytest -v tests/integration_tests --integration-tests
@@ -33,7 +33,11 @@ test:
33
33
  # Run integration tests
34
34
  integration-test:
35
35
  @echo "Running integration tests..."
36
- uv run pytest -v --integration-tests
36
+ uv run pytest -v tests/integration_tests --integration-tests
37
+
38
+ integration-test-keep:
39
+ @echo "Running integration tests with cadence alive..."
40
+ uv run pytest -v tests/integration_tests --integration-tests --keep-cadence-alive
37
41
 
38
42
  # Clean generated files and caches
39
43
  clean:
@@ -41,15 +45,17 @@ clean:
41
45
  find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
42
46
  find . -type f -name "*.pyc" -delete 2>/dev/null || true
43
47
  find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true
48
+ rm -rf .mypy_cache
44
49
 
45
50
  # Show help
46
51
  help:
47
52
  @echo "Available targets:"
48
- @echo " make pr - Run all PR checks (recommended before submitting PR)"
49
- @echo " make install - Install dependencies"
50
- @echo " make lint - Run Ruff linter"
51
- @echo " make type-check - Run mypy type checker"
52
- @echo " make test - Run unit tests"
53
- @echo " make integration-test - Run integration tests"
54
- @echo " make clean - Remove generated files and caches"
55
- @echo " make help - Show this help message"
53
+ @echo " make pr - Run all PR checks (recommended before submitting PR)"
54
+ @echo " make install - Install dependencies"
55
+ @echo " make lint - Run Ruff linter"
56
+ @echo " make type-check - Run mypy type checker"
57
+ @echo " make test - Run unit tests"
58
+ @echo " make integration-test - Run integration tests"
59
+ @echo " make integration-test-keep - Run integration tests with cadence alive"
60
+ @echo " make clean - Remove generated files and caches"
61
+ @echo " make help - Show this help message"
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cadence-python-client
3
- Version: 0.2.2
4
- Summary: Python framework for authoring Cadence workflows and activities
3
+ Version: 0.3.0
4
+ Summary: Python SDK for authoring Cadence workflows and activities
5
5
  Author: Cadence
6
6
  License: Apache-2.0
7
7
  Project-URL: Homepage, https://cadenceworkflow.io/
@@ -9,7 +9,7 @@ Project-URL: Documentation, https://cadenceworkflow.io/docs/get-started
9
9
  Project-URL: Repository, https://github.com/cadence-workflow/cadence-python-client
10
10
  Project-URL: Bug Tracker, https://github.com/cadence-workflow/cadence-python-client/issues
11
11
  Keywords: workflow,orchestration,distributed,async,cadence
12
- Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Development Status :: 5 - Production/Stable
13
13
  Classifier: Intended Audience :: Developers
14
14
  Classifier: License :: OSI Approved :: Apache Software License
15
15
  Classifier: Operating System :: OS Independent
@@ -31,14 +31,11 @@ Requires-Dist: typing-extensions>=4.0.0
31
31
  Requires-Dist: prometheus-client>=0.21.0
32
32
  Provides-Extra: dev
33
33
  Requires-Dist: grpcio-tools>=1.73.1; extra == "dev"
34
+ Requires-Dist: grpc-stubs>=1.53.0.6; extra == "dev"
34
35
  Requires-Dist: pytest>=8.4.1; extra == "dev"
35
36
  Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
36
37
  Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
37
- Requires-Dist: black>=23.0.0; extra == "dev"
38
- Requires-Dist: isort>=5.12.0; extra == "dev"
39
- Requires-Dist: flake8>=6.0.0; extra == "dev"
40
38
  Requires-Dist: mypy>=1.0.0; extra == "dev"
41
- Requires-Dist: pre-commit>=3.0.0; extra == "dev"
42
39
  Requires-Dist: pytest-docker>=3.2.3; extra == "dev"
43
40
  Requires-Dist: opentelemetry-instrumentation-grpc==0.60b1; extra == "dev"
44
41
  Requires-Dist: opentelemetry-sdk>=1.39.1; extra == "dev"
@@ -56,22 +53,33 @@ Requires-Dist: openai>=0.27.10; extra == "openai"
56
53
  Requires-Dist: openai-agents>=0.12.5; extra == "openai"
57
54
  Dynamic: license-file
58
55
 
59
- # Python framework for Cadence
56
+ # Cadence Python SDK
60
57
 
61
58
  [Cadence](https://github.com/uber/cadence) is a distributed, scalable, durable, and highly available orchestration engine we developed at Uber Engineering to execute asynchronous long-running business logic in a scalable and resilient way.
62
59
 
63
60
  If you'd like to propose a new feature, first join the [CNCF Slack workspace](https://communityinviter.com/apps/cloud-native/cncf) in the **#cadence-users** channel to start a discussion.
64
61
 
65
- `cadence-python-client` is the Python framework for authoring workflows and activities.
62
+ The Cadence Python SDK is the framework for authoring workflows and activities using the Python programming language.
66
63
 
67
- ## Disclaimer
68
- **This SDK is currently an early work-in-progress (WIP) and is NOT ready for production use.**
64
+ ## Installation
69
65
 
70
- - This project is still in active development
71
- - It has not been published to any package repository (PyPI, etc.)
72
- - APIs and interfaces are subject to change without notice
66
+ Install from [PyPI](https://pypi.org/project/cadence-python-client/):
73
67
 
74
- ## Installation
68
+ ```bash
69
+ pip install cadence-python-client
70
+ ```
71
+
72
+ Or with `uv`:
73
+
74
+ ```bash
75
+ uv add cadence-python-client
76
+ ```
77
+
78
+ The core package supports Python `>=3.11,<3.14`.
79
+
80
+ The SDK is ready for production use using PYPI. To build from source, clone the repository and install the development dependencies.
81
+
82
+ Clone the repository if you want to develop locally:
75
83
 
76
84
  ```bash
77
85
  git clone https://github.com/cadence-workflow/cadence-python-client.git
@@ -103,8 +111,7 @@ cd cadence-python-client
103
111
 
104
112
  3. **Create virtual environment and install dependencies:**
105
113
  ```bash
106
- uv venv
107
- uv pip install -e ".[dev]"
114
+ uv sync --all-extras
108
115
  ```
109
116
 
110
117
  Or if you prefer traditional pip:
@@ -116,70 +123,56 @@ cd cadence-python-client
116
123
 
117
124
  ### Generate Protobuf and gRPC Files
118
125
 
119
- Run the generation script:
126
+ Run the generation script only if you change files under `idls/proto/`:
127
+
120
128
  ```bash
121
- # Using uv (recommended)
122
- uv sync --extra dev
123
- uv run python scripts/generate_proto.py
129
+ # Recommended
130
+ make generate
124
131
 
125
- # Or using traditional Python
126
- python scripts/generate_proto.py
132
+ # Or run the script directly
133
+ uv run python scripts/generate_proto.py
127
134
  ```
128
135
 
129
136
  This will:
130
- - Download protoc 29.1 binary
131
- - Install grpcio-tools if needed
132
137
  - Generate Python protobuf files in `cadence/api/v1/`
133
138
  - Generate gRPC service files in `cadence/api/v1/`
134
- - Create proper package structure with both protobuf and gRPC imports
139
+ - Refresh the package imports for the generated modules
135
140
 
136
141
  ### Test
137
142
 
138
- Verify the generated files work:
139
- ```bash
140
- # Using uv (recommended)
141
- uv run python cadence/sample/simple_usage_example.py
142
- uv run python cadence/sample/grpc_usage_example.py
143
+ Run the main checks:
143
144
 
144
- # Or using traditional Python
145
- python cadence/sample/simple_usage_example.py
146
- python test_grpc_with_examples.py
145
+ ```bash
146
+ make lint
147
+ make type-check
148
+ make test
147
149
  ```
148
150
 
149
- ### Development Script
150
-
151
- The project includes a development script that provides convenient commands for common tasks:
151
+ Run integration tests with Docker:
152
152
 
153
153
  ```bash
154
- # Generate protobuf files
155
- uv run python scripts/dev.py protobuf
156
-
157
- # Run tests
158
- uv run python scripts/dev.py test
159
-
160
- # Run tests with coverage
161
- uv run python scripts/dev.py test-cov
162
-
163
- # Run linting
164
- uv run python scripts/dev.py lint
165
-
166
- # Format code
167
- uv run python scripts/dev.py format
154
+ make integration-test
155
+ ```
168
156
 
169
- # Install in development mode
170
- uv run python scripts/dev.py install
157
+ You can also verify the generated files manually:
171
158
 
172
- # Install with dev dependencies
173
- uv run python scripts/dev.py install-dev
159
+ ```bash
160
+ uv run python cadence/sample/simple_usage_example.py
161
+ uv run python cadence/sample/grpc_usage_example.py
162
+ ```
174
163
 
175
- # Build package
176
- uv run python scripts/dev.py build
164
+ ### Development Commands
177
165
 
178
- # Clean build artifacts
179
- uv run python scripts/dev.py clean
166
+ The current repository workflow is centered on `make` targets:
180
167
 
181
- # Run all checks (lint + test)
182
- uv run python scripts/dev.py check
168
+ ```bash
169
+ make install
170
+ make generate
171
+ make lint
172
+ make type-check
173
+ make test
174
+ make integration-test
175
+ make pr
183
176
  ```
184
177
 
185
178
  ## License
@@ -1,19 +1,30 @@
1
- # Python framework for Cadence
1
+ # Cadence Python SDK
2
2
 
3
3
  [Cadence](https://github.com/uber/cadence) is a distributed, scalable, durable, and highly available orchestration engine we developed at Uber Engineering to execute asynchronous long-running business logic in a scalable and resilient way.
4
4
 
5
5
  If you'd like to propose a new feature, first join the [CNCF Slack workspace](https://communityinviter.com/apps/cloud-native/cncf) in the **#cadence-users** channel to start a discussion.
6
6
 
7
- `cadence-python-client` is the Python framework for authoring workflows and activities.
7
+ The Cadence Python SDK is the framework for authoring workflows and activities using the Python programming language.
8
8
 
9
- ## Disclaimer
10
- **This SDK is currently an early work-in-progress (WIP) and is NOT ready for production use.**
9
+ ## Installation
11
10
 
12
- - This project is still in active development
13
- - It has not been published to any package repository (PyPI, etc.)
14
- - APIs and interfaces are subject to change without notice
11
+ Install from [PyPI](https://pypi.org/project/cadence-python-client/):
15
12
 
16
- ## Installation
13
+ ```bash
14
+ pip install cadence-python-client
15
+ ```
16
+
17
+ Or with `uv`:
18
+
19
+ ```bash
20
+ uv add cadence-python-client
21
+ ```
22
+
23
+ The core package supports Python `>=3.11,<3.14`.
24
+
25
+ The SDK is ready for production use using PYPI. To build from source, clone the repository and install the development dependencies.
26
+
27
+ Clone the repository if you want to develop locally:
17
28
 
18
29
  ```bash
19
30
  git clone https://github.com/cadence-workflow/cadence-python-client.git
@@ -45,8 +56,7 @@ cd cadence-python-client
45
56
 
46
57
  3. **Create virtual environment and install dependencies:**
47
58
  ```bash
48
- uv venv
49
- uv pip install -e ".[dev]"
59
+ uv sync --all-extras
50
60
  ```
51
61
 
52
62
  Or if you prefer traditional pip:
@@ -58,70 +68,56 @@ cd cadence-python-client
58
68
 
59
69
  ### Generate Protobuf and gRPC Files
60
70
 
61
- Run the generation script:
71
+ Run the generation script only if you change files under `idls/proto/`:
72
+
62
73
  ```bash
63
- # Using uv (recommended)
64
- uv sync --extra dev
65
- uv run python scripts/generate_proto.py
74
+ # Recommended
75
+ make generate
66
76
 
67
- # Or using traditional Python
68
- python scripts/generate_proto.py
77
+ # Or run the script directly
78
+ uv run python scripts/generate_proto.py
69
79
  ```
70
80
 
71
81
  This will:
72
- - Download protoc 29.1 binary
73
- - Install grpcio-tools if needed
74
82
  - Generate Python protobuf files in `cadence/api/v1/`
75
83
  - Generate gRPC service files in `cadence/api/v1/`
76
- - Create proper package structure with both protobuf and gRPC imports
84
+ - Refresh the package imports for the generated modules
77
85
 
78
86
  ### Test
79
87
 
80
- Verify the generated files work:
81
- ```bash
82
- # Using uv (recommended)
83
- uv run python cadence/sample/simple_usage_example.py
84
- uv run python cadence/sample/grpc_usage_example.py
88
+ Run the main checks:
85
89
 
86
- # Or using traditional Python
87
- python cadence/sample/simple_usage_example.py
88
- python test_grpc_with_examples.py
90
+ ```bash
91
+ make lint
92
+ make type-check
93
+ make test
89
94
  ```
90
95
 
91
- ### Development Script
92
-
93
- The project includes a development script that provides convenient commands for common tasks:
96
+ Run integration tests with Docker:
94
97
 
95
98
  ```bash
96
- # Generate protobuf files
97
- uv run python scripts/dev.py protobuf
98
-
99
- # Run tests
100
- uv run python scripts/dev.py test
101
-
102
- # Run tests with coverage
103
- uv run python scripts/dev.py test-cov
104
-
105
- # Run linting
106
- uv run python scripts/dev.py lint
107
-
108
- # Format code
109
- uv run python scripts/dev.py format
99
+ make integration-test
100
+ ```
110
101
 
111
- # Install in development mode
112
- uv run python scripts/dev.py install
102
+ You can also verify the generated files manually:
113
103
 
114
- # Install with dev dependencies
115
- uv run python scripts/dev.py install-dev
104
+ ```bash
105
+ uv run python cadence/sample/simple_usage_example.py
106
+ uv run python cadence/sample/grpc_usage_example.py
107
+ ```
116
108
 
117
- # Build package
118
- uv run python scripts/dev.py build
109
+ ### Development Commands
119
110
 
120
- # Clean build artifacts
121
- uv run python scripts/dev.py clean
111
+ The current repository workflow is centered on `make` targets:
122
112
 
123
- # Run all checks (lint + test)
124
- uv run python scripts/dev.py check
113
+ ```bash
114
+ make install
115
+ make generate
116
+ make lint
117
+ make type-check
118
+ make test
119
+ make integration-test
120
+ make pr
125
121
  ```
126
122
 
127
123
  ## License
@@ -1,7 +1,7 @@
1
- from typing import Callable, Any, Optional, Generator, TypeVar
1
+ from typing import Callable, Any, Optional, Generator, TypeVar, cast
2
2
 
3
3
  import grpc
4
- from google.rpc.status_pb2 import Status # type: ignore
4
+ from google.rpc.status_pb2 import Status
5
5
  from grpc.aio import (
6
6
  UnaryUnaryClientInterceptor,
7
7
  ClientCallDetails,
@@ -9,7 +9,7 @@ from grpc.aio import (
9
9
  UnaryUnaryCall,
10
10
  Metadata,
11
11
  )
12
- from grpc_status.rpc_status import from_call # type: ignore
12
+ from grpc_status.rpc_status import from_call
13
13
 
14
14
  from cadence.api.v1 import error_pb2
15
15
  from cadence import error
@@ -46,22 +46,22 @@ class CadenceErrorUnaryUnaryCall(UnaryUnaryCall[RequestType, ResponseType]):
46
46
  return await self._wrapped.code()
47
47
 
48
48
  async def details(self) -> str:
49
- return await self._wrapped.details() # type: ignore
49
+ return await self._wrapped.details()
50
50
 
51
51
  async def wait_for_connection(self) -> None:
52
52
  await self._wrapped.wait_for_connection()
53
53
 
54
54
  def cancelled(self) -> bool:
55
- return self._wrapped.cancelled() # type: ignore
55
+ return self._wrapped.cancelled()
56
56
 
57
57
  def done(self) -> bool:
58
- return self._wrapped.done() # type: ignore
58
+ return self._wrapped.done()
59
59
 
60
60
  def time_remaining(self) -> Optional[float]:
61
- return self._wrapped.time_remaining() # type: ignore
61
+ return self._wrapped.time_remaining()
62
62
 
63
63
  def cancel(self) -> bool:
64
- return self._wrapped.cancel() # type: ignore
64
+ return self._wrapped.cancel()
65
65
 
66
66
  def add_done_callback(self, callback: DoneCallbackType) -> None:
67
67
  self._wrapped.add_done_callback(callback)
@@ -79,16 +79,18 @@ class CadenceErrorInterceptor(UnaryUnaryClientInterceptor):
79
79
 
80
80
 
81
81
  def map_error(e: AioRpcError) -> error.CadenceRpcError:
82
- status: Status | None = from_call(e)
82
+ # AioRpcError implements the grpc.Call interface but doesn't inherit from it in the type stubs
83
+ status: Status | None = from_call(cast(grpc.Call, e))
84
+ message = e.details() or ""
83
85
  if not status or not status.details:
84
- return error.CadenceRpcError(e.details(), e.code())
86
+ return error.CadenceRpcError(message, e.code())
85
87
 
86
88
  details = status.details[0]
87
89
  if details.Is(error_pb2.WorkflowExecutionAlreadyStartedError.DESCRIPTOR):
88
90
  already_started = error_pb2.WorkflowExecutionAlreadyStartedError()
89
91
  details.Unpack(already_started)
90
92
  return error.WorkflowExecutionAlreadyStartedError(
91
- e.details(),
93
+ message,
92
94
  e.code(),
93
95
  already_started.start_request_id,
94
96
  already_started.run_id,
@@ -97,19 +99,19 @@ def map_error(e: AioRpcError) -> error.CadenceRpcError:
97
99
  not_exists = error_pb2.EntityNotExistsError()
98
100
  details.Unpack(not_exists)
99
101
  return error.EntityNotExistsError(
100
- e.details(),
102
+ message,
101
103
  e.code(),
102
104
  not_exists.current_cluster,
103
105
  not_exists.active_cluster,
104
106
  list(not_exists.active_clusters),
105
107
  )
106
108
  elif details.Is(error_pb2.WorkflowExecutionAlreadyCompletedError.DESCRIPTOR):
107
- return error.WorkflowExecutionAlreadyCompletedError(e.details(), e.code())
109
+ return error.WorkflowExecutionAlreadyCompletedError(message, e.code())
108
110
  elif details.Is(error_pb2.DomainNotActiveError.DESCRIPTOR):
109
111
  not_active = error_pb2.DomainNotActiveError()
110
112
  details.Unpack(not_active)
111
113
  return error.DomainNotActiveError(
112
- e.details(),
114
+ message,
113
115
  e.code(),
114
116
  not_active.domain,
115
117
  not_active.current_cluster,
@@ -120,7 +122,7 @@ def map_error(e: AioRpcError) -> error.CadenceRpcError:
120
122
  not_supported = error_pb2.ClientVersionNotSupportedError()
121
123
  details.Unpack(not_supported)
122
124
  return error.ClientVersionNotSupportedError(
123
- e.details(),
125
+ message,
124
126
  e.code(),
125
127
  not_supported.feature_version,
126
128
  not_supported.client_impl,
@@ -129,20 +131,18 @@ def map_error(e: AioRpcError) -> error.CadenceRpcError:
129
131
  elif details.Is(error_pb2.FeatureNotEnabledError.DESCRIPTOR):
130
132
  not_enabled = error_pb2.FeatureNotEnabledError()
131
133
  details.Unpack(not_enabled)
132
- return error.FeatureNotEnabledError(
133
- e.details(), e.code(), not_enabled.feature_flag
134
- )
134
+ return error.FeatureNotEnabledError(message, e.code(), not_enabled.feature_flag)
135
135
  elif details.Is(error_pb2.CancellationAlreadyRequestedError.DESCRIPTOR):
136
- return error.CancellationAlreadyRequestedError(e.details(), e.code())
136
+ return error.CancellationAlreadyRequestedError(message, e.code())
137
137
  elif details.Is(error_pb2.DomainAlreadyExistsError.DESCRIPTOR):
138
- return error.DomainAlreadyExistsError(e.details(), e.code())
138
+ return error.DomainAlreadyExistsError(message, e.code())
139
139
  elif details.Is(error_pb2.LimitExceededError.DESCRIPTOR):
140
- return error.LimitExceededError(e.details(), e.code())
140
+ return error.LimitExceededError(message, e.code())
141
141
  elif details.Is(error_pb2.QueryFailedError.DESCRIPTOR):
142
- return error.QueryFailedError(e.details(), e.code())
142
+ return error.QueryFailedError(message, e.code())
143
143
  elif details.Is(error_pb2.ServiceBusyError.DESCRIPTOR):
144
144
  service_busy = error_pb2.ServiceBusyError()
145
145
  details.Unpack(service_busy)
146
- return error.ServiceBusyError(e.details(), e.code(), service_busy.reason)
146
+ return error.ServiceBusyError(message, e.code(), service_busy.reason)
147
147
  else:
148
- return error.CadenceRpcError(e.details(), e.code())
148
+ return error.CadenceRpcError(message, e.code())
@@ -1,6 +1,6 @@
1
1
  import asyncio
2
2
  from dataclasses import dataclass
3
- from typing import Callable, Any
3
+ from typing import Callable, Any, cast
4
4
 
5
5
  from grpc import StatusCode
6
6
  from grpc.aio import UnaryUnaryClientInterceptor, ClientCallDetails
@@ -59,19 +59,23 @@ class RetryInterceptor(UnaryUnaryClientInterceptor):
59
59
  request: Any,
60
60
  ) -> Any:
61
61
  loop = asyncio.get_running_loop()
62
- expiration_interval = client_call_details.timeout
63
- if expiration_interval is None:
64
- expiration_interval = float("inf")
62
+ expiration_interval = (
63
+ client_call_details.timeout
64
+ if client_call_details.timeout is not None
65
+ else float("inf")
66
+ )
65
67
  start_time = loop.time()
66
68
  deadline = start_time + expiration_interval
67
69
 
68
70
  attempts = 0
69
71
  while True:
70
72
  remaining = deadline - loop.time()
71
- # Namedtuple methods start with an underscore to avoid conflicts and aren't actually private
72
- # noinspection PyProtectedMember
73
- call_details = client_call_details._replace( # type: ignore[attr-defined]
74
- timeout=remaining
73
+ call_details = ClientCallDetails(
74
+ method=client_call_details.method,
75
+ timeout=remaining,
76
+ metadata=client_call_details.metadata,
77
+ credentials=client_call_details.credentials,
78
+ wait_for_ready=client_call_details.wait_for_ready,
75
79
  )
76
80
  rpc_call = await continuation(call_details, request)
77
81
  try:
@@ -98,11 +102,11 @@ class RetryInterceptor(UnaryUnaryClientInterceptor):
98
102
 
99
103
 
100
104
  def is_retryable(err: CadenceRpcError, call_details: ClientCallDetails) -> bool:
101
- # Handle requests to the passive side, matching the Go and Java Clients
102
- if (
103
- call_details.method == GET_WORKFLOW_HISTORY # type: ignore[comparison-overlap]
104
- and isinstance(err, EntityNotExistsError)
105
- ):
105
+ # Handle requests to the passive side, matching the Go and Java Clients.
106
+ # grpc-stubs types method as str, but grpcio corrected it to bytes in v1.75.0
107
+ # (grpc/grpc#39405). Cast to bytes to match the actual runtime type.
108
+ method = cast(bytes, call_details.method)
109
+ if method == GET_WORKFLOW_HISTORY and isinstance(err, EntityNotExistsError):
106
110
  return (
107
111
  err.active_cluster is not None
108
112
  and err.current_cluster is not None
@@ -1,4 +1,4 @@
1
- from typing import Any, Callable, cast
1
+ from typing import Any, Callable
2
2
 
3
3
  from grpc.aio import Metadata
4
4
  from grpc.aio import UnaryUnaryClientInterceptor, ClientCallDetails
@@ -38,11 +38,10 @@ class YarpcMetadataInterceptor(UnaryUnaryClientInterceptor):
38
38
  else:
39
39
  metadata += self._metadata
40
40
 
41
- # Namedtuple methods start with an underscore to avoid conflicts and aren't actually private
42
- # noinspection PyProtectedMember
43
- return cast(
44
- ClientCallDetails,
45
- client_call_details._replace( # type: ignore[attr-defined]
46
- metadata=metadata, timeout=client_call_details.timeout or 60.0
47
- ),
41
+ return ClientCallDetails(
42
+ method=client_call_details.method,
43
+ timeout=client_call_details.timeout or 60.0,
44
+ metadata=metadata,
45
+ credentials=client_call_details.credentials,
46
+ wait_for_ready=client_call_details.wait_for_ready,
48
47
  )