modal 1.1.3.dev3__py3-none-any.whl → 1.1.3.dev5__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/client.pyi CHANGED
@@ -33,7 +33,7 @@ class _Client:
33
33
  server_url: str,
34
34
  client_type: int,
35
35
  credentials: typing.Optional[tuple[str, str]],
36
- version: str = "1.1.3.dev3",
36
+ version: str = "1.1.3.dev5",
37
37
  ):
38
38
  """mdmd:hidden
39
39
  The Modal client object is not intended to be instantiated directly by users.
@@ -164,7 +164,7 @@ class Client:
164
164
  server_url: str,
165
165
  client_type: int,
166
166
  credentials: typing.Optional[tuple[str, str]],
167
- version: str = "1.1.3.dev3",
167
+ version: str = "1.1.3.dev5",
168
168
  ):
169
169
  """mdmd:hidden
170
170
  The Modal client object is not intended to be instantiated directly by users.
modal/image.py CHANGED
@@ -1356,7 +1356,8 @@ class _Image(_Object, type_prefix="im"):
1356
1356
  image = modal.Image.debian_slim().uv_sync()
1357
1357
  ```
1358
1358
 
1359
- The `pyproject.toml` and `uv.lock` in `uv_project_dir` are automatically added to the build context.
1359
+ The `pyproject.toml` and `uv.lock` in `uv_project_dir` are automatically added to the build context. The
1360
+ `uv_project_dir` is relative to the current working directory of where `modal` is called.
1360
1361
 
1361
1362
  Added in v1.1.0.
1362
1363
  """
modal/image.pyi CHANGED
@@ -524,7 +524,8 @@ class _Image(modal._object._Object):
524
524
  image = modal.Image.debian_slim().uv_sync()
525
525
  ```
526
526
 
527
- The `pyproject.toml` and `uv.lock` in `uv_project_dir` are automatically added to the build context.
527
+ The `pyproject.toml` and `uv.lock` in `uv_project_dir` are automatically added to the build context. The
528
+ `uv_project_dir` is relative to the current working directory of where `modal` is called.
528
529
 
529
530
  Added in v1.1.0.
530
531
  """
@@ -1368,7 +1369,8 @@ class Image(modal.object.Object):
1368
1369
  image = modal.Image.debian_slim().uv_sync()
1369
1370
  ```
1370
1371
 
1371
- The `pyproject.toml` and `uv.lock` in `uv_project_dir` are automatically added to the build context.
1372
+ The `pyproject.toml` and `uv.lock` in `uv_project_dir` are automatically added to the build context. The
1373
+ `uv_project_dir` is relative to the current working directory of where `modal` is called.
1372
1374
 
1373
1375
  Added in v1.1.0.
1374
1376
  """
modal/parallel_map.py CHANGED
@@ -673,9 +673,11 @@ async def _map_invocation_inputplane(
673
673
  # any reason).
674
674
  max_inputs_outstanding = MAX_INPUTS_OUTSTANDING_DEFAULT
675
675
 
676
- # Input plane does not yet return a retry policy. So we currently disable retries.
676
+ # Set a default retry policy to construct an instance of _MapItemsManager.
677
+ # We'll update the retry policy with the actual user-specified retry policy
678
+ # from the server in the first MapStartOrContinue response.
677
679
  retry_policy = api_pb2.FunctionRetryPolicy(
678
- retries=0, # Input plane does not yet return a retry policy. So only retry server failures for now.
680
+ retries=0,
679
681
  initial_delay_ms=1000,
680
682
  max_delay_ms=1000,
681
683
  backoff_coefficient=1.0,
@@ -771,10 +773,17 @@ async def _map_invocation_inputplane(
771
773
 
772
774
  map_items_manager.handle_put_continue_response(response_items_idx_tuple)
773
775
 
776
+ # Set the function call id and actual retry policy with the data from the first response.
777
+ # This conditional is skipped for subsequent iterations of this for-loop.
774
778
  if function_call_id is None:
775
779
  function_call_id = response.function_call_id
776
780
  function_call_id_received.set()
777
781
  max_inputs_outstanding = response.max_inputs_outstanding or MAX_INPUTS_OUTSTANDING_DEFAULT
782
+ map_items_manager.set_retry_policy(response.retry_policy)
783
+ # Update the retry policy for the first batch of inputs.
784
+ # Subsequent batches will have the correct user-specified retry policy
785
+ # set by the updated _MapItemsManager.
786
+ map_items_manager.update_items_retry_policy(response.retry_policy)
778
787
  yield
779
788
 
780
789
  async def check_lost_inputs():
@@ -1475,6 +1484,9 @@ class _MapItemContext:
1475
1484
  retry_count=self.retry_manager.retry_count,
1476
1485
  )
1477
1486
 
1487
+ def set_retry_policy(self, retry_policy: api_pb2.FunctionRetryPolicy):
1488
+ self.retry_manager = RetryManager(retry_policy)
1489
+
1478
1490
  def handle_retry_response(self, input_jwt: str):
1479
1491
  self.input_jwt.set_result(input_jwt)
1480
1492
  self.state = _MapItemState.WAITING_FOR_OUTPUT
@@ -1511,6 +1523,9 @@ class _MapItemsManager:
1511
1523
  self._sync_client_retries_enabled = sync_client_retries_enabled
1512
1524
  self._is_input_plane_instance = is_input_plane_instance
1513
1525
 
1526
+ def set_retry_policy(self, retry_policy: api_pb2.FunctionRetryPolicy):
1527
+ self._retry_policy = retry_policy
1528
+
1514
1529
  async def add_items(self, items: list[api_pb2.FunctionPutInputsItem]):
1515
1530
  for item in items:
1516
1531
  # acquire semaphore to limit the number of inputs in progress
@@ -1540,6 +1555,10 @@ class _MapItemsManager:
1540
1555
  async def prepare_items_for_retry(self, retriable_idxs: list[int]) -> list[api_pb2.FunctionRetryInputsItem]:
1541
1556
  return [await self._item_context[idx].prepare_item_for_retry() for idx in retriable_idxs]
1542
1557
 
1558
+ def update_items_retry_policy(self, retry_policy: api_pb2.FunctionRetryPolicy):
1559
+ for ctx in self._item_context.values():
1560
+ ctx.set_retry_policy(retry_policy)
1561
+
1543
1562
  def get_input_jwts_waiting_for_output(self) -> list[str]:
1544
1563
  """
1545
1564
  Returns a list of input_jwts for inputs that are waiting for output.
modal/parallel_map.pyi CHANGED
@@ -406,6 +406,7 @@ class _MapItemContext:
406
406
  ...
407
407
 
408
408
  async def prepare_item_for_retry(self) -> modal_proto.api_pb2.FunctionRetryInputsItem: ...
409
+ def set_retry_policy(self, retry_policy: modal_proto.api_pb2.FunctionRetryPolicy): ...
409
410
  def handle_retry_response(self, input_jwt: str): ...
410
411
  async def create_map_start_or_continue_item(self, idx: int) -> modal_proto.api_pb2.MapStartOrContinueItem: ...
411
412
 
@@ -422,11 +423,13 @@ class _MapItemsManager:
422
423
  """Initialize self. See help(type(self)) for accurate signature."""
423
424
  ...
424
425
 
426
+ def set_retry_policy(self, retry_policy: modal_proto.api_pb2.FunctionRetryPolicy): ...
425
427
  async def add_items(self, items: list[modal_proto.api_pb2.FunctionPutInputsItem]): ...
426
428
  async def add_items_inputplane(self, items: list[modal_proto.api_pb2.MapStartOrContinueItem]): ...
427
429
  async def prepare_items_for_retry(
428
430
  self, retriable_idxs: list[int]
429
431
  ) -> list[modal_proto.api_pb2.FunctionRetryInputsItem]: ...
432
+ def update_items_retry_policy(self, retry_policy: modal_proto.api_pb2.FunctionRetryPolicy): ...
430
433
  def get_input_jwts_waiting_for_output(self) -> list[str]:
431
434
  """Returns a list of input_jwts for inputs that are waiting for output."""
432
435
  ...
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modal
3
- Version: 1.1.3.dev3
3
+ Version: 1.1.3.dev5
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License: Apache-2.0
@@ -22,7 +22,7 @@ modal/app.py,sha256=hJU3DGzP5GwYRmBj57XajljkQtLxkKftxXih2TYRcKo,48047
22
22
  modal/app.pyi,sha256=0U2xVKD3yfHe5l2bcihTDjPl__tzOvx1AIYOTebu-5o,43375
23
23
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
24
24
  modal/client.py,sha256=kyAIVB3Ay-XKJizQ_1ufUFB__EagV0MLmHJpyYyJ7J0,18636
25
- modal/client.pyi,sha256=F0rZ98XW0UFZ-AReWqLTuvub4N5TiXZxJT369UTg330,15829
25
+ modal/client.pyi,sha256=n1UlIRprqMKQSiMHcRGFVhAt8tfZQ6Uc3yNJqLSQrCI,15829
26
26
  modal/cloud_bucket_mount.py,sha256=YOe9nnvSr4ZbeCn587d7_VhE9IioZYRvF9VYQTQux08,5914
27
27
  modal/cloud_bucket_mount.pyi,sha256=-qSfYAQvIoO_l2wsCCGTG5ZUwQieNKXdAO00yP1-LYU,7394
28
28
  modal/cls.py,sha256=1mBcExFrLDTZwkD3Dzu8F26_CL0CGktOV9pE60Y8g_E,40689
@@ -41,8 +41,8 @@ modal/file_pattern_matcher.py,sha256=A_Kdkej6q7YQyhM_2-BvpFmPqJ0oHb54B6yf9VqvPVE
41
41
  modal/functions.py,sha256=kcNHvqeGBxPI7Cgd57NIBBghkfbeFJzXO44WW0jSmao,325
42
42
  modal/functions.pyi,sha256=h1oPAvbErW_i1Glzf_HsQenG-uH4KZk7X6razFbif6M,38890
43
43
  modal/gpu.py,sha256=Fe5ORvVPDIstSq1xjmM6OoNgLYFWvogP9r5BgmD3hYg,6769
44
- modal/image.py,sha256=9pSLEGMxwal55AY-hbL4eTf0lq3xMwuQ0mN-Gc3E99M,103134
45
- modal/image.pyi,sha256=zwCW80xe2BL7q4_kswfljKRrKjMkK5paTY26e5ITM1U,68507
44
+ modal/image.py,sha256=wEtojqiLDHSFinuIlAzCieGYPPAYh9iEBtY3wOSF6js,103236
45
+ modal/image.pyi,sha256=vdxGAddVYpQNqpxM-XSzKkTtrajD74Nelgt8-IB5RAU,68711
46
46
  modal/io_streams.py,sha256=ut9tY_yEtiBsgQ40u_72Ns87IZHfbMxfnh8t6U9RSGA,16204
47
47
  modal/io_streams.pyi,sha256=aOun_jUFKHSJyUY6-7gKvNoxzcULsa8_hxdtEO7v-gk,13980
48
48
  modal/mount.py,sha256=AObt5puO-jgtH5EtUfgAkz130bR-8Qvo5Am1_4tg3mE,37215
@@ -52,8 +52,8 @@ modal/network_file_system.pyi,sha256=Td_IobHr84iLo_9LZKQ4tNdUB60yjX8QWBaFiUvhfi8
52
52
  modal/object.py,sha256=bTeskuY8JFrESjU4_UL_nTwYlBQdOLmVaOX3X6EMxsg,164
53
53
  modal/object.pyi,sha256=qlyVVMezW3XgJe_iqhtzWRSki3Nuk-KrpXc1g-r8ujA,6944
54
54
  modal/output.py,sha256=q4T9uHduunj4NwY-YSwkHGgjZlCXMuJbfQ5UFaAGRAc,1968
55
- modal/parallel_map.py,sha256=Pi6WrgVGmjUrz7hCGPbOCDeRKnKLGXxP3B0HuujIa9c,67508
56
- modal/parallel_map.pyi,sha256=dp_ip_JrbAf9qCkSyaKDdop8LjfRj5r_oc5LG26umOo,15527
55
+ modal/parallel_map.py,sha256=lgCtqWlBAfpVm0fw7RxoYnqTq9tDUZ6wtcPBakLRDzo,68544
56
+ modal/parallel_map.pyi,sha256=MjVotblObpEDRyKcMd2qFALC1emKpbC9Cdu-gkdewT4,15809
57
57
  modal/partial_function.py,sha256=aIdlGfTjjgqY6Fpr-biCjvRU9W542_S5N2xkNN_rYGM,1127
58
58
  modal/partial_function.pyi,sha256=lqqOzZ9-QvHTDWKQ_oAYYOvsXgTOBKhO9u-RI98JbUk,13986
59
59
  modal/proxy.py,sha256=CQydu_NPDgApN2GLdd7rrcg8PM-pXyFdVYcTaGMBRCQ,1491
@@ -153,7 +153,7 @@ modal/experimental/__init__.py,sha256=dPBPpxsmjZMLF3YjRrXoTvT01pl65wxi4UdFZsOem3
153
153
  modal/experimental/flash.py,sha256=viXQumCIFp5VFsPFURdFTBTjP_QnsAi8nSWXAMmfjeQ,19744
154
154
  modal/experimental/flash.pyi,sha256=A8_qJGtGoXEzKDdHbvhmCw7oqfneFEvJQK3ZdTOvUdU,10830
155
155
  modal/experimental/ipython.py,sha256=TrCfmol9LGsRZMeDoeMPx3Hv3BFqQhYnmD_iH0pqdhk,2904
156
- modal-1.1.3.dev3.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
156
+ modal-1.1.3.dev5.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
157
157
  modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
158
158
  modal_docs/gen_cli_docs.py,sha256=c1yfBS_x--gL5bs0N4ihMwqwX8l3IBWSkBAKNNIi6bQ,3801
159
159
  modal_docs/gen_reference_docs.py,sha256=d_CQUGQ0rfw28u75I2mov9AlS773z9rG40-yq5o7g2U,6359
@@ -161,10 +161,10 @@ modal_docs/mdmd/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,2
161
161
  modal_docs/mdmd/mdmd.py,sha256=tUTImNd4UMFk1opkaw8J672gX8AkBO5gbY2S_NMxsxs,7140
162
162
  modal_docs/mdmd/signatures.py,sha256=XJaZrK7Mdepk5fdX51A8uENiLFNil85Ud0d4MH8H5f0,3218
163
163
  modal_proto/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0VESpjWR0fc,28
164
- modal_proto/api.proto,sha256=COEYvEVL-RpN0laad0PAhVHP0ChZNGAnjimqPQ6pwlw,104712
164
+ modal_proto/api.proto,sha256=zcYEjjeaCHYQ_h3aU3-v8lNvbMiFNsMVI5YSGJhaurM,104672
165
165
  modal_proto/api_grpc.py,sha256=AWsKZFdXr_T6LpWGlMM6BDY30RdOPjqgoPMijR-R1lI,127964
166
166
  modal_proto/api_pb2.py,sha256=yoKWv2SoqnPhZ4cwb6bxoljOvDJeoBI9-TMLgd6PZ0c,366803
167
- modal_proto/api_pb2.pyi,sha256=9BnK5J8cmqeKgo57jW4WS5qlGVJfyVLP-AeuA__tWmU,506001
167
+ modal_proto/api_pb2.pyi,sha256=gC6R1OyT7MqecWoab0B3WUJMaRjjoKBAoIBA8mIxKyM,505954
168
168
  modal_proto/api_pb2_grpc.py,sha256=kDZBX6i1KdRpm4P3c2wdRbGe3XOFtqGHSbWE0vOe4F4,276062
169
169
  modal_proto/api_pb2_grpc.pyi,sha256=s1hjXmqaB3jGCSgnOouzncdfMVX0umPZd4TC1zObhgU,64579
170
170
  modal_proto/modal_api_grpc.py,sha256=faBxtXAqoz6ei8ntNu1MQTL859FFHH_LZww_FP9wubw,19311
@@ -176,10 +176,10 @@ modal_proto/options_pb2.pyi,sha256=l7DBrbLO7q3Ir-XDkWsajm0d0TQqqrfuX54i4BMpdQg,1
176
176
  modal_proto/options_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
177
177
  modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0yJSI,247
178
178
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
179
- modal_version/__init__.py,sha256=cXuBYyPLeQ0NDGD3GpT3f4jI8wrH0Ydql9I7MV77hTg,120
179
+ modal_version/__init__.py,sha256=_bIehjAfKMD1cNhCgBIIDNS8Pf0cOZfqD7TNg8DG1Qs,120
180
180
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
181
- modal-1.1.3.dev3.dist-info/METADATA,sha256=TxKaMMdWS6VkASan7YRw_yFFFKAn-OCMViJvA7N2RHA,2459
182
- modal-1.1.3.dev3.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
183
- modal-1.1.3.dev3.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
184
- modal-1.1.3.dev3.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
185
- modal-1.1.3.dev3.dist-info/RECORD,,
181
+ modal-1.1.3.dev5.dist-info/METADATA,sha256=dFiWRFKCMNjUBFCkTOF2nFACexJ403NKaaHxQE68ryY,2459
182
+ modal-1.1.3.dev5.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
183
+ modal-1.1.3.dev5.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
184
+ modal-1.1.3.dev5.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
185
+ modal-1.1.3.dev5.dist-info/RECORD,,
modal_proto/api.proto CHANGED
@@ -2167,7 +2167,7 @@ message MapStartOrContinueResponse {
2167
2167
  string function_call_id = 2;
2168
2168
  uint32 max_inputs_outstanding = 3;
2169
2169
  repeated string attempt_tokens = 4;
2170
- FunctionRetryPolicy retry_policy = 5; // TODO(ben-okeefe): Not currently used
2170
+ FunctionRetryPolicy retry_policy = 5;
2171
2171
  }
2172
2172
 
2173
2173
  message MethodDefinition {
modal_proto/api_pb2.pyi CHANGED
@@ -7006,8 +7006,7 @@ class MapStartOrContinueResponse(google.protobuf.message.Message):
7006
7006
  @property
7007
7007
  def attempt_tokens(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
7008
7008
  @property
7009
- def retry_policy(self) -> global___FunctionRetryPolicy:
7010
- """TODO(ben-okeefe): Not currently used"""
7009
+ def retry_policy(self) -> global___FunctionRetryPolicy: ...
7011
7010
  def __init__(
7012
7011
  self,
7013
7012
  *,
modal_version/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # Copyright Modal Labs 2025
2
2
  """Supplies the current version of the modal client library."""
3
3
 
4
- __version__ = "1.1.3.dev3"
4
+ __version__ = "1.1.3.dev5"