Skip to content
Merged
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 pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ license = "MIT"
license-files = ["LICENSE"]
authors = [{ name = "Restate Developers", email = "dev@restate.dev" }]
readme = "README.md"
dependencies = ["typing-extensions>=4.14.0"]
dependencies = []

[project.urls]
Homepage = "https://restate.dev"
Expand Down
10 changes: 6 additions & 4 deletions python/restate/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import typing
from datetime import timedelta

import typing_extensions
from restate.serde import DefaultSerde, Serde

T = TypeVar('T')
Expand Down Expand Up @@ -246,7 +245,6 @@ def time(self) -> RestateDurableFuture[float]:
"""

@overload
@typing_extensions.deprecated("`run` is deprecated, use `run_typed` instead for better type safety")
@abc.abstractmethod
def run(self,
name: str,
Expand All @@ -260,6 +258,8 @@ def run(self,
"""
Runs the given action with the given name.

DEPRECATED: Use ctx.run_typed instead.

Args:
name: The name of the action.
action: The action to run.
Expand All @@ -276,7 +276,6 @@ def run(self,
"""

@overload
@typing_extensions.deprecated("`run` is deprecated, use `run_typed` instead for better type safety")
@abc.abstractmethod
def run(self,
name: str,
Expand All @@ -290,6 +289,8 @@ def run(self,
"""
Runs the given coroutine action with the given name.

DEPRECATED: Use ctx.run_typed instead.

Args:
name: The name of the action.
action: The action to run.
Expand All @@ -305,7 +306,6 @@ def run(self,

"""

@typing_extensions.deprecated("`run` is deprecated, use `run_typed` instead for better type safety")
@abc.abstractmethod
def run(self,
name: str,
Expand All @@ -319,6 +319,8 @@ def run(self,
"""
Runs the given action with the given name.

DEPRECATED: Use ctx.run_typed instead.

Args:
name: The name of the action.
action: The action to run.
Expand Down
2 changes: 0 additions & 2 deletions python/restate/server_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
from restate.server_types import ReceiveChannel, Send
from restate.vm import Failure, Invocation, NotReady, VMWrapper, RunRetryConfig, Suspended # pylint: disable=line-too-long
from restate.vm import DoProgressAnyCompleted, DoProgressCancelSignalReceived, DoProgressReadFromInput, DoProgressExecuteRun, DoWaitPendingRun
import typing_extensions


T = TypeVar('T')
Expand Down Expand Up @@ -576,7 +575,6 @@ async def create_run_coroutine(self,
self.vm.propose_run_completion_transient(handle, failure=failure, attempt_duration_ms=1, config=config)
# pylint: disable=W0236
# pylint: disable=R0914
@typing_extensions.deprecated("`run` is deprecated, use `run_typed` instead for better type safety")
def run(self,
name: str,
action: RunAction[T],
Expand Down
8 changes: 1 addition & 7 deletions python/restate/server_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,13 @@
import asyncio
from typing import (Awaitable, Callable, Dict, Iterable, List,
Tuple, Union, TypedDict, Literal, Optional, Any)
import sys
if sys.version_info >= (3, 11):
from typing import NotRequired
else:
from typing_extensions import NotRequired

class ASGIVersions(TypedDict):
"""ASGI Versions"""
spec_version: str
version: Union[Literal["2.0"], Literal["3.0"]]

class Scope(TypedDict):
class Scope(TypedDict, total=False):
"""ASGI Scope"""
type: Literal["http"]
asgi: ASGIVersions
Expand All @@ -42,7 +37,6 @@ class Scope(TypedDict):
headers: Iterable[Tuple[bytes, bytes]]
client: Optional[Tuple[str, int]]
server: Optional[Tuple[str, Optional[int]]]
state: NotRequired[Dict[str, Any]]
extensions: Optional[Dict[str, Dict[object, object]]]

class RestateEvent(TypedDict):
Expand Down