modal 0.73.87__py3-none-any.whl → 0.73.89__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.
@@ -312,6 +312,8 @@ def _web_endpoint(
312
312
  ) -> Callable[[Callable[P, ReturnType]], _PartialFunction[P, ReturnType, ReturnType]]:
313
313
  """Register a basic web endpoint with this application.
314
314
 
315
+ DEPRECATED: This decorator has been renamed to `@modal.fastapi_endpoint`.
316
+
315
317
  This is the simple way to create a web endpoint on Modal. The function
316
318
  behaves as a [FastAPI](https://fastapi.tiangolo.com/) handler and should
317
319
  return a response object to the caller.
@@ -332,6 +334,10 @@ def _web_endpoint(
332
334
  "Positional arguments are not allowed. Did you forget parentheses? Suggestion: `@web_endpoint()`."
333
335
  )
334
336
 
337
+ deprecation_warning(
338
+ (2025, 3, 5), "The `@modal.web_endpoint` decorator has been renamed to `@modal.fastapi_endpoint`."
339
+ )
340
+
335
341
  def wrapper(raw_f: Callable[..., Any]) -> _PartialFunction:
336
342
  if isinstance(raw_f, _Function):
337
343
  raw_f = raw_f.get_raw_f()
modal/_runtime/asgi.py CHANGED
@@ -236,14 +236,14 @@ def wsgi_app_wrapper(wsgi_app, container_io_manager):
236
236
  return asgi_app_wrapper(asgi_app, container_io_manager)
237
237
 
238
238
 
239
- def webhook_asgi_app(fn: Callable[..., Any], method: str, docs: bool):
239
+ def magic_fastapi_app(fn: Callable[..., Any], method: str, docs: bool):
240
240
  """Return a FastAPI app wrapping a function handler."""
241
241
  try:
242
242
  from fastapi import FastAPI
243
243
  from fastapi.middleware.cors import CORSMiddleware
244
244
  except ImportError as exc:
245
245
  message = (
246
- "Modal web_endpoint functions require FastAPI to be installed in the modal.Image."
246
+ "Modal functions decorated with `fastapi_endpoint` require FastAPI to be installed in the modal.Image."
247
247
  ' Please update your Image definition code, e.g. with `.pip_install("fastapi[standard]")`.'
248
248
  )
249
249
  raise InvalidError(message) from exc
@@ -69,7 +69,7 @@ def construct_webhook_callable(
69
69
  elif webhook_config.type == api_pb2.WEBHOOK_TYPE_FUNCTION:
70
70
  # Function is a webhook without an ASGI app. Create one for it.
71
71
  return asgi.asgi_app_wrapper(
72
- asgi.webhook_asgi_app(user_defined_callable, webhook_config.method, webhook_config.web_endpoint_docs),
72
+ asgi.magic_fastapi_app(user_defined_callable, webhook_config.method, webhook_config.web_endpoint_docs),
73
73
  container_io_manager,
74
74
  )
75
75
 
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.87"
30
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.73.89"
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.87"
88
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.73.89"
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[P_INNER, ReturnType_INNER, SUPERSELF]):
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.P, modal._functions.ReturnType, typing_extensions.Self]
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[P_INNER, ReturnType_INNER, SUPERSELF]):
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.P, modal._functions.ReturnType, typing_extensions.Self
225
+ modal._functions.ReturnType, modal._functions.P, typing_extensions.Self
226
226
  ]
227
227
 
228
- class __spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
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.P, modal._functions.ReturnType, typing_extensions.Self]
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
 
modal/sandbox.py CHANGED
@@ -187,6 +187,7 @@ class _Sandbox(_Object, type_prefix="sb"):
187
187
  ),
188
188
  cloud_provider_str=cloud if cloud else None, # Supersedes cloud_provider
189
189
  nfs_mounts=network_file_system_mount_protos(validated_network_file_systems, False),
190
+ runtime=config.get("function_runtime"),
190
191
  runtime_debug=config.get("function_runtime_debug"),
191
192
  cloud_bucket_mounts=cloud_bucket_mounts_to_proto(cloud_bucket_mounts),
192
193
  volume_mounts=volume_mounts,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: modal
3
- Version: 0.73.87
3
+ Version: 0.73.89
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License: Apache-2.0
@@ -8,7 +8,7 @@ modal/_ipython.py,sha256=TW1fkVOmZL3YYqdS2YlM1hqpf654Yf8ZyybHdBnlhSw,301
8
8
  modal/_location.py,sha256=joiX-0ZeutEUDTrrqLF1GHXCdVLF-rHzstocbMcd_-k,366
9
9
  modal/_object.py,sha256=JBIECWdfpRKCaCxVWZbC3Q1kF5Whk_EKvY9f4Y6AFyg,11446
10
10
  modal/_output.py,sha256=Z0nngPh2mKHMQc4MQ92YjVPc3ewOLa3I4dFBlL9nvQY,25656
11
- modal/_partial_function.py,sha256=Ll6Wkt8atWboyQQgACqNS1GUuyJ31x133Up_tZbpRbI,30054
11
+ modal/_partial_function.py,sha256=IbJYiWwYB8WsuRlaBrl-19mfx3ncVkRe8mVoL8MvMLM,30272
12
12
  modal/_proxy_tunnel.py,sha256=gnKyCfmVB7x2d1A6c-JDysNIP3kEFxmXzhcXhPrzPn0,1906
13
13
  modal/_pty.py,sha256=JZfPDDpzqICZqtyPI_oMJf_9w-p_lLNuzHhwhodUXio,1329
14
14
  modal/_resolver.py,sha256=RtoXoYzSllPlFu0D1vel_FWiEmDO7RyToiC2bxeN8ZY,6917
@@ -22,7 +22,7 @@ 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=8SQawr7P1PNUCq1UmJMUQXG2jIo4Nmdcs311XqrNLRE,15276
25
- modal/client.pyi,sha256=RthBnz-USniOAiz87eWrTmiPhtSbCSMeFQAHOVyGRIU,7593
25
+ modal/client.pyi,sha256=xVoVroImdvh3pohKOh0qBjFn2hu1f-gfjk9qF8xdMa8,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=5DjpSBP1IyROKZm5ItDiEGdbRnfTT6K1Ul0jEvEKw_Q,31695
@@ -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=ujc6eIYyNmMn__4dpxEy85-vZmAniZv56D2A4uBgs6U,14377
44
+ modal/functions.pyi,sha256=D-PDJfSbwqMDXdq7Bxu2ErZRENo-tRgu_zPoB-jl0OU,14377
45
45
  modal/gpu.py,sha256=Kbhs_u49FaC2Zi0TjCdrpstpRtT5eZgecynmQi5IZVE,6752
46
46
  modal/image.py,sha256=O51ZH3p8hPUzOUBdcsQP_Bh0dUgqLiK_yzZInmdnwrs,90580
47
47
  modal/image.pyi,sha256=L7aZUOElSGtNHmFHz1RgKP1cG5paiXt_EzylrwBwzVk,25004
@@ -67,7 +67,7 @@ modal/retries.py,sha256=HKR2Q9aNPWkMjQ5nwobqYTuZaSuw0a8lI2zrtY5IW98,5230
67
67
  modal/runner.py,sha256=fdUyDGN-bWu_aZBvxBO_MIgEuucsA0PgDKDHBn5k8J0,24451
68
68
  modal/runner.pyi,sha256=RYEYsnofrvVroYefWLhWAy8I_uwXV9fRNuJaVgcNzrg,5278
69
69
  modal/running_app.py,sha256=v61mapYNV1-O-Uaho5EfJlryMLvIT9We0amUOSvSGx8,1188
70
- modal/sandbox.py,sha256=Rfe4BW2hjjpWjsYSnHiM6KXPDrXCXpCv0bZrYaKzYxQ,32371
70
+ modal/sandbox.py,sha256=bE7nLMge7TEjNFWo_7W4dRft-jYW9AqWHzCjiSi-Afs,32427
71
71
  modal/sandbox.pyi,sha256=cLmSwI1ab-2DgEuXNf6S1PiK63wfUR9dHtxlZtSOuX8,22719
72
72
  modal/schedule.py,sha256=0ZFpKs1bOxeo5n3HZjoL7OE2ktsb-_oGtq-WJEPO4tY,2615
73
73
  modal/scheduler_placement.py,sha256=BAREdOY5HzHpzSBqt6jDVR6YC_jYfHMVqOzkyqQfngU,1235
@@ -83,14 +83,14 @@ modal/token_flow.pyi,sha256=0XV3d-9CGQL3qjPdw3RgwIFVqqxo8Z-u044_mkgAM3o,2064
83
83
  modal/volume.py,sha256=JAWeDvoAG95tMBv-fYIERyHsJPS_X_xGpxRRmYtb6j0,30096
84
84
  modal/volume.pyi,sha256=kTsXarphjZILXci84LQy7EyC84eXUs5-7D62IM5q3eE,12491
85
85
  modal/_runtime/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0VESpjWR0fc,28
86
- modal/_runtime/asgi.py,sha256=_B0151dcbSllR2zPh7IeDO-LDhntymMMJyyu7oTqS_g,22413
86
+ modal/_runtime/asgi.py,sha256=vmbrREjdCnxAeUyoUd1vtv7PfcR86IR0R2Jp1J6rEok,22435
87
87
  modal/_runtime/container_io_manager.py,sha256=3VPj0RWtSdvVZD96l5ZpO8MjhLRjAi_P_ZtpNK3nGn0,43593
88
88
  modal/_runtime/container_io_manager.pyi,sha256=sEGpOvlDOQCwUiJn4CAyE8TT2lCBKNBEqGWExfvVKsY,16661
89
89
  modal/_runtime/execution_context.py,sha256=E6ofm6j1POXGPxS841X3V7JU6NheVb8OkQc7JpLq4Kg,2712
90
90
  modal/_runtime/execution_context.pyi,sha256=wQZwMNADExkeNdB9yKX0PPojovxlFHbap3441wAsiMY,634
91
91
  modal/_runtime/gpu_memory_snapshot.py,sha256=tA3m1d1cwnmHpvpCeN_WijDd6n8byn7LWlpicbIxiOI,3144
92
92
  modal/_runtime/telemetry.py,sha256=T1RoAGyjBDr1swiM6pPsGRSITm7LI5FDK18oNXxY08U,5163
93
- modal/_runtime/user_code_imports.py,sha256=GplnUwItuZ3vAy1bhBSBjHdrhtVYOs-Q7gHYPBxJQGc,14813
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
96
  modal/_utils/async_utils.py,sha256=5PdDuI1aSwPOI4a3dIvW0DkPqGw6KZN6RtWE18Dzv1E,25079
@@ -151,10 +151,10 @@ modal_docs/mdmd/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,2
151
151
  modal_docs/mdmd/mdmd.py,sha256=Irx49MCCTlBOP4FBdLR--JrpA3-WhsVeriq0LGgsRic,6232
152
152
  modal_docs/mdmd/signatures.py,sha256=XJaZrK7Mdepk5fdX51A8uENiLFNil85Ud0d4MH8H5f0,3218
153
153
  modal_proto/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0VESpjWR0fc,28
154
- modal_proto/api.proto,sha256=KjRCRPhnk2013x2oU43dX5GMldHQWzdpuYTMtUiMTHo,86953
154
+ modal_proto/api.proto,sha256=Rcp8iOjtEFpoZunsyv-MZPDh3DJuUdsbYD8TN6eVNOY,87070
155
155
  modal_proto/api_grpc.py,sha256=FYGqDegM_w_qxdtlxum8k31mDibKoMvmNxv_p9cKdKs,109056
156
- modal_proto/api_pb2.py,sha256=CPJakEM1DEQAo4yTx7JPbyb1ePa_L4Ajl1UkCSdMItY,312526
157
- modal_proto/api_pb2.pyi,sha256=ETTlVP47b2G3FcRoyvBcNjY25cqJMsKuMWZhcPmyZ2M,421296
156
+ modal_proto/api_pb2.py,sha256=uo0J1zC9LnECZH4bYnAC87-JU8j7OcRdi3F7UVg9JX0,312597
157
+ modal_proto/api_pb2.pyi,sha256=9d3DU6qf8odrl0mgkoiCCQhnSuZjEFHe_QiDAyF9VL4,421753
158
158
  modal_proto/api_pb2_grpc.py,sha256=DNp0Et5i_Ey4dKx_1o1LRtYhyWYyT0NzTcAY4EcHn-c,235765
159
159
  modal_proto/api_pb2_grpc.pyi,sha256=RI6tWC3L8EIN4-izFSEGPPJl5Ta0lXPNuHUJaWAr35s,54892
160
160
  modal_proto/modal_api_grpc.py,sha256=UG8WJU81afrWPwItWB4Ag64E9EpyREMpBbAVGVEYJiM,14550
@@ -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=tnZ7OrSamKKaKMDtwznZNZN2T9WZzN1S6VulZZIX6m4,149
172
- modal-0.73.87.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
173
- modal-0.73.87.dist-info/METADATA,sha256=Mf3mBgIQlVi7sRwKC8_fB--Nal8fuOb4zTsvQrU7HJ8,2452
174
- modal-0.73.87.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
175
- modal-0.73.87.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
176
- modal-0.73.87.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
177
- modal-0.73.87.dist-info/RECORD,,
171
+ modal_version/_version_generated.py,sha256=2JXiJjSM7MVzAWZxaPmjBYqi4zhdY50wgeDyReGybkU,149
172
+ modal-0.73.89.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
173
+ modal-0.73.89.dist-info/METADATA,sha256=o5-DlAWrr4s1GtwRV86zKRtHHs9TtiNzYetSM8FIEQs,2452
174
+ modal-0.73.89.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
175
+ modal-0.73.89.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
176
+ modal-0.73.89.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
177
+ modal-0.73.89.dist-info/RECORD,,
modal_proto/api.proto CHANGED
@@ -2290,6 +2290,9 @@ message Sandbox {
2290
2290
  // Specifies container runtime behavior for sandboxes which are restored from a snapshot.
2291
2291
  // Set by the backend at snapshot creation time.
2292
2292
  optional string runsc_runtime_version = 27;
2293
+
2294
+ // If set, overrides the runtime used by the function, either "runc" or "gvisor".
2295
+ optional string runtime = 28;
2293
2296
  }
2294
2297
 
2295
2298
  message SandboxCreateRequest {