modal 0.73.68__py3-none-any.whl → 0.73.70__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/_functions.py +26 -17
- modal/client.pyi +2 -2
- modal/functions.pyi +14 -12
- {modal-0.73.68.dist-info → modal-0.73.70.dist-info}/METADATA +1 -1
- {modal-0.73.68.dist-info → modal-0.73.70.dist-info}/RECORD +11 -11
- modal_docs/gen_reference_docs.py +1 -7
- modal_version/_version_generated.py +1 -1
- {modal-0.73.68.dist-info → modal-0.73.70.dist-info}/LICENSE +0 -0
- {modal-0.73.68.dist-info → modal-0.73.70.dist-info}/WHEEL +0 -0
- {modal-0.73.68.dist-info → modal-0.73.70.dist-info}/entry_points.txt +0 -0
- {modal-0.73.68.dist-info → modal-0.73.70.dist-info}/top_level.txt +0 -0
modal/_functions.py
CHANGED
@@ -1597,26 +1597,35 @@ class _FunctionCall(typing.Generic[ReturnType], _Object, type_prefix="fc"):
|
|
1597
1597
|
fc._is_generator = is_generator
|
1598
1598
|
return fc
|
1599
1599
|
|
1600
|
+
@staticmethod
|
1601
|
+
async def gather(*function_calls: "_FunctionCall[Any]") -> list[Any]:
|
1602
|
+
"""Wait until all Modal FunctionCall objects have results before returning.
|
1600
1603
|
|
1601
|
-
|
1602
|
-
"""Wait until all Modal function calls have results before returning
|
1604
|
+
Accepts a variable number of `FunctionCall` objects, as returned by `Function.spawn()`.
|
1603
1605
|
|
1604
|
-
|
1606
|
+
Returns a list of results from each FunctionCall, or raises an exception
|
1607
|
+
from the first failing function call.
|
1605
1608
|
|
1606
|
-
|
1607
|
-
|
1609
|
+
Examples:
|
1610
|
+
|
1611
|
+
```python notest
|
1612
|
+
fc1 = slow_func_1.spawn()
|
1613
|
+
fc2 = slow_func_2.spawn()
|
1608
1614
|
|
1609
|
-
|
1615
|
+
result_1, result_2 = modal.FunctionCall.gather(fc1, fc2)
|
1616
|
+
```
|
1617
|
+
"""
|
1618
|
+
try:
|
1619
|
+
return await TaskContext.gather(*[fc.get() for fc in function_calls])
|
1620
|
+
except Exception as exc:
|
1621
|
+
# TODO: kill all running function calls
|
1622
|
+
raise exc
|
1610
1623
|
|
1611
|
-
```python notest
|
1612
|
-
function_call_1 = slow_func_1.spawn()
|
1613
|
-
function_call_2 = slow_func_2.spawn()
|
1614
1624
|
|
1615
|
-
|
1616
|
-
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
1622
|
-
raise exc
|
1625
|
+
async def _gather(*function_calls: _FunctionCall[ReturnType]) -> typing.Sequence[ReturnType]:
|
1626
|
+
"""Deprecated: Please use `modal.FunctionCall.gather()` instead."""
|
1627
|
+
deprecation_warning(
|
1628
|
+
(2025, 2, 24),
|
1629
|
+
"`modal.functions.gather()` is deprecated; please use `modal.FunctionCall.gather()` instead.",
|
1630
|
+
)
|
1631
|
+
return await _FunctionCall.gather(*function_calls)
|
modal/client.pyi
CHANGED
@@ -27,7 +27,7 @@ class _Client:
|
|
27
27
|
_snapshotted: bool
|
28
28
|
|
29
29
|
def __init__(
|
30
|
-
self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.73.
|
30
|
+
self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.73.70"
|
31
31
|
): ...
|
32
32
|
def is_closed(self) -> bool: ...
|
33
33
|
@property
|
@@ -85,7 +85,7 @@ class Client:
|
|
85
85
|
_snapshotted: bool
|
86
86
|
|
87
87
|
def __init__(
|
88
|
-
self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.73.
|
88
|
+
self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.73.70"
|
89
89
|
): ...
|
90
90
|
def is_closed(self) -> bool: ...
|
91
91
|
@property
|
modal/functions.pyi
CHANGED
@@ -198,11 +198,11 @@ class Function(
|
|
198
198
|
|
199
199
|
_call_generator_nowait: ___call_generator_nowait_spec[typing_extensions.Self]
|
200
200
|
|
201
|
-
class __remote_spec(typing_extensions.Protocol[
|
201
|
+
class __remote_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
|
202
202
|
def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
|
203
203
|
async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
|
204
204
|
|
205
|
-
remote: __remote_spec[modal._functions.
|
205
|
+
remote: __remote_spec[modal._functions.ReturnType, modal._functions.P, typing_extensions.Self]
|
206
206
|
|
207
207
|
class __remote_gen_spec(typing_extensions.Protocol[SUPERSELF]):
|
208
208
|
def __call__(self, *args, **kwargs) -> typing.Generator[typing.Any, None, None]: ...
|
@@ -217,19 +217,19 @@ class Function(
|
|
217
217
|
self, *args: modal._functions.P.args, **kwargs: modal._functions.P.kwargs
|
218
218
|
) -> modal._functions.OriginalReturnType: ...
|
219
219
|
|
220
|
-
class ___experimental_spawn_spec(typing_extensions.Protocol[
|
220
|
+
class ___experimental_spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
|
221
221
|
def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
|
222
222
|
async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
|
223
223
|
|
224
224
|
_experimental_spawn: ___experimental_spawn_spec[
|
225
|
-
modal._functions.
|
225
|
+
modal._functions.ReturnType, modal._functions.P, typing_extensions.Self
|
226
226
|
]
|
227
227
|
|
228
|
-
class __spawn_spec(typing_extensions.Protocol[
|
228
|
+
class __spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
|
229
229
|
def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
|
230
230
|
async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
|
231
231
|
|
232
|
-
spawn: __spawn_spec[modal._functions.
|
232
|
+
spawn: __spawn_spec[modal._functions.ReturnType, modal._functions.P, typing_extensions.Self]
|
233
233
|
|
234
234
|
def get_raw_f(self) -> collections.abc.Callable[..., typing.Any]: ...
|
235
235
|
|
@@ -319,12 +319,14 @@ class FunctionCall(typing.Generic[modal._functions.ReturnType], modal.object.Obj
|
|
319
319
|
|
320
320
|
from_id: __from_id_spec
|
321
321
|
|
322
|
+
class __gather_spec(typing_extensions.Protocol):
|
323
|
+
def __call__(self, *function_calls: FunctionCall[typing.Any]) -> list[typing.Any]: ...
|
324
|
+
async def aio(self, *function_calls: FunctionCall[typing.Any]) -> list[typing.Any]: ...
|
325
|
+
|
326
|
+
gather: __gather_spec
|
327
|
+
|
322
328
|
class __gather_spec(typing_extensions.Protocol):
|
323
|
-
def __call__(
|
324
|
-
|
325
|
-
) -> typing.Sequence[modal._functions.ReturnType]: ...
|
326
|
-
async def aio(
|
327
|
-
self, *function_calls: FunctionCall[modal._functions.ReturnType]
|
328
|
-
) -> typing.Sequence[modal._functions.ReturnType]: ...
|
329
|
+
def __call__(self, *function_calls) -> typing.Sequence[modal._functions.ReturnType]: ...
|
330
|
+
async def aio(self, *function_calls) -> typing.Sequence[modal._functions.ReturnType]: ...
|
329
331
|
|
330
332
|
gather: __gather_spec
|
@@ -3,7 +3,7 @@ modal/__main__.py,sha256=CgIjP8m1xJjjd4AXc-delmR6LdBCZclw2A_V38CFIio,2870
|
|
3
3
|
modal/_clustered_functions.py,sha256=kTf-9YBXY88NutC1akI-gCbvf01RhMPCw-zoOI_YIUE,2700
|
4
4
|
modal/_clustered_functions.pyi,sha256=vllkegc99A0jrUOWa8mdlSbdp6uz36TsHhGxysAOpaQ,771
|
5
5
|
modal/_container_entrypoint.py,sha256=arhkIoF8nQNfa4iwYGSoqN3QMDg5M38QNAODXC8TlKc,29301
|
6
|
-
modal/_functions.py,sha256=
|
6
|
+
modal/_functions.py,sha256=34kHxFM4k1oSb0OV2Op6uDuiT-jEBG8cbo3NfqhAgew,71417
|
7
7
|
modal/_ipython.py,sha256=TW1fkVOmZL3YYqdS2YlM1hqpf654Yf8ZyybHdBnlhSw,301
|
8
8
|
modal/_location.py,sha256=joiX-0ZeutEUDTrrqLF1GHXCdVLF-rHzstocbMcd_-k,366
|
9
9
|
modal/_object.py,sha256=ItQcsMNkz9Y3kdTsvfNarbW-paJ2qabDyQ7njaqY0XI,11359
|
@@ -22,7 +22,7 @@ modal/app.py,sha256=o5mHoHtn41nkvskX_ekJkyfG6MXwj5rqerRi_nnPd0w,44725
|
|
22
22
|
modal/app.pyi,sha256=0MMCgskIL4r3eq8oBcfm2lLyeao2gXjS3iXaIfmaJ-o,25959
|
23
23
|
modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
|
24
24
|
modal/client.py,sha256=8SQawr7P1PNUCq1UmJMUQXG2jIo4Nmdcs311XqrNLRE,15276
|
25
|
-
modal/client.pyi,sha256=
|
25
|
+
modal/client.pyi,sha256=jfTFP_MJG-DFOQMMaG2k-pnXlPYuFPS5FU_ZZ18jZuc,7593
|
26
26
|
modal/cloud_bucket_mount.py,sha256=YOe9nnvSr4ZbeCn587d7_VhE9IioZYRvF9VYQTQux08,5914
|
27
27
|
modal/cloud_bucket_mount.pyi,sha256=30T3K1a89l6wzmEJ_J9iWv9SknoGqaZDx59Xs-ZQcmk,1607
|
28
28
|
modal/cls.py,sha256=wztMTYkhJyW9iUVqx4_Gga4bJJpUiPgGsS6iacUqy-A,30001
|
@@ -41,7 +41,7 @@ modal/file_io.py,sha256=lcMs_E9Xfm0YX1t9U2wNIBPnqHRxmImqjLW1GHqVmyg,20945
|
|
41
41
|
modal/file_io.pyi,sha256=NTRft1tbPSWf9TlWVeZmTlgB5AZ_Zhu2srWIrWr7brk,9445
|
42
42
|
modal/file_pattern_matcher.py,sha256=trosX-Bp7dOubudN1bLLhRAoidWy1TcoaR4Pv8CedWw,6497
|
43
43
|
modal/functions.py,sha256=kcNHvqeGBxPI7Cgd57NIBBghkfbeFJzXO44WW0jSmao,325
|
44
|
-
modal/functions.pyi,sha256=
|
44
|
+
modal/functions.pyi,sha256=lDfxeLy6KbnGrrf0PXvNAKG6Rmz61rFNiuMIQSsy2Zc,14405
|
45
45
|
modal/gpu.py,sha256=Kbhs_u49FaC2Zi0TjCdrpstpRtT5eZgecynmQi5IZVE,6752
|
46
46
|
modal/image.py,sha256=Bs1ND2WkLr9CBtj0heO7e3w9uGCnijKU8owiQSRQXv0,90200
|
47
47
|
modal/image.pyi,sha256=L7aZUOElSGtNHmFHz1RgKP1cG5paiXt_EzylrwBwzVk,25004
|
@@ -146,7 +146,7 @@ modal/requirements/README.md,sha256=9tK76KP0Uph7O0M5oUgsSwEZDj5y-dcUPsnpR0Sc-Ik,
|
|
146
146
|
modal/requirements/base-images.json,sha256=kLNo5Sqmnhp9H6Hr9IcaGJFrRaRg1yfuepUWkm-y8iQ,571
|
147
147
|
modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
|
148
148
|
modal_docs/gen_cli_docs.py,sha256=c1yfBS_x--gL5bs0N4ihMwqwX8l3IBWSkBAKNNIi6bQ,3801
|
149
|
-
modal_docs/gen_reference_docs.py,sha256=
|
149
|
+
modal_docs/gen_reference_docs.py,sha256=H9p2zzOz8nyqrI0QRtnh-HLdWno3q4W49S1WcNeAwJA,6336
|
150
150
|
modal_docs/mdmd/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
|
151
151
|
modal_docs/mdmd/mdmd.py,sha256=Irx49MCCTlBOP4FBdLR--JrpA3-WhsVeriq0LGgsRic,6232
|
152
152
|
modal_docs/mdmd/signatures.py,sha256=XJaZrK7Mdepk5fdX51A8uENiLFNil85Ud0d4MH8H5f0,3218
|
@@ -168,10 +168,10 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
|
|
168
168
|
modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
169
169
|
modal_version/__init__.py,sha256=wiJQ53c-OMs0Xf1UeXOxQ7FwlV1VzIjnX6o-pRYZ_Pk,470
|
170
170
|
modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
|
171
|
-
modal_version/_version_generated.py,sha256=
|
172
|
-
modal-0.73.
|
173
|
-
modal-0.73.
|
174
|
-
modal-0.73.
|
175
|
-
modal-0.73.
|
176
|
-
modal-0.73.
|
177
|
-
modal-0.73.
|
171
|
+
modal_version/_version_generated.py,sha256=UfwYrb3hGJba8vucUJgdHnhPqXWfh5WwXR3nCvVGPqM,149
|
172
|
+
modal-0.73.70.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
|
173
|
+
modal-0.73.70.dist-info/METADATA,sha256=JRCZ0HrVnOUIw_mVHwWsD5cmauUMzcPKcq6Cs08eIP0,2452
|
174
|
+
modal-0.73.70.dist-info/WHEEL,sha256=nn6H5-ilmfVryoAQl3ZQ2l8SH5imPWFpm1A5FgEuFV4,91
|
175
|
+
modal-0.73.70.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
|
176
|
+
modal-0.73.70.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
|
177
|
+
modal-0.73.70.dist-info/RECORD,,
|
modal_docs/gen_reference_docs.py
CHANGED
@@ -76,20 +76,14 @@ def run(output_dir: str = None):
|
|
76
76
|
|
77
77
|
base_title_level = "#"
|
78
78
|
forced_module_docs = [
|
79
|
-
("modal.Function", "modal.functions"),
|
80
|
-
("modal.Secret", "modal.secret"),
|
81
|
-
("modal.Dict", "modal.dict"),
|
82
|
-
("modal.Queue", "modal.queue"),
|
83
79
|
("modal.call_graph", "modal.call_graph"),
|
84
80
|
("modal.gpu", "modal.gpu"),
|
85
81
|
("modal.runner", "modal.runner"),
|
86
|
-
("modal.Sandbox", "modal.sandbox"),
|
87
|
-
("modal.ContainerProcess", "modal.container_process"),
|
88
82
|
("modal.io_streams", "modal.io_streams"),
|
89
83
|
("modal.FileIO", "modal.file_io"),
|
90
84
|
]
|
91
85
|
# These aren't defined in `modal`, but should still be documented as top-level entries.
|
92
|
-
forced_members =
|
86
|
+
forced_members: set[str] = set()
|
93
87
|
# These are excluded from the sidebar, typically to 'soft release' some documentation.
|
94
88
|
sidebar_excluded: set[str] = set()
|
95
89
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|