modal 0.73.108__py3-none-any.whl → 0.73.110__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.
@@ -210,7 +210,9 @@ def _method(
210
210
  ```
211
211
  """
212
212
  if _warn_parentheses_missing is not None:
213
- raise InvalidError("Positional arguments are not allowed. Did you forget parentheses? Suggestion: `@method()`.")
213
+ raise InvalidError(
214
+ "Positional arguments are not allowed. Did you forget parentheses? Suggestion: `@modal.method()`."
215
+ )
214
216
 
215
217
  def wrapper(raw_f: Callable[..., Any]) -> _PartialFunction:
216
218
  nonlocal is_generator
@@ -250,28 +252,29 @@ def _fastapi_endpoint(
250
252
  docs: bool = False, # Whether to enable interactive documentation for this endpoint at /docs.
251
253
  requires_proxy_auth: bool = False, # Require Modal-Key and Modal-Secret HTTP Headers on requests.
252
254
  ) -> Callable[[Callable[P, ReturnType]], _PartialFunction[P, ReturnType, ReturnType]]:
253
- """Register a basic web endpoint with this application.
255
+ """Convert a function into a basic web endpoint by wrapping it with a FastAPI App.
254
256
 
255
- This is the simple way to create a web endpoint on Modal. The function
256
- behaves as a [FastAPI](https://fastapi.tiangolo.com/) handler and should
257
- return a response object to the caller.
257
+ Modal will internally use [FastAPI](https://fastapi.tiangolo.com/) to expose a
258
+ simple, single request handler. If you are defining your own `FastAPI` application
259
+ (e.g. if you want to define multiple routes), use `@modal.asgi_app` instead.
258
260
 
259
- Endpoints created with `@modal.fastapi_endpoint` are meant to be simple, single
260
- request handlers and automatically have
261
- [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) enabled.
262
- For more flexibility, use `@modal.asgi_app`.
261
+ The endpoint created with this decorator will automatically have
262
+ [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) enabled
263
+ and can leverage many of FastAPI's features.
263
264
 
264
- To learn how to use Modal with popular web frameworks, see the
265
+ For more information on using Modal with popular web frameworks, see our
265
266
  [guide on web endpoints](https://modal.com/docs/guide/webhooks).
266
267
 
267
268
  *Added in v0.73.82*: This function replaces the deprecated `@web_endpoint` decorator.
268
269
  """
269
270
  if isinstance(_warn_parentheses_missing, str):
270
271
  # Probably passing the method string as a positional argument.
271
- raise InvalidError('Positional arguments are not allowed. Suggestion: `@fastapi_endpoint(method="GET")`.')
272
+ raise InvalidError(
273
+ f'Positional arguments are not allowed. Suggestion: `@modal.fastapi_endpoint(method="{method}")`.'
274
+ )
272
275
  elif _warn_parentheses_missing is not None:
273
276
  raise InvalidError(
274
- "Positional arguments are not allowed. Did you forget parentheses? Suggestion: `@fastapi_endpoint()`."
277
+ "Positional arguments are not allowed. Did you forget parentheses? Suggestion: `@modal.fastapi_endpoint()`."
275
278
  )
276
279
 
277
280
  def wrapper(raw_f: Callable[..., Any]) -> _PartialFunction:
@@ -328,10 +331,10 @@ def _web_endpoint(
328
331
  """
329
332
  if isinstance(_warn_parentheses_missing, str):
330
333
  # Probably passing the method string as a positional argument.
331
- raise InvalidError('Positional arguments are not allowed. Suggestion: `@web_endpoint(method="GET")`.')
334
+ raise InvalidError('Positional arguments are not allowed. Suggestion: `@modal.web_endpoint(method="GET")`.')
332
335
  elif _warn_parentheses_missing is not None:
333
336
  raise InvalidError(
334
- "Positional arguments are not allowed. Did you forget parentheses? Suggestion: `@web_endpoint()`."
337
+ "Positional arguments are not allowed. Did you forget parentheses? Suggestion: `@modal.web_endpoint()`."
335
338
  )
336
339
 
337
340
  deprecation_warning(
@@ -392,10 +395,10 @@ def _asgi_app(
392
395
  [guide on web endpoints](https://modal.com/docs/guide/webhooks).
393
396
  """
394
397
  if isinstance(_warn_parentheses_missing, str):
395
- raise InvalidError('Positional arguments are not allowed. Suggestion: `@asgi_app(label="foo")`.')
398
+ raise InvalidError(f'Positional arguments are not allowed. Suggestion: `@modal.asgi_app(label="{label}")`.')
396
399
  elif _warn_parentheses_missing is not None:
397
400
  raise InvalidError(
398
- "Positional arguments are not allowed. Did you forget parentheses? Suggestion: `@asgi_app()`."
401
+ "Positional arguments are not allowed. Did you forget parentheses? Suggestion: `@modal.asgi_app()`."
399
402
  )
400
403
 
401
404
  def wrapper(raw_f: Callable[..., Any]) -> _PartialFunction:
@@ -460,10 +463,10 @@ def _wsgi_app(
460
463
  [guide on web endpoints](https://modal.com/docs/guide/webhooks).
461
464
  """
462
465
  if isinstance(_warn_parentheses_missing, str):
463
- raise InvalidError('Positional arguments are not allowed. Suggestion: `@wsgi_app(label="foo")`.')
466
+ raise InvalidError(f'Positional arguments are not allowed. Suggestion: `@modal.wsgi_app(label="{label}")`.')
464
467
  elif _warn_parentheses_missing is not None:
465
468
  raise InvalidError(
466
- "Positional arguments are not allowed. Did you forget parentheses? Suggestion: `@wsgi_app()`."
469
+ "Positional arguments are not allowed. Did you forget parentheses? Suggestion: `@modal.wsgi_app()`."
467
470
  )
468
471
 
469
472
  def wrapper(raw_f: Callable[..., Any]) -> _PartialFunction:
@@ -588,7 +591,9 @@ def _build(
588
591
  ```
589
592
  """
590
593
  if _warn_parentheses_missing is not None:
591
- raise InvalidError("Positional arguments are not allowed. Did you forget parentheses? Suggestion: `@build()`.")
594
+ raise InvalidError(
595
+ "Positional arguments are not allowed. Did you forget parentheses? Suggestion: `@modal.build()`."
596
+ )
592
597
 
593
598
  deprecation_warning(
594
599
  (2025, 1, 15),
@@ -620,7 +625,9 @@ def _enter(
620
625
 
621
626
  See the [lifeycle function guide](https://modal.com/docs/guide/lifecycle-functions#enter) for more information."""
622
627
  if _warn_parentheses_missing is not None:
623
- raise InvalidError("Positional arguments are not allowed. Did you forget parentheses? Suggestion: `@enter()`.")
628
+ raise InvalidError(
629
+ "Positional arguments are not allowed. Did you forget parentheses? Suggestion: `@modal.enter()`."
630
+ )
624
631
 
625
632
  if snap:
626
633
  flag = _PartialFunctionFlags.ENTER_PRE_SNAPSHOT
@@ -652,7 +659,9 @@ def _exit(_warn_parentheses_missing=None) -> Callable[[ExitHandlerType], _Partia
652
659
 
653
660
  See the [lifeycle function guide](https://modal.com/docs/guide/lifecycle-functions#exit) for more information."""
654
661
  if _warn_parentheses_missing is not None:
655
- raise InvalidError("Positional arguments are not allowed. Did you forget parentheses? Suggestion: `@exit()`.")
662
+ raise InvalidError(
663
+ "Positional arguments are not allowed. Did you forget parentheses? Suggestion: `@modal.exit()`."
664
+ )
656
665
 
657
666
  def wrapper(f: ExitHandlerType) -> _PartialFunction:
658
667
  if isinstance(f, _PartialFunction):
@@ -687,7 +696,7 @@ def _batched(
687
696
  """
688
697
  if _warn_parentheses_missing is not None:
689
698
  raise InvalidError(
690
- "Positional arguments are not allowed. Did you forget parentheses? Suggestion: `@batched()`."
699
+ "Positional arguments are not allowed. Did you forget parentheses? Suggestion: `@modal.batched()`."
691
700
  )
692
701
  if max_batch_size < 1:
693
702
  raise InvalidError("max_batch_size must be a positive integer.")
modal/client.pyi CHANGED
@@ -31,7 +31,7 @@ class _Client:
31
31
  server_url: str,
32
32
  client_type: int,
33
33
  credentials: typing.Optional[tuple[str, str]],
34
- version: str = "0.73.108",
34
+ version: str = "0.73.110",
35
35
  ): ...
36
36
  def is_closed(self) -> bool: ...
37
37
  @property
@@ -93,7 +93,7 @@ class Client:
93
93
  server_url: str,
94
94
  client_type: int,
95
95
  credentials: typing.Optional[tuple[str, str]],
96
- version: str = "0.73.108",
96
+ version: str = "0.73.110",
97
97
  ): ...
98
98
  def is_closed(self) -> bool: ...
99
99
  @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[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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: modal
3
- Version: 0.73.108
3
+ Version: 0.73.110
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=IbJYiWwYB8WsuRlaBrl-19mfx3ncVkRe8mVoL8MvMLM,30272
11
+ modal/_partial_function.py,sha256=ytUhfUEVPMccVD3wMekr2JRo5R0YylaE0LgPsSA05aQ,30508
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=j9D3hNis1lfhnz9lVFGgJgowbH3PaGUzNKgHPWYG778,15372
25
- modal/client.pyi,sha256=2lsU71NfmLEh5iP5JSJvcp8dwwj109jdMWio6PeMTpA,7661
25
+ modal/client.pyi,sha256=8wk2AtEE6BdVPKxcW3dmMqVFtGiVR3mkQfvFLUEvzD0,7661
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=JhDbaZZHN52lqA_roY1BCbcN9BvbkUcdXiM2Kg9lIc0,31717
@@ -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=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
46
  modal/image.py,sha256=Q-zNKdDmn7HHRv8YW7cIVYD1lbsOiiRuWfTZqLjGu2U,92189
47
47
  modal/image.pyi,sha256=DQ4DLOCPr6_yV7z4LS0bTY0rOyvQP9-dQOrzaW7pPG8,25260
@@ -170,10 +170,10 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
170
170
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
171
171
  modal_version/__init__.py,sha256=wiJQ53c-OMs0Xf1UeXOxQ7FwlV1VzIjnX6o-pRYZ_Pk,470
172
172
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
173
- modal_version/_version_generated.py,sha256=_MareI1KxTvIpRw3spc7HB9lnNuDCXaFRg4oNNHOsuU,150
174
- modal-0.73.108.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
175
- modal-0.73.108.dist-info/METADATA,sha256=08_YVMG45tQ90glBKuem2HYsCiWHX37cK8nViAOw6Fs,2453
176
- modal-0.73.108.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
177
- modal-0.73.108.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
178
- modal-0.73.108.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
179
- modal-0.73.108.dist-info/RECORD,,
173
+ modal_version/_version_generated.py,sha256=8xE1_e6j1-IF7iKtLxURLc2dU1gu-GpjgU8T0-_r80c,150
174
+ modal-0.73.110.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
175
+ modal-0.73.110.dist-info/METADATA,sha256=V5bZTe_T_u3Y4BiJMLgAYIxqiySKxF6DukCX14Mvagk,2453
176
+ modal-0.73.110.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
177
+ modal-0.73.110.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
178
+ modal-0.73.110.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
179
+ modal-0.73.110.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 = 108 # git: 06adea3
4
+ build_number = 110 # git: a024375