modal 0.73.93__py3-none-any.whl → 0.73.95__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.
@@ -385,6 +385,10 @@ class AsyncOrSyncIterable:
385
385
  except NestedEventLoops:
386
386
  raise InvalidError(self.nested_async_message)
387
387
 
388
+ async def aclose(self):
389
+ if hasattr(self._async_iterable, "aclose"):
390
+ await self._async_iterable.aclose()
391
+
388
392
 
389
393
  _shutdown_tasks = []
390
394
 
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.93"
30
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.73.95"
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.93"
88
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.73.95"
89
89
  ): ...
90
90
  def is_closed(self) -> bool: ...
91
91
  @property
modal/cls.py CHANGED
@@ -563,7 +563,7 @@ class _Cls(_Object, type_prefix="cs"):
563
563
  await resolver.load(self._class_service_function)
564
564
  self._hydrate(response.class_id, resolver.client, response.handle_metadata)
565
565
 
566
- rep = f"Ref({app_name})"
566
+ rep = f"Cls.from_name({app_name!r}, {name!r})"
567
567
  cls = cls._from_loader(_load_remote, rep, is_another_app=True, hydrate_lazily=True)
568
568
 
569
569
  class_service_name = f"{name}.*" # special name of the base service function for the class
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[ReturnType_INNER, P_INNER, SUPERSELF]):
201
+ class __remote_spec(typing_extensions.Protocol[P_INNER, ReturnType_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.ReturnType, modal._functions.P, typing_extensions.Self]
205
+ remote: __remote_spec[modal._functions.P, modal._functions.ReturnType, 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[ReturnType_INNER, P_INNER, SUPERSELF]):
220
+ class ___experimental_spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_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.ReturnType, modal._functions.P, typing_extensions.Self
225
+ modal._functions.P, modal._functions.ReturnType, typing_extensions.Self
226
226
  ]
227
227
 
228
- class __spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
228
+ class __spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_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.ReturnType, modal._functions.P, typing_extensions.Self]
232
+ spawn: __spawn_spec[modal._functions.P, modal._functions.ReturnType, typing_extensions.Self]
233
233
 
234
234
  def get_raw_f(self) -> collections.abc.Callable[..., typing.Any]: ...
235
235
 
modal/image.py CHANGED
@@ -947,7 +947,7 @@ class _Image(_Object, type_prefix="im"):
947
947
  resp = await retry_transient_errors(client.stub.ImageFromId, api_pb2.ImageFromIdRequest(image_id=image_id))
948
948
  self._hydrate(resp.image_id, resolver.client, resp.metadata)
949
949
 
950
- rep = "Image()"
950
+ rep = f"Image.from_id({image_id!r})"
951
951
  obj = _Image._from_loader(_load, rep)
952
952
 
953
953
  return obj
modal/parallel_map.py CHANGED
@@ -312,7 +312,7 @@ def _map_sync(
312
312
 
313
313
  @warn_if_generator_is_not_consumed(function_name="Function.map.aio")
314
314
  async def _map_async(
315
- self,
315
+ self: "modal.functions.Function",
316
316
  *input_iterators: typing.Union[
317
317
  typing.Iterable[Any], typing.AsyncIterable[Any]
318
318
  ], # one input iterator per argument in the mapped-over function/generator
@@ -339,19 +339,20 @@ async def _map_async(
339
339
  async for args in streamer:
340
340
  await raw_input_queue.put.aio((args, kwargs))
341
341
  await raw_input_queue.put.aio(None) # end-of-input sentinel
342
-
343
- feed_input_task = asyncio.create_task(feed_queue())
344
-
345
- try:
346
- # note that `map()` and `map.aio()` are not synchronicity-wrapped, since
347
- # they accept executable code in the form of
348
- # iterators that we don't want to run inside the synchronicity thread.
349
- # Instead, we delegate to `._map()` with a safer Queue as input
350
- async with aclosing(self._map.aio(raw_input_queue, order_outputs, return_exceptions)) as map_output_stream:
351
- async for output in map_output_stream:
352
- yield output
353
- finally:
354
- feed_input_task.cancel() # should only be needed in case of exceptions
342
+ if False:
343
+ # make this a never yielding generator so we can async_merge it below
344
+ # this is important so any exception raised in feed_queue will be propagated
345
+ yield
346
+
347
+ # note that `map()` and `map.aio()` are not synchronicity-wrapped, since
348
+ # they accept executable code in the form of
349
+ # iterators that we don't want to run inside the synchronicity thread.
350
+ # Instead, we delegate to `._map()` with a safer Queue as input
351
+ async with aclosing(
352
+ async_merge(self._map.aio(raw_input_queue, order_outputs, return_exceptions), feed_queue())
353
+ ) as map_output_stream:
354
+ async for output in map_output_stream:
355
+ yield output
355
356
 
356
357
 
357
358
  def _for_each_sync(self, *input_iterators, kwargs={}, ignore_exceptions: bool = False):
modal/parallel_map.pyi CHANGED
@@ -2,6 +2,7 @@ import collections.abc
2
2
  import modal._functions
3
3
  import modal._utils.async_utils
4
4
  import modal.client
5
+ import modal.functions
5
6
  import typing
6
7
  import typing_extensions
7
8
 
@@ -52,7 +53,7 @@ def _map_sync(
52
53
  self, *input_iterators, kwargs={}, order_outputs: bool = True, return_exceptions: bool = False
53
54
  ) -> modal._utils.async_utils.AsyncOrSyncIterable: ...
54
55
  def _map_async(
55
- self,
56
+ self: modal.functions.Function,
56
57
  *input_iterators: typing.Union[typing.Iterable[typing.Any], typing.AsyncIterable[typing.Any]],
57
58
  kwargs={},
58
59
  order_outputs: bool = True,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: modal
3
- Version: 0.73.93
3
+ Version: 0.73.95
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License: Apache-2.0
@@ -22,10 +22,10 @@ modal/app.py,sha256=ojhuLZuNZAQ1OsbDH0k6G4pm1W7bOIvZfXbaKlvQ-Ao,45622
22
22
  modal/app.pyi,sha256=tZFbcsu20SuvfB2puxCyuXLFNJ9bQulzag55rVpgZmc,26827
23
23
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
24
24
  modal/client.py,sha256=j9D3hNis1lfhnz9lVFGgJgowbH3PaGUzNKgHPWYG778,15372
25
- modal/client.pyi,sha256=d_wytFrGfifUMThG59AvY7xiKoPwJtj3vO4JDSQBbWQ,7593
25
+ modal/client.pyi,sha256=8paHlkumGJ7FZQJbMFt1EX13BNXlJVnEUzaSRQxWm5I,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
- modal/cls.py,sha256=5DjpSBP1IyROKZm5ItDiEGdbRnfTT6K1Ul0jEvEKw_Q,31695
28
+ modal/cls.py,sha256=JhDbaZZHN52lqA_roY1BCbcN9BvbkUcdXiM2Kg9lIc0,31717
29
29
  modal/cls.pyi,sha256=ZJUwtRaQBGlM6tphvnv49FHBVDSgttMdD_LnYyRSKJM,10302
30
30
  modal/config.py,sha256=Boz1bPzaG-k5Grjq6y6fAELH1N_gTuYDnpB6FODzCPo,11710
31
31
  modal/container_process.py,sha256=WTqLn01dJPVkPpwR_0w_JH96ceN5mV4TGtiu1ZR2RRA,6108
@@ -41,9 +41,9 @@ 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=D-PDJfSbwqMDXdq7Bxu2ErZRENo-tRgu_zPoB-jl0OU,14377
44
+ modal/functions.pyi,sha256=ujc6eIYyNmMn__4dpxEy85-vZmAniZv56D2A4uBgs6U,14377
45
45
  modal/gpu.py,sha256=Kbhs_u49FaC2Zi0TjCdrpstpRtT5eZgecynmQi5IZVE,6752
46
- modal/image.py,sha256=O51ZH3p8hPUzOUBdcsQP_Bh0dUgqLiK_yzZInmdnwrs,90580
46
+ modal/image.py,sha256=Vv01Uq8Yt4afqiny1tLVAgpA8Yf0FCJniJuBCkamWY8,90601
47
47
  modal/image.pyi,sha256=L7aZUOElSGtNHmFHz1RgKP1cG5paiXt_EzylrwBwzVk,25004
48
48
  modal/io_streams.py,sha256=QkQiizKRzd5bnbKQsap31LJgBYlAnj4-XkV_50xPYX0,15079
49
49
  modal/io_streams.pyi,sha256=bJ7ZLmSmJ0nKoa6r4FJpbqvzdUVa0lEe0Fa-MMpMezU,5071
@@ -54,8 +54,8 @@ modal/network_file_system.pyi,sha256=4N3eqMbTSlqmS8VV_aJK-uvrgJC8xnf_YtW5FHfRfc8
54
54
  modal/object.py,sha256=bTeskuY8JFrESjU4_UL_nTwYlBQdOLmVaOX3X6EMxsg,164
55
55
  modal/object.pyi,sha256=kyJkRQcVv3ct7zSAxvvXcuhBVeH914v80uSlqeS7cA4,5632
56
56
  modal/output.py,sha256=q4T9uHduunj4NwY-YSwkHGgjZlCXMuJbfQ5UFaAGRAc,1968
57
- modal/parallel_map.py,sha256=POBTyiWabe2e4qBNlsjjksiu1AAPEsNqI-mM8cgNFco,16042
58
- modal/parallel_map.pyi,sha256=-YKY_bVuQv8B4gtFrHnXtuNV0_JpmU9vqMJzR7beeCU,2524
57
+ modal/parallel_map.py,sha256=OTfsaADqUhGN57gN4KQ9LQeFoEOG2V8xkpG5Ho5v0WE,16131
58
+ modal/parallel_map.pyi,sha256=CWLbHNo6bJMOHSGfbLLcIDh-3XT3jtUOG_jzuFYLqcw,2573
59
59
  modal/partial_function.py,sha256=uu8zvIV0Big0jiTlC4-VPL16dOScNB5jhfPeqxvvCrI,1117
60
60
  modal/partial_function.pyi,sha256=-MAK61qJRi6Wjym-Measz5_9moJurYrJfdi7uSQZa5M,4936
61
61
  modal/proxy.py,sha256=NrOevrWxG3G7-zlyRzG6BcIvop7AWLeyahZxitbBaOk,1418
@@ -93,7 +93,7 @@ modal/_runtime/telemetry.py,sha256=T1RoAGyjBDr1swiM6pPsGRSITm7LI5FDK18oNXxY08U,5
93
93
  modal/_runtime/user_code_imports.py,sha256=OTxf5BIwMOaHFplIxxyEAOsR-xM2f5kSiSOa9Ne2le0,14814
94
94
  modal/_utils/__init__.py,sha256=waLjl5c6IPDhSsdWAm9Bji4e2PVxamYABKAze6CHVXY,28
95
95
  modal/_utils/app_utils.py,sha256=88BT4TPLWfYAQwKTHcyzNQRHg8n9B-QE2UyJs96iV-0,108
96
- modal/_utils/async_utils.py,sha256=5PdDuI1aSwPOI4a3dIvW0DkPqGw6KZN6RtWE18Dzv1E,25079
96
+ modal/_utils/async_utils.py,sha256=aes4Me0GA3yurNjsb6f8qeLD5bQw8NOmzKQFUqLaqSk,25208
97
97
  modal/_utils/blob_utils.py,sha256=RB1G6T7eC1Poe-O45qYLaxwCr2jkM-Q6Nexk1J3wk_w,14505
98
98
  modal/_utils/bytes_io_segment_payload.py,sha256=uunxVJS4PE1LojF_UpURMzVK9GuvmYWRqQo_bxEj5TU,3385
99
99
  modal/_utils/deprecation.py,sha256=EXP1beU4pmEqEzWMLw6E3kUfNfpmNA_VOp6i0EHi93g,4856
@@ -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=WeY1f7JGXCrUgh6YSsVx99nLMK20EcHyoW0NHwX7Xm0,149
172
- modal-0.73.93.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
173
- modal-0.73.93.dist-info/METADATA,sha256=RZ68ss_wcL63OnAT-Vo7r_wrBA6w1epwXbDDbK2P3dM,2452
174
- modal-0.73.93.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
175
- modal-0.73.93.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
176
- modal-0.73.93.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
177
- modal-0.73.93.dist-info/RECORD,,
171
+ modal_version/_version_generated.py,sha256=O8Jjr9qC0fMcWO8OtKIo3KFt7liZ2ZVaLuUkTtnqHpA,149
172
+ modal-0.73.95.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
173
+ modal-0.73.95.dist-info/METADATA,sha256=PBPz4sQ_WP7VmzgqKSnJSjHfdjgfaauOdwdKcIBuxtI,2452
174
+ modal-0.73.95.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
175
+ modal-0.73.95.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
176
+ modal-0.73.95.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
177
+ modal-0.73.95.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  # Copyright Modal Labs 2025
2
2
 
3
3
  # Note: Reset this value to -1 whenever you make a minor `0.X` release of the client.
4
- build_number = 93 # git: 6b04a6d
4
+ build_number = 95 # git: 4e11a66