Skip to content

Commit

Permalink
Merge branch 'main' into release-1.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cretz authored Feb 27, 2024
2 parents 9393cc7 + 73e832d commit 4ed4ca3
Show file tree
Hide file tree
Showing 17 changed files with 480 additions and 303 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ with workflow.unsafe.imports_passed_through():

@workflow.defn
class GreetingWorkflow:
def __init__() -> None:
def __init__(self) -> None:
self._current_greeting = "<unset>"
self._greeting_info = GreetingInfo()
self._greeting_info_update = asyncio.Event()
Expand Down Expand Up @@ -1307,6 +1307,7 @@ The Python SDK is built to work with Python 3.8 and newer. It is built using
To build the SDK from source for use as a dependency, the following prerequisites are required:

* [Python](https://www.python.org/) >= 3.8
* Make sure the latest version of `pip` is in use
* [Rust](https://www.rust-lang.org/)
* [poetry](https://github.com/python-poetry/poetry) (e.g. `python -m pip install poetry`)
* [poe](https://github.com/nat-n/poethepoet) (e.g. `python -m pip install poethepoet`)
Expand All @@ -1325,7 +1326,7 @@ Use `poetry` to install the dependencies with `--no-root` to not install this pa
it):

```bash
poetry install --no-root
poetry install --no-root --all-extras
```

#### Build
Expand Down Expand Up @@ -1416,7 +1417,7 @@ installing dependencies, and generating the protobuf code:
```bash
git clone --recursive https://github.com/temporalio/sdk-python.git
cd sdk-python
poetry install --no-root
poetry install --no-root --all-extras
```

Now compile the Rust extension in develop mode which is quicker than release mode:
Expand Down
9 changes: 7 additions & 2 deletions temporalio/api/enums/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
)
from .namespace_pb2 import ArchivalState, NamespaceState, ReplicationState
from .query_pb2 import QueryRejectCondition, QueryResultType
from .reset_pb2 import ResetReapplyType, ResetType
from .reset_pb2 import ResetReapplyExcludeType, ResetReapplyType, ResetType
from .schedule_pb2 import ScheduleOverlapPolicy
from .task_queue_pb2 import TaskQueueKind, TaskQueueType, TaskReachability
from .update_pb2 import UpdateWorkflowExecutionLifecycleStage
from .update_pb2 import (
UpdateRequestedEventOrigin,
UpdateWorkflowExecutionLifecycleStage,
)
from .workflow_pb2 import (
ContinueAsNewInitiator,
HistoryEventFilterType,
Expand Down Expand Up @@ -45,6 +48,7 @@
"QueryRejectCondition",
"QueryResultType",
"ReplicationState",
"ResetReapplyExcludeType",
"ResetReapplyType",
"ResetType",
"ResourceExhaustedCause",
Expand All @@ -57,6 +61,7 @@
"TaskQueueType",
"TaskReachability",
"TimeoutType",
"UpdateRequestedEventOrigin",
"UpdateWorkflowExecutionLifecycleStage",
"WorkflowExecutionStatus",
"WorkflowIdReusePolicy",
Expand Down
5 changes: 3 additions & 2 deletions temporalio/api/enums/v1/event_type_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions temporalio/api/enums/v1/event_type_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ class _EventTypeEnumTypeWrapper(
"""
EVENT_TYPE_WORKFLOW_PROPERTIES_MODIFIED: _EventType.ValueType # 46
"""Workflow properties modified by user workflow code"""
EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_REQUESTED: _EventType.ValueType # 47
"""An update was requested. Note that not all update requests result in this
event. See UpdateRequestedEventOrigin for situations in which this event
is created.
"""

class EventType(_EventType, metaclass=_EventTypeEnumTypeWrapper):
"""Whenever this list of events is changed do change the function shouldBufferEvent in mutableStateBuilder.go to make sure to do the correct event ordering"""
Expand Down Expand Up @@ -359,4 +364,9 @@ maintain determinism when using the command-based approach.
"""
EVENT_TYPE_WORKFLOW_PROPERTIES_MODIFIED: EventType.ValueType # 46
"""Workflow properties modified by user workflow code"""
EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_REQUESTED: EventType.ValueType # 47
"""An update was requested. Note that not all update requests result in this
event. See UpdateRequestedEventOrigin for situations in which this event
is created.
"""
global___EventType = EventType
18 changes: 13 additions & 5 deletions temporalio/api/enums/v1/reset_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 40 additions & 3 deletions temporalio/api/enums/v1/reset_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,35 @@ else:

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

class _ResetReapplyExcludeType:
ValueType = typing.NewType("ValueType", builtins.int)
V: typing_extensions.TypeAlias = ValueType

class _ResetReapplyExcludeTypeEnumTypeWrapper(
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[
_ResetReapplyExcludeType.ValueType
],
builtins.type,
): # noqa: F821
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
RESET_REAPPLY_EXCLUDE_TYPE_UNSPECIFIED: _ResetReapplyExcludeType.ValueType # 0
RESET_REAPPLY_EXCLUDE_TYPE_SIGNAL: _ResetReapplyExcludeType.ValueType # 1
"""Exclude signals when reapplying events."""
RESET_REAPPLY_EXCLUDE_TYPE_UPDATE: _ResetReapplyExcludeType.ValueType # 2
"""Exclude updates when reapplying events."""

class ResetReapplyExcludeType(
_ResetReapplyExcludeType, metaclass=_ResetReapplyExcludeTypeEnumTypeWrapper
):
"""Event types to exclude when reapplying events."""

RESET_REAPPLY_EXCLUDE_TYPE_UNSPECIFIED: ResetReapplyExcludeType.ValueType # 0
RESET_REAPPLY_EXCLUDE_TYPE_SIGNAL: ResetReapplyExcludeType.ValueType # 1
"""Exclude signals when reapplying events."""
RESET_REAPPLY_EXCLUDE_TYPE_UPDATE: ResetReapplyExcludeType.ValueType # 2
"""Exclude updates when reapplying events."""
global___ResetReapplyExcludeType = ResetReapplyExcludeType

class _ResetReapplyType:
ValueType = typing.NewType("ValueType", builtins.int)
V: typing_extensions.TypeAlias = ValueType
Expand All @@ -49,17 +78,25 @@ class _ResetReapplyTypeEnumTypeWrapper(
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
RESET_REAPPLY_TYPE_UNSPECIFIED: _ResetReapplyType.ValueType # 0
RESET_REAPPLY_TYPE_SIGNAL: _ResetReapplyType.ValueType # 1
"""Signals are reapplied when workflow is reset."""
RESET_REAPPLY_TYPE_NONE: _ResetReapplyType.ValueType # 2
"""No events are reapplied when workflow is reset."""
RESET_REAPPLY_TYPE_ALL_ELIGIBLE: _ResetReapplyType.ValueType # 3
"""All eligible events are reapplied when workflow is reset."""

class ResetReapplyType(_ResetReapplyType, metaclass=_ResetReapplyTypeEnumTypeWrapper):
"""Reset reapply (replay) options
* RESET_REAPPLY_TYPE_SIGNAL (default) - Signals are reapplied when workflow is reset
* RESET_REAPPLY_TYPE_NONE - nothing is reapplied
"""Event types to include when reapplying events. Deprecated: applications
should use ResetReapplyExcludeType to specify exclusions from this set, and
new event types should be added to ResetReapplyExcludeType instead of here.
"""

RESET_REAPPLY_TYPE_UNSPECIFIED: ResetReapplyType.ValueType # 0
RESET_REAPPLY_TYPE_SIGNAL: ResetReapplyType.ValueType # 1
"""Signals are reapplied when workflow is reset."""
RESET_REAPPLY_TYPE_NONE: ResetReapplyType.ValueType # 2
"""No events are reapplied when workflow is reset."""
RESET_REAPPLY_TYPE_ALL_ELIGIBLE: ResetReapplyType.ValueType # 3
"""All eligible events are reapplied when workflow is reset."""
global___ResetReapplyType = ResetReapplyType

class _ResetType:
Expand Down
12 changes: 11 additions & 1 deletion temporalio/api/enums/v1/update_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4ed4ca3

Please sign in to comment.