Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "sdk-core"]
path = temporalio/bridge/sdk-core
url = https://github.com/temporalio/sdk-rust.git
url = https://github.com/moetemp/sdk-rust.git
20 changes: 14 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ dev = [
]

[tool.poe.tasks]
build-develop = "uv run maturin develop --uv"
build-develop-with-release = { cmd = "uv run maturin develop --release --uv" }
build-develop = "uv run maturin develop --uv --features streams"
build-develop-with-release = { cmd = "uv run maturin develop --release --uv --features streams" }
# FIPS builds: swap the rustls stack onto aws-lc-rs FIPS mode (aws-lc-fips-sys), eliminating `ring`.
build-develop-fips = { cmd = "uv run maturin develop --uv --no-default-features --features fips", env = { TEMPORALIO_FIPS = "1" } }
build-wheel-fips = { cmd = "uv run maturin build --release --no-default-features --features fips", env = { TEMPORALIO_FIPS = "1" } }
Expand Down Expand Up @@ -163,18 +163,20 @@ filterwarnings = [
before-all = "pip install protoc-wheel-0"
build = "cp310-win_amd64 cp310-manylinux_x86_64 cp310-manylinux_aarch64 cp310-musllinux_x86_64 cp310-musllinux_aarch64 cp310-macosx_x86_64 cp310-macosx_arm64"
build-verbosity = 1
# The official wheels link the Stream runtime.
environment = { MATURIN_PEP517_ARGS = "--features streams" }

[tool.cibuildwheel.macos]
environment = { MACOSX_DEPLOYMENT_TARGET = "10.12" }
environment = { MACOSX_DEPLOYMENT_TARGET = "10.12", MATURIN_PEP517_ARGS = "--features streams" }

[tool.cibuildwheel.linux]
before-all = "sh scripts/cibuildwheel_before_all_linux.sh"
before-build = "sh scripts/cibuildwheel_before_build_linux.sh"
environment = { PATH = "$PATH:$HOME/.cargo/bin", CARGO_NET_GIT_FETCH_WITH_CLI = "true" }
environment = { PATH = "$PATH:$HOME/.cargo/bin", CARGO_NET_GIT_FETCH_WITH_CLI = "true", MATURIN_PEP517_ARGS = "--features streams" }

[[tool.cibuildwheel.overrides]]
select = "*musllinux*"
environment = { PATH = "$PATH:$HOME/.cargo/bin", CARGO_NET_GIT_FETCH_WITH_CLI = "true", RUSTFLAGS = "-C target-feature=-crt-static" }
environment = { PATH = "$PATH:$HOME/.cargo/bin", CARGO_NET_GIT_FETCH_WITH_CLI = "true", RUSTFLAGS = "-C target-feature=-crt-static", MATURIN_PEP517_ARGS = "--features streams" }

[tool.mypy]
ignore_missing_imports = true
Expand All @@ -183,6 +185,8 @@ exclude = [
'temporalio/api',
'temporalio/bridge/proto',
'temporalio/nexus/system/workflow_service',
# The Core submodule, which has a script of the crate's test vectors
'temporalio/bridge/sdk-core',
]

[[tool.mypy.overrides]]
Expand All @@ -192,7 +196,7 @@ ignore_errors = true
[tool.pydocstyle]
convention = "google"
# https://github.com/PyCQA/pydocstyle/issues/363#issuecomment-625563088
match_dir = "^(?!(docs|scripts|tests|api|proto|system|_support|notifications|\\.)).*"
match_dir = "^(?!(docs|scripts|tests|api|proto|system|_support|notifications|sdk-core|\\.)).*"
add_ignore = [
# We like to wrap at a certain number of chars, even long summary sentences.
# https://github.com/PyCQA/pydocstyle/issues/184
Expand Down Expand Up @@ -259,10 +263,14 @@ exclude = [
"temporalio/bridge/proto",
"temporalio/bridge/_visitor.py",
"tests/worker/workflow_sandbox/testmodules/proto",
# The Core submodule, which has a script of the crate's test vectors
"temporalio/bridge/sdk-core",
]

[tool.ruff]
target-version = "py310"
# The Core submodule, which has a script of the crate's test vectors
extend-exclude = ["temporalio/bridge/sdk-core"]

[build-system]
requires = ["maturin>=1.0,<2.0"]
Expand Down
10 changes: 10 additions & 0 deletions temporalio/api/enums/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
from .query_pb2 import QueryRejectCondition, QueryResultType
from .reset_pb2 import ResetReapplyExcludeType, ResetReapplyType, ResetType
from .schedule_pb2 import ScheduleOverlapPolicy
from .stream_pb2 import (
StreamErrorReason,
StreamIdConflictPolicy,
StreamReadStart,
StreamStatus,
)
from .task_queue_pb2 import (
BuildIdTaskReachability,
DescribeTaskQueueMode,
Expand Down Expand Up @@ -120,6 +126,10 @@
"Severity",
"SignalExternalWorkflowExecutionFailedCause",
"StartChildWorkflowExecutionFailedCause",
"StreamErrorReason",
"StreamIdConflictPolicy",
"StreamReadStart",
"StreamStatus",
"SuggestContinueAsNewReason",
"TaskQueueKind",
"TaskQueueType",
Expand Down
70 changes: 70 additions & 0 deletions temporalio/api/enums/v1/stream_pb2.py

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

211 changes: 211 additions & 0 deletions temporalio/api/enums/v1/stream_pb2.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
"""
@generated by mypy-protobuf. Do not edit manually!
isort:skip_file
"""

import builtins
import sys
import typing

import google.protobuf.descriptor
import google.protobuf.internal.enum_type_wrapper

if sys.version_info >= (3, 10):
import typing as typing_extensions
else:
import typing_extensions

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

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

class _StreamStatusEnumTypeWrapper(
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[
_StreamStatus.ValueType
],
builtins.type,
): # noqa: F821
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
STREAM_STATUS_UNSPECIFIED: _StreamStatus.ValueType # 0
STREAM_STATUS_OPEN: _StreamStatus.ValueType # 1
STREAM_STATUS_CLOSED: _StreamStatus.ValueType # 2
STREAM_STATUS_EXPIRED: _StreamStatus.ValueType # 3

class StreamStatus(_StreamStatus, metaclass=_StreamStatusEnumTypeWrapper):
"""Experimental. Might change in the future.
The state of a Stream, as a describe gives it.
(-- api-linter: core::0216::synonyms=disabled
aip.dev/not-precedent: Named consistently with WorkflowExecutionStatus. --)
"""

STREAM_STATUS_UNSPECIFIED: StreamStatus.ValueType # 0
STREAM_STATUS_OPEN: StreamStatus.ValueType # 1
STREAM_STATUS_CLOSED: StreamStatus.ValueType # 2
STREAM_STATUS_EXPIRED: StreamStatus.ValueType # 3
global___StreamStatus = StreamStatus

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

class _StreamReadStartEnumTypeWrapper(
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[
_StreamReadStart.ValueType
],
builtins.type,
): # noqa: F821
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
STREAM_READ_START_UNSPECIFIED: _StreamReadStart.ValueType # 0
STREAM_READ_START_BEGINNING: _StreamReadStart.ValueType # 1
STREAM_READ_START_END: _StreamReadStart.ValueType # 2

class StreamReadStart(_StreamReadStart, metaclass=_StreamReadStartEnumTypeWrapper):
"""Experimental. Might change in the future.
Where a read starts when it has no from_offset.
"""

STREAM_READ_START_UNSPECIFIED: StreamReadStart.ValueType # 0
STREAM_READ_START_BEGINNING: StreamReadStart.ValueType # 1
STREAM_READ_START_END: StreamReadStart.ValueType # 2
global___StreamReadStart = StreamReadStart

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

class _StreamIdConflictPolicyEnumTypeWrapper(
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[
_StreamIdConflictPolicy.ValueType
],
builtins.type,
): # noqa: F821
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
STREAM_ID_CONFLICT_POLICY_UNSPECIFIED: _StreamIdConflictPolicy.ValueType # 0
STREAM_ID_CONFLICT_POLICY_FAIL: _StreamIdConflictPolicy.ValueType # 1
"""The create fails with ALREADY_EXISTS."""
STREAM_ID_CONFLICT_POLICY_USE_EXISTING: _StreamIdConflictPolicy.ValueType # 2
"""The create gets the open Stream, which keeps its own Retention."""

class StreamIdConflictPolicy(
_StreamIdConflictPolicy, metaclass=_StreamIdConflictPolicyEnumTypeWrapper
):
"""Experimental. Might change in the future.
What a create does when its Stream exists. Unspecified is FAIL, as for a Workflow start.
"""

STREAM_ID_CONFLICT_POLICY_UNSPECIFIED: StreamIdConflictPolicy.ValueType # 0
STREAM_ID_CONFLICT_POLICY_FAIL: StreamIdConflictPolicy.ValueType # 1
"""The create fails with ALREADY_EXISTS."""
STREAM_ID_CONFLICT_POLICY_USE_EXISTING: StreamIdConflictPolicy.ValueType # 2
"""The create gets the open Stream, which keeps its own Retention."""
global___StreamIdConflictPolicy = StreamIdConflictPolicy

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

class _StreamErrorReasonEnumTypeWrapper(
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[
_StreamErrorReason.ValueType
],
builtins.type,
): # noqa: F821
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
STREAM_ERROR_REASON_UNSPECIFIED: _StreamErrorReason.ValueType # 0
STREAM_ERROR_REASON_NOT_FOUND: _StreamErrorReason.ValueType # 1
"""Nobody created the Stream, even after `create_wait`. NOT_FOUND."""
STREAM_ERROR_REASON_EXPIRED: _StreamErrorReason.ValueType # 2
"""The Stream's Retention or safety TTL passed. NOT_FOUND."""
STREAM_ERROR_REASON_CLOSED: _StreamErrorReason.ValueType # 3
"""The Stream is closed. FAILED_PRECONDITION."""
STREAM_ERROR_REASON_FENCED: _StreamErrorReason.ValueType # 4
"""The Producer's epoch is lower than the newest one, its Workflow Task was withdrawn, or a
Workflow retry withdrew its run. FAILED_PRECONDITION.
"""
STREAM_ERROR_REASON_SEQUENCE_TOO_LOW: _StreamErrorReason.ValueType # 5
"""The batch has a lower `sequence` than the last one of its epoch. FAILED_PRECONDITION."""
STREAM_ERROR_REASON_SEQ_DIVERGENT: _StreamErrorReason.ValueType # 6
"""The batch has the `sequence` of the last one of its epoch, and other content.
FAILED_PRECONDITION.
"""
STREAM_ERROR_REASON_NOT_OWNER: _StreamErrorReason.ValueType # 7
"""A create gives another owner than the Stream has, or the owner doesn't allow this close.
FAILED_PRECONDITION.
"""
STREAM_ERROR_REASON_FORMAT_TOO_NEW: _StreamErrorReason.ValueType # 8
"""A newer format version wrote the Stream. FAILED_PRECONDITION."""
STREAM_ERROR_REASON_OFFSET_TOO_HIGH: _StreamErrorReason.ValueType # 9
"""The offset is past the newest offset + 1, for example after a failover lost the newest
Records. A read from it works again once the Stream has Records up to it. OUT_OF_RANGE.
"""
STREAM_ERROR_REASON_TOO_LARGE: _StreamErrorReason.ValueType # 10
"""A Record or a batch is over the Store's limit. INVALID_ARGUMENT."""
STREAM_ERROR_REASON_INVALID: _StreamErrorReason.ValueType # 11
"""The request is malformed. INVALID_ARGUMENT."""
STREAM_ERROR_REASON_STORAGE_UNAVAILABLE: _StreamErrorReason.ValueType # 12
"""The Store failed or did not answer. A retry can succeed. UNAVAILABLE."""
STREAM_ERROR_REASON_UNKNOWN_WRITER: _StreamErrorReason.ValueType # 13
"""No writer has the id. The SDK's in-process writer only. NOT_FOUND."""
STREAM_ERROR_REASON_UNSUPPORTED: _StreamErrorReason.ValueType # 14
"""The Store lacks a capability that the call needs. UNIMPLEMENTED."""
STREAM_ERROR_REASON_ALREADY_EXISTS: _StreamErrorReason.ValueType # 15
"""A create with the FAIL conflict policy is for a Stream that exists. ALREADY_EXISTS."""
STREAM_ERROR_REASON_STORAGE_CORRUPT: _StreamErrorReason.ValueType # 16
"""The Store gave back data that isn't valid, such as a stored value with the wrong length. A
retry reads the same data. DATA_LOSS.
"""

class StreamErrorReason(
_StreamErrorReason, metaclass=_StreamErrorReasonEnumTypeWrapper
):
"""Experimental. Might change in the future.
Why a Stream call failed. Each reason has one gRPC status code. An SDK raises its own error
class for each reason that code can act on, and a base class for the others.
"""

STREAM_ERROR_REASON_UNSPECIFIED: StreamErrorReason.ValueType # 0
STREAM_ERROR_REASON_NOT_FOUND: StreamErrorReason.ValueType # 1
"""Nobody created the Stream, even after `create_wait`. NOT_FOUND."""
STREAM_ERROR_REASON_EXPIRED: StreamErrorReason.ValueType # 2
"""The Stream's Retention or safety TTL passed. NOT_FOUND."""
STREAM_ERROR_REASON_CLOSED: StreamErrorReason.ValueType # 3
"""The Stream is closed. FAILED_PRECONDITION."""
STREAM_ERROR_REASON_FENCED: StreamErrorReason.ValueType # 4
"""The Producer's epoch is lower than the newest one, its Workflow Task was withdrawn, or a
Workflow retry withdrew its run. FAILED_PRECONDITION.
"""
STREAM_ERROR_REASON_SEQUENCE_TOO_LOW: StreamErrorReason.ValueType # 5
"""The batch has a lower `sequence` than the last one of its epoch. FAILED_PRECONDITION."""
STREAM_ERROR_REASON_SEQ_DIVERGENT: StreamErrorReason.ValueType # 6
"""The batch has the `sequence` of the last one of its epoch, and other content.
FAILED_PRECONDITION.
"""
STREAM_ERROR_REASON_NOT_OWNER: StreamErrorReason.ValueType # 7
"""A create gives another owner than the Stream has, or the owner doesn't allow this close.
FAILED_PRECONDITION.
"""
STREAM_ERROR_REASON_FORMAT_TOO_NEW: StreamErrorReason.ValueType # 8
"""A newer format version wrote the Stream. FAILED_PRECONDITION."""
STREAM_ERROR_REASON_OFFSET_TOO_HIGH: StreamErrorReason.ValueType # 9
"""The offset is past the newest offset + 1, for example after a failover lost the newest
Records. A read from it works again once the Stream has Records up to it. OUT_OF_RANGE.
"""
STREAM_ERROR_REASON_TOO_LARGE: StreamErrorReason.ValueType # 10
"""A Record or a batch is over the Store's limit. INVALID_ARGUMENT."""
STREAM_ERROR_REASON_INVALID: StreamErrorReason.ValueType # 11
"""The request is malformed. INVALID_ARGUMENT."""
STREAM_ERROR_REASON_STORAGE_UNAVAILABLE: StreamErrorReason.ValueType # 12
"""The Store failed or did not answer. A retry can succeed. UNAVAILABLE."""
STREAM_ERROR_REASON_UNKNOWN_WRITER: StreamErrorReason.ValueType # 13
"""No writer has the id. The SDK's in-process writer only. NOT_FOUND."""
STREAM_ERROR_REASON_UNSUPPORTED: StreamErrorReason.ValueType # 14
"""The Store lacks a capability that the call needs. UNIMPLEMENTED."""
STREAM_ERROR_REASON_ALREADY_EXISTS: StreamErrorReason.ValueType # 15
"""A create with the FAIL conflict policy is for a Stream that exists. ALREADY_EXISTS."""
STREAM_ERROR_REASON_STORAGE_CORRUPT: StreamErrorReason.ValueType # 16
"""The Store gave back data that isn't valid, such as a stored value with the wrong length. A
retry reads the same data. DATA_LOSS.
"""
global___StreamErrorReason = StreamErrorReason
Empty file.
Loading
Loading