Skip to content

Commit 73e832d

Browse files
authored
Update core, minor README/doc updates, and put delete-workflow on proper service (#480)
1 parent f31f927 commit 73e832d

17 files changed

+480
-303
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ with workflow.unsafe.imports_passed_through():
472472

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

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

13271328
```bash
1328-
poetry install --no-root
1329+
poetry install --no-root --all-extras
13291330
```
13301331

13311332
#### Build
@@ -1416,7 +1417,7 @@ installing dependencies, and generating the protobuf code:
14161417
```bash
14171418
git clone --recursive https://github.com/temporalio/sdk-python.git
14181419
cd sdk-python
1419-
poetry install --no-root
1420+
poetry install --no-root --all-extras
14201421
```
14211422

14221423
Now compile the Rust extension in develop mode which is quicker than release mode:

temporalio/api/enums/v1/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@
1111
)
1212
from .namespace_pb2 import ArchivalState, NamespaceState, ReplicationState
1313
from .query_pb2 import QueryRejectCondition, QueryResultType
14-
from .reset_pb2 import ResetReapplyType, ResetType
14+
from .reset_pb2 import ResetReapplyExcludeType, ResetReapplyType, ResetType
1515
from .schedule_pb2 import ScheduleOverlapPolicy
1616
from .task_queue_pb2 import TaskQueueKind, TaskQueueType, TaskReachability
17-
from .update_pb2 import UpdateWorkflowExecutionLifecycleStage
17+
from .update_pb2 import (
18+
UpdateRequestedEventOrigin,
19+
UpdateWorkflowExecutionLifecycleStage,
20+
)
1821
from .workflow_pb2 import (
1922
ContinueAsNewInitiator,
2023
HistoryEventFilterType,
@@ -45,6 +48,7 @@
4548
"QueryRejectCondition",
4649
"QueryResultType",
4750
"ReplicationState",
51+
"ResetReapplyExcludeType",
4852
"ResetReapplyType",
4953
"ResetType",
5054
"ResourceExhaustedCause",
@@ -57,6 +61,7 @@
5761
"TaskQueueType",
5862
"TaskReachability",
5963
"TimeoutType",
64+
"UpdateRequestedEventOrigin",
6065
"UpdateWorkflowExecutionLifecycleStage",
6166
"WorkflowExecutionStatus",
6267
"WorkflowIdReusePolicy",

temporalio/api/enums/v1/event_type_pb2.py

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporalio/api/enums/v1/event_type_pb2.pyi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,11 @@ class _EventTypeEnumTypeWrapper(
200200
"""
201201
EVENT_TYPE_WORKFLOW_PROPERTIES_MODIFIED: _EventType.ValueType # 46
202202
"""Workflow properties modified by user workflow code"""
203+
EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_REQUESTED: _EventType.ValueType # 47
204+
"""An update was requested. Note that not all update requests result in this
205+
event. See UpdateRequestedEventOrigin for situations in which this event
206+
is created.
207+
"""
203208

204209
class EventType(_EventType, metaclass=_EventTypeEnumTypeWrapper):
205210
"""Whenever this list of events is changed do change the function shouldBufferEvent in mutableStateBuilder.go to make sure to do the correct event ordering"""
@@ -359,4 +364,9 @@ maintain determinism when using the command-based approach.
359364
"""
360365
EVENT_TYPE_WORKFLOW_PROPERTIES_MODIFIED: EventType.ValueType # 46
361366
"""Workflow properties modified by user workflow code"""
367+
EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_REQUESTED: EventType.ValueType # 47
368+
"""An update was requested. Note that not all update requests result in this
369+
event. See UpdateRequestedEventOrigin for situations in which this event
370+
is created.
371+
"""
362372
global___EventType = EventType

temporalio/api/enums/v1/reset_pb2.py

Lines changed: 13 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporalio/api/enums/v1/reset_pb2.pyi

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,35 @@ else:
3636

3737
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
3838

39+
class _ResetReapplyExcludeType:
40+
ValueType = typing.NewType("ValueType", builtins.int)
41+
V: typing_extensions.TypeAlias = ValueType
42+
43+
class _ResetReapplyExcludeTypeEnumTypeWrapper(
44+
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[
45+
_ResetReapplyExcludeType.ValueType
46+
],
47+
builtins.type,
48+
): # noqa: F821
49+
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
50+
RESET_REAPPLY_EXCLUDE_TYPE_UNSPECIFIED: _ResetReapplyExcludeType.ValueType # 0
51+
RESET_REAPPLY_EXCLUDE_TYPE_SIGNAL: _ResetReapplyExcludeType.ValueType # 1
52+
"""Exclude signals when reapplying events."""
53+
RESET_REAPPLY_EXCLUDE_TYPE_UPDATE: _ResetReapplyExcludeType.ValueType # 2
54+
"""Exclude updates when reapplying events."""
55+
56+
class ResetReapplyExcludeType(
57+
_ResetReapplyExcludeType, metaclass=_ResetReapplyExcludeTypeEnumTypeWrapper
58+
):
59+
"""Event types to exclude when reapplying events."""
60+
61+
RESET_REAPPLY_EXCLUDE_TYPE_UNSPECIFIED: ResetReapplyExcludeType.ValueType # 0
62+
RESET_REAPPLY_EXCLUDE_TYPE_SIGNAL: ResetReapplyExcludeType.ValueType # 1
63+
"""Exclude signals when reapplying events."""
64+
RESET_REAPPLY_EXCLUDE_TYPE_UPDATE: ResetReapplyExcludeType.ValueType # 2
65+
"""Exclude updates when reapplying events."""
66+
global___ResetReapplyExcludeType = ResetReapplyExcludeType
67+
3968
class _ResetReapplyType:
4069
ValueType = typing.NewType("ValueType", builtins.int)
4170
V: typing_extensions.TypeAlias = ValueType
@@ -49,17 +78,25 @@ class _ResetReapplyTypeEnumTypeWrapper(
4978
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
5079
RESET_REAPPLY_TYPE_UNSPECIFIED: _ResetReapplyType.ValueType # 0
5180
RESET_REAPPLY_TYPE_SIGNAL: _ResetReapplyType.ValueType # 1
81+
"""Signals are reapplied when workflow is reset."""
5282
RESET_REAPPLY_TYPE_NONE: _ResetReapplyType.ValueType # 2
83+
"""No events are reapplied when workflow is reset."""
84+
RESET_REAPPLY_TYPE_ALL_ELIGIBLE: _ResetReapplyType.ValueType # 3
85+
"""All eligible events are reapplied when workflow is reset."""
5386

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

6093
RESET_REAPPLY_TYPE_UNSPECIFIED: ResetReapplyType.ValueType # 0
6194
RESET_REAPPLY_TYPE_SIGNAL: ResetReapplyType.ValueType # 1
95+
"""Signals are reapplied when workflow is reset."""
6296
RESET_REAPPLY_TYPE_NONE: ResetReapplyType.ValueType # 2
97+
"""No events are reapplied when workflow is reset."""
98+
RESET_REAPPLY_TYPE_ALL_ELIGIBLE: ResetReapplyType.ValueType # 3
99+
"""All eligible events are reapplied when workflow is reset."""
63100
global___ResetReapplyType = ResetReapplyType
64101

65102
class _ResetType:

temporalio/api/enums/v1/update_pb2.py

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)