Skip to content

0.1b2

Compare
Choose a tag to compare
@cretz cretz released this 20 Sep 15:10
· 177 commits to main since this release
49ccd56

⚠️ THIS IS A BETA RELEASE AND COMPATIBILITY MAY NOT BE MAINTAINED

Get from PyPI

Highlights

Test Framework

temporalio.testing package now includes an ActivityEnvironment for mocking heartbeating and cancellation for activity code. See https://github.com/temporalio/sdk-python#testing-1 for more details.

temporalio.testing package also now includes a WorkflowEnvironment for testing workflows. The WorkFlowEnvironment can be started in time-skipping mode which, by default, will automatically forward time to the next event when a workflow's result is waited on. For a full, local Temporal server or a time-skipping server, APIs are included that automatically download the binaries needed to run. See https://github.com/temporalio/sdk-python#testing for more details.

Replayer

The temporalio.worker package now has a Replayer which, given workflows and a history, can replay an entire workflow run locally. This is very useful for debugging and confirming code-change safety. See https://github.com/temporalio/sdk-python#workflow-replay for more details.

Advanced Type Hinting Support

Nested dataclasses, Pydantic classes, optionals, unions, collections, etc are now supported for deserialization if the workflow/activity param/return types are properly type hinted. See https://github.com/temporalio/sdk-python#data-conversion for more details.

Client Updates

  • gRPC is now an optional dependency
  • Client.workflow_service and Client.operator_service are now available for direct API calls to Temporal
  • Added Client.service_client which, in addition to having access to the two services from the previous bullet, also has a check_health call to perform gRPC health check
  • rpc_metadata can be now added at the client level and/or to every API call which will set API headers (useful for proxies and other things)
  • rpc_timeout can now be added to every API call to set a timeout on the call itself
  • Added lazy parameter to Client.connect which avoids eager connection (cannot use these for workers)

Breaking Changes

Most breaking changes were very minor:

  • Client.service is now Client.workflow_service
  • static_headers parameter in Client.connect is now rpc_metadata
  • Most things that accepted an Iterable were changed to accept a Sequence
  • interceptors parameter in Client.connect no longer accepts callables, just the Interceptor instances it always had
  • max_concurrent_wft_polls and max_concurrent_at_polls parameters in Client.connect were changed to max_concurrent_workflow_task_polls and max_concurrent_activity_task_polls respectively

Specific Changes

2022-08-05 - 043cdf3 - Minor README update (#99)
2022-08-10 - 8171049 - Fix activity class type hinting when not instantiated (#104)
2022-08-12 - efc1c7b - Advanced type hinting support (#102)
2022-08-16 - c965c47 - gRPC Service Improvements (#106)
2022-08-19 - 5b202c0 - Replayer (#108)
2022-08-25 - 4db14cc - README: Fix import name in quickstart (#112)
2022-09-01 - 07da1b9 - Test Framework (#121)
2022-09-07 - 1c9a59e - Several minor issues (#127)
2022-09-16 - 5b0e1c8 - Update and dogfood test framework (#132)
2022-09-19 - 580b6fc - Skip conditions during patch and query jobs (#137)
2022-09-19 - bcc0132 - Update protobuf (#136)