modal 0.71.5__py3-none-any.whl → 0.71.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- modal/_container_entrypoint.py +13 -3
- modal/_runtime/asgi.py +33 -29
- modal/client.pyi +2 -2
- modal/file_io.py +101 -83
- modal/file_io.pyi +4 -23
- modal/functions.pyi +6 -6
- modal/image.py +18 -0
- modal/image.pyi +9 -0
- modal/io_streams.py +27 -15
- {modal-0.71.5.dist-info → modal-0.71.9.dist-info}/METADATA +1 -1
- {modal-0.71.5.dist-info → modal-0.71.9.dist-info}/RECORD +19 -20
- modal_proto/api.proto +1 -0
- modal_proto/api_pb2.py +782 -782
- modal_proto/api_pb2.pyi +4 -1
- modal_version/_version_generated.py +1 -1
- modal/io_streams_helper.py +0 -53
- {modal-0.71.5.dist-info → modal-0.71.9.dist-info}/LICENSE +0 -0
- {modal-0.71.5.dist-info → modal-0.71.9.dist-info}/WHEEL +0 -0
- {modal-0.71.5.dist-info → modal-0.71.9.dist-info}/entry_points.txt +0 -0
- {modal-0.71.5.dist-info → modal-0.71.9.dist-info}/top_level.txt +0 -0
modal_proto/api_pb2.pyi
CHANGED
@@ -811,6 +811,7 @@ class AppDeploymentHistory(google.protobuf.message.Message):
|
|
811
811
|
CLIENT_VERSION_FIELD_NUMBER: builtins.int
|
812
812
|
DEPLOYED_AT_FIELD_NUMBER: builtins.int
|
813
813
|
DEPLOYED_BY_FIELD_NUMBER: builtins.int
|
814
|
+
DEPLOYED_BY_AVATAR_URL_FIELD_NUMBER: builtins.int
|
814
815
|
TAG_FIELD_NUMBER: builtins.int
|
815
816
|
ROLLBACK_VERSION_FIELD_NUMBER: builtins.int
|
816
817
|
ROLLBACK_ALLOWED_FIELD_NUMBER: builtins.int
|
@@ -819,6 +820,7 @@ class AppDeploymentHistory(google.protobuf.message.Message):
|
|
819
820
|
client_version: builtins.str
|
820
821
|
deployed_at: builtins.float
|
821
822
|
deployed_by: builtins.str
|
823
|
+
deployed_by_avatar_url: builtins.str
|
822
824
|
tag: builtins.str
|
823
825
|
rollback_version: builtins.int
|
824
826
|
rollback_allowed: builtins.bool
|
@@ -830,11 +832,12 @@ class AppDeploymentHistory(google.protobuf.message.Message):
|
|
830
832
|
client_version: builtins.str = ...,
|
831
833
|
deployed_at: builtins.float = ...,
|
832
834
|
deployed_by: builtins.str = ...,
|
835
|
+
deployed_by_avatar_url: builtins.str = ...,
|
833
836
|
tag: builtins.str = ...,
|
834
837
|
rollback_version: builtins.int = ...,
|
835
838
|
rollback_allowed: builtins.bool = ...,
|
836
839
|
) -> None: ...
|
837
|
-
def ClearField(self, field_name: typing_extensions.Literal["app_id", b"app_id", "client_version", b"client_version", "deployed_at", b"deployed_at", "deployed_by", b"deployed_by", "rollback_allowed", b"rollback_allowed", "rollback_version", b"rollback_version", "tag", b"tag", "version", b"version"]) -> None: ...
|
840
|
+
def ClearField(self, field_name: typing_extensions.Literal["app_id", b"app_id", "client_version", b"client_version", "deployed_at", b"deployed_at", "deployed_by", b"deployed_by", "deployed_by_avatar_url", b"deployed_by_avatar_url", "rollback_allowed", b"rollback_allowed", "rollback_version", b"rollback_version", "tag", b"tag", "version", b"version"]) -> None: ...
|
838
841
|
|
839
842
|
global___AppDeploymentHistory = AppDeploymentHistory
|
840
843
|
|
modal/io_streams_helper.py
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
# Copyright Modal Labs 2024
|
2
|
-
import asyncio
|
3
|
-
from typing import AsyncIterator, Callable, TypeVar
|
4
|
-
|
5
|
-
from grpclib.exceptions import GRPCError, StreamTerminatedError
|
6
|
-
|
7
|
-
from modal.exception import ClientClosed
|
8
|
-
|
9
|
-
from ._utils.grpc_utils import RETRYABLE_GRPC_STATUS_CODES
|
10
|
-
|
11
|
-
T = TypeVar("T")
|
12
|
-
|
13
|
-
|
14
|
-
async def consume_stream_with_retries(
|
15
|
-
stream: AsyncIterator[T],
|
16
|
-
item_handler: Callable[[T], None],
|
17
|
-
completion_check: Callable[[T], bool],
|
18
|
-
max_retries: int = 10,
|
19
|
-
retry_delay: float = 1.0,
|
20
|
-
) -> None:
|
21
|
-
"""mdmd:hidden
|
22
|
-
Helper function to consume a stream with retry logic for transient errors.
|
23
|
-
|
24
|
-
Args:
|
25
|
-
stream_generator: Function that returns an AsyncIterator to consume
|
26
|
-
item_handler: Callback function to handle each item from the stream
|
27
|
-
completion_check: Callback function to check if the stream is complete
|
28
|
-
max_retries: Maximum number of retry attempts
|
29
|
-
retry_delay: Delay in seconds between retries
|
30
|
-
"""
|
31
|
-
completed = False
|
32
|
-
retries_remaining = max_retries
|
33
|
-
|
34
|
-
while not completed:
|
35
|
-
try:
|
36
|
-
async for item in stream:
|
37
|
-
item_handler(item)
|
38
|
-
if completion_check(item):
|
39
|
-
completed = True
|
40
|
-
break
|
41
|
-
|
42
|
-
except (GRPCError, StreamTerminatedError, ClientClosed) as exc:
|
43
|
-
if retries_remaining > 0:
|
44
|
-
retries_remaining -= 1
|
45
|
-
if isinstance(exc, GRPCError):
|
46
|
-
if exc.status in RETRYABLE_GRPC_STATUS_CODES:
|
47
|
-
await asyncio.sleep(retry_delay)
|
48
|
-
continue
|
49
|
-
elif isinstance(exc, StreamTerminatedError):
|
50
|
-
continue
|
51
|
-
elif isinstance(exc, ClientClosed):
|
52
|
-
break
|
53
|
-
raise
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|