modal 0.67.44__py3-none-any.whl → 0.67.46__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.py CHANGED
@@ -27,7 +27,7 @@ from ._utils import async_utils
27
27
  from ._utils.async_utils import TaskContext, synchronize_api
28
28
  from ._utils.grpc_utils import connect_channel, create_channel, retry_transient_errors
29
29
  from .config import _check_config, _is_remote, config, logger
30
- from .exception import AuthError, ClientClosed, ConnectionError, DeprecationError, VersionError
30
+ from .exception import AuthError, ClientClosed, ConnectionError, VersionError
31
31
 
32
32
  HEARTBEAT_INTERVAL: float = config.get("heartbeat_interval")
33
33
  HEARTBEAT_TIMEOUT: float = HEARTBEAT_INTERVAL + 0.1
@@ -139,15 +139,12 @@ class _Client:
139
139
  logger.debug(f"Client ({id(self)}): Starting")
140
140
  try:
141
141
  req = empty_pb2.Empty()
142
- resp = await retry_transient_errors(
142
+ await retry_transient_errors(
143
143
  self.stub.ClientHello,
144
144
  req,
145
145
  attempt_timeout=CLIENT_CREATE_ATTEMPT_TIMEOUT,
146
146
  total_timeout=CLIENT_CREATE_TOTAL_TIMEOUT,
147
147
  )
148
- if resp.warning:
149
- ALARM_EMOJI = chr(0x1F6A8)
150
- warnings.warn_explicit(f"{ALARM_EMOJI} {resp.warning} {ALARM_EMOJI}", DeprecationError, "<unknown>", 0)
151
148
  except GRPCError as exc:
152
149
  if exc.status == Status.FAILED_PRECONDITION:
153
150
  raise VersionError(
modal/client.pyi CHANGED
@@ -26,7 +26,7 @@ class _Client:
26
26
  _stub: typing.Optional[modal_proto.api_grpc.ModalClientStub]
27
27
 
28
28
  def __init__(
29
- self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.67.44"
29
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.67.46"
30
30
  ): ...
31
31
  def is_closed(self) -> bool: ...
32
32
  @property
@@ -81,7 +81,7 @@ class Client:
81
81
  _stub: typing.Optional[modal_proto.api_grpc.ModalClientStub]
82
82
 
83
83
  def __init__(
84
- self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.67.44"
84
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.67.46"
85
85
  ): ...
86
86
  def is_closed(self) -> bool: ...
87
87
  @property
modal/cls.py CHANGED
@@ -18,11 +18,8 @@ from ._utils.async_utils import synchronize_api, synchronizer
18
18
  from ._utils.grpc_utils import retry_transient_errors
19
19
  from ._utils.mount_utils import validate_volumes
20
20
  from .client import _Client
21
- from .exception import InvalidError, NotFoundError, VersionError
22
- from .functions import (
23
- _Function,
24
- _parse_retries,
25
- )
21
+ from .exception import InvalidError, NotFoundError, VersionError, print_server_warnings
22
+ from .functions import _Function, _parse_retries
26
23
  from .gpu import GPU_T
27
24
  from .object import _get_environment_name, _Object
28
25
  from .partial_function import (
@@ -486,6 +483,8 @@ class _Cls(_Object, type_prefix="cs"):
486
483
  else:
487
484
  raise
488
485
 
486
+ print_server_warnings(response.server_warnings)
487
+
489
488
  class_function_tag = f"{tag}.*" # special name of the base service function for the class
490
489
 
491
490
  class_service_function = _Function.from_name(
modal/exception.py CHANGED
@@ -4,6 +4,9 @@ import signal
4
4
  import sys
5
5
  import warnings
6
6
  from datetime import date
7
+ from typing import Iterable
8
+
9
+ from modal_proto import api_pb2
7
10
 
8
11
 
9
12
  class Error(Exception):
@@ -213,3 +216,12 @@ class ModuleNotMountable(Exception):
213
216
 
214
217
  class ClientClosed(Error):
215
218
  pass
219
+
220
+
221
+ def print_server_warnings(server_warnings: Iterable[api_pb2.Warning]):
222
+ # TODO(erikbern): move this to modal._utils.deprecation
223
+ for warning in server_warnings:
224
+ if warning.type == api_pb2.Warning.WARNING_TYPE_CLIENT_DEPRECATION:
225
+ warnings.warn_explicit(warning.message, DeprecationError, "<unknown>", 0)
226
+ else:
227
+ warnings.warn_explicit(warning.message, UserWarning, "<unknown>", 0)
modal/functions.py CHANGED
@@ -64,6 +64,7 @@ from .exception import (
64
64
  NotFoundError,
65
65
  OutputExpiredError,
66
66
  deprecation_warning,
67
+ print_server_warnings,
67
68
  )
68
69
  from .gpu import GPU_T, parse_gpu_config
69
70
  from .image import _Image
@@ -1061,6 +1062,8 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
1061
1062
  else:
1062
1063
  raise
1063
1064
 
1065
+ print_server_warnings(response.server_warnings)
1066
+
1064
1067
  self._hydrate(response.function_id, resolver.client, response.handle_metadata)
1065
1068
 
1066
1069
  rep = f"Ref({app_name})"
modal/functions.pyi CHANGED
@@ -455,11 +455,11 @@ class Function(typing.Generic[P, ReturnType, OriginalReturnType], modal.object.O
455
455
 
456
456
  _call_generator_nowait: ___call_generator_nowait_spec
457
457
 
458
- class __remote_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
458
+ class __remote_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
459
459
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
460
460
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
461
461
 
462
- remote: __remote_spec[P, ReturnType]
462
+ remote: __remote_spec[ReturnType, P]
463
463
 
464
464
  class __remote_gen_spec(typing_extensions.Protocol):
465
465
  def __call__(self, *args, **kwargs) -> typing.Generator[typing.Any, None, None]: ...
@@ -471,17 +471,17 @@ class Function(typing.Generic[P, ReturnType, OriginalReturnType], modal.object.O
471
471
  def _get_obj(self) -> typing.Optional[modal.cls.Obj]: ...
472
472
  def local(self, *args: P.args, **kwargs: P.kwargs) -> OriginalReturnType: ...
473
473
 
474
- class ___experimental_spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
474
+ class ___experimental_spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
475
475
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
476
476
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
477
477
 
478
- _experimental_spawn: ___experimental_spawn_spec[P, ReturnType]
478
+ _experimental_spawn: ___experimental_spawn_spec[ReturnType, P]
479
479
 
480
- class __spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
480
+ class __spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
481
481
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
482
482
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
483
483
 
484
- spawn: __spawn_spec[P, ReturnType]
484
+ spawn: __spawn_spec[ReturnType, P]
485
485
 
486
486
  def get_raw_f(self) -> typing.Callable[..., typing.Any]: ...
487
487
 
modal/runner.py CHANGED
@@ -176,7 +176,7 @@ async def _publish_app(
176
176
  indexed_objects: dict[str, _Object],
177
177
  name: str = "", # Only relevant for deployments
178
178
  tag: str = "", # Only relevant for deployments
179
- ) -> tuple[str, list[str]]:
179
+ ) -> tuple[str, list[api_pb2.Warning]]:
180
180
  """Wrapper for AppPublish RPC."""
181
181
 
182
182
  # Could simplify this function some changing the internal representation to use
@@ -206,7 +206,7 @@ async def _publish_app(
206
206
  raise InvalidError(exc.message)
207
207
  raise
208
208
 
209
- return response.url, response.warnings
209
+ return response.url, response.server_warnings
210
210
 
211
211
 
212
212
  async def _disconnect(
@@ -554,7 +554,7 @@ async def _deploy_app(
554
554
  app_id=running_app.app_id,
555
555
  app_page_url=running_app.app_page_url,
556
556
  app_logs_url=running_app.app_logs_url, # type: ignore
557
- warnings=warnings,
557
+ warnings=[warning.message for warning in warnings],
558
558
  )
559
559
 
560
560
 
modal/runner.pyi CHANGED
@@ -1,6 +1,7 @@
1
1
  import modal.client
2
2
  import modal.object
3
3
  import modal.running_app
4
+ import modal_proto.api_pb2
4
5
  import multiprocessing.synchronize
5
6
  import synchronicity.combined_types
6
7
  import typing
@@ -37,7 +38,7 @@ async def _publish_app(
37
38
  indexed_objects: dict[str, modal.object._Object],
38
39
  name: str = "",
39
40
  tag: str = "",
40
- ) -> tuple[str, list[str]]: ...
41
+ ) -> tuple[str, list[modal_proto.api_pb2.Warning]]: ...
41
42
  async def _disconnect(client: modal.client._Client, app_id: str, reason: int, exc_str: str = "") -> None: ...
42
43
  async def _status_based_disconnect(
43
44
  client: modal.client._Client, app_id: str, exc_info: typing.Optional[BaseException] = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: modal
3
- Version: 0.67.44
3
+ Version: 0.67.46
4
4
  Summary: Python client library for Modal
5
5
  Author: Modal Labs
6
6
  Author-email: support@modal.com
@@ -18,11 +18,11 @@ modal/_watcher.py,sha256=K6LYnlmSGQB4tWWI9JADv-tvSvQ1j522FwT71B51CX8,3584
18
18
  modal/app.py,sha256=EJ7FUN6rWnSwLJoYJh8nmKg_t-8hdN8_rt0OrkP7JvQ,46084
19
19
  modal/app.pyi,sha256=BE5SlR5tRECuc6-e2lUuOknDdov3zxgZ4N0AsLb5ZVQ,25270
20
20
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
21
- modal/client.py,sha256=cmylZhU35txmrx4nltNYuuqXRgeoMtm0ow1J9wJkEYQ,16400
22
- modal/client.pyi,sha256=TaiBPKqFJ0UHNiHC4LkhFAhk1OjtgvE3drbSEBGqwWQ,7354
21
+ modal/client.py,sha256=aLZvv10NPNQAzmF8o7gCT1CgTElZCFct4ANg05ohAzA,16183
22
+ modal/client.pyi,sha256=b3-MwPdUfIRHJTmkRwZBX3DYBjBa8W30HSJZpwTv0DM,7354
23
23
  modal/cloud_bucket_mount.py,sha256=G7T7jWLD0QkmrfKR75mSTwdUZ2xNfj7pkVqb4ipmxmI,5735
24
24
  modal/cloud_bucket_mount.pyi,sha256=CEi7vrH3kDUF4LAy4qP6tfImy2UJuFRcRbsgRNM1wo8,1403
25
- modal/cls.py,sha256=OJqzj_V-n1g48BY_4Jg_BOTQdftEEl4kTWN0X4FOOdg,27378
25
+ modal/cls.py,sha256=FirmKYI_9SjomwplqYzhpaBAeHjn7NcjokB8uwVmKls,27449
26
26
  modal/cls.pyi,sha256=47jaIT06fz8PSUrs-MaNn6r03PHsAyUGsKuK5e9RMhQ,8140
27
27
  modal/config.py,sha256=1KhNJkjYsJkX1V8RPPdRYPlM2HE-ZZs0JVSxbiXjmrw,11010
28
28
  modal/container_process.py,sha256=zDxCLk6KfJT1G9FfNtjom6gekBQ46op3TWepT7-Hkbg,6077
@@ -31,10 +31,10 @@ modal/dict.py,sha256=RmJlEwFJOdSfAYcVa50hbbFccV8e7BvC5tc5g1HXF-c,12622
31
31
  modal/dict.pyi,sha256=2cYgOqBxYZih4BYgMV0c3rNPuxYR6-cB1GBXzFkHA5c,7265
32
32
  modal/environments.py,sha256=5cgA-zbm6ngKLsRA19zSOgtgo9-BarJK3FJK0BiF2Lo,6505
33
33
  modal/environments.pyi,sha256=XalNpiPkAtHWAvOU2Cotq0ozmtl-Jv0FDsR8h9mr27Q,3521
34
- modal/exception.py,sha256=EBkdWVved2XEPsXaoPRu56xfxFFHL9iuqvUsdj42WDA,6392
34
+ modal/exception.py,sha256=hgAtpD4jvbjLc-gA1pet4hrj9MJMAcpzldaDRVX9zW8,6879
35
35
  modal/experimental.py,sha256=jFuNbwrNHos47viMB9q-cHJSvf2RDxDdoEcss9plaZE,2302
36
- modal/functions.py,sha256=3GjjFbf40XciWAa4rTmh0erkZjPzRjKHqWxUu91mHOU,66685
37
- modal/functions.pyi,sha256=IyuM9TV79JfrtfTaJ4yq3EcWp3yHuxLavpxTOwSWEDw,24988
36
+ modal/functions.py,sha256=vJK0AOZ11PhSb8dqp8UokIJofTyHl31IC6MguM6qC_g,66773
37
+ modal/functions.pyi,sha256=4k5CaJ9iTuEyHQ2rC5OysNHBLv1CZrD7zBMU1zXIU4w,24988
38
38
  modal/gpu.py,sha256=r4rL6uH3UJIQthzYvfWauXNyh01WqCPtKZCmmSX1fd4,6881
39
39
  modal/image.py,sha256=cQ6WP1xHXZT_nY8z3aEFiGwKzrTV0yxi3Ab8JzF91eo,79653
40
40
  modal/image.pyi,sha256=PIKH6JBA4L5TfdJrQu3pm2ykyIITmiP920TpP8cdyQA,24585
@@ -57,8 +57,8 @@ modal/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
57
57
  modal/queue.py,sha256=fJYFfpdrlVj_doc3QxgvJvv7c8BGHjjja5q_9HCtSqs,18658
58
58
  modal/queue.pyi,sha256=di3ownBw4jc6d4X7ygXtbpjlUMOK69qyaD3lVsJbpoM,9900
59
59
  modal/retries.py,sha256=HKR2Q9aNPWkMjQ5nwobqYTuZaSuw0a8lI2zrtY5IW98,5230
60
- modal/runner.py,sha256=AiBGoc_BZxQenjA0T9yQ7hf515Va6G05ULYRGnTT5Y0,24453
61
- modal/runner.pyi,sha256=Fa6HjaqH---CJhsefLm6Ce6DRLKZdz_Bng_gn9arJdw,5126
60
+ modal/runner.py,sha256=bGTOGmbAodyJvuoZo9XuK8mCU9vopDgjWXlZaN_DT6Y,24505
61
+ modal/runner.pyi,sha256=BvMS1ZVzWSn8B8q0KnIZOJKPkN5L-i5b-USbV6SWWHQ,5177
62
62
  modal/running_app.py,sha256=CshNvGDJtagOdKW54uYjY8HY73j2TpnsL9jkPFZAsfA,560
63
63
  modal/sandbox.py,sha256=Yd__KipEINH2euDPOcm5MPBnagRv19Sa5z5tJCvGOQs,26360
64
64
  modal/sandbox.pyi,sha256=fRl32Pt5F6TbK7aYewjlcL4WQxxmp7m6Ybktmkd2VOk,18108
@@ -142,10 +142,10 @@ modal_global_objects/mounts/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0
142
142
  modal_global_objects/mounts/modal_client_package.py,sha256=W0E_yShsRojPzWm6LtIQqNVolapdnrZkm2hVEQuZK_4,767
143
143
  modal_global_objects/mounts/python_standalone.py,sha256=SL_riIxpd8mP4i4CLDCWiFFNj0Ltknm9c_UIGfX5d60,1836
144
144
  modal_proto/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0VESpjWR0fc,28
145
- modal_proto/api.proto,sha256=zd8V-GFVMtUP8YwxnlVvaJIuocpWKchRCeUZSlMMk74,78818
145
+ modal_proto/api.proto,sha256=B0FedF8MXOVp1O9yPgjHU8QzFP0aeONN3WvhCaYaMO8,78738
146
146
  modal_proto/api_grpc.py,sha256=DveC4ejFYEhCLiWbQShnmY31_FWGYU675Bmr7nHhsgs,101342
147
- modal_proto/api_pb2.py,sha256=l88JT2IcEuSqCnk7WRTQrBoHtJyAQD4hHAoWmiCQr0A,287100
148
- modal_proto/api_pb2.pyi,sha256=a303c1L3sRnSk9wZXa7DuQWwBZm8u6EShoJImMYxt98,384236
147
+ modal_proto/api_pb2.py,sha256=YE26HpQSPu6x6hs5S58PeER2FEESNBMu2Ka6ieCjxpk,287062
148
+ modal_proto/api_pb2.pyi,sha256=wk_QhoXo1v3S1Tmukt1M8SiH9vfq8TBp9uqb7WUAm68,383922
149
149
  modal_proto/api_pb2_grpc.py,sha256=2PEP6JPOoTw2rDC5qYjLNuumP68ZwAouRhCoayisAhY,219162
150
150
  modal_proto/api_pb2_grpc.pyi,sha256=uWtCxVEd0cFpOZ1oOGfZNO7Dv45OP4kp09jMnNyx9D4,51098
151
151
  modal_proto/modal_api_grpc.py,sha256=-8mLby_om5MYo6yu1zA_hqhz0yLsQW7k2YWBVZW1iVs,13546
@@ -159,10 +159,10 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
159
159
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
160
160
  modal_version/__init__.py,sha256=3IY-AWLH55r35_mQXIaut0jrJvoPuf1NZJBQQfSbPuo,470
161
161
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
162
- modal_version/_version_generated.py,sha256=j9PfMkws1rfnUqEAN_lu0CiezuDi6eQfirAvf0CM_DM,149
163
- modal-0.67.44.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
164
- modal-0.67.44.dist-info/METADATA,sha256=miv8Op-4iBzWGjF7RXt7L2r4hCmKGi2FVESAn2OypNs,2329
165
- modal-0.67.44.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
166
- modal-0.67.44.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
167
- modal-0.67.44.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
168
- modal-0.67.44.dist-info/RECORD,,
162
+ modal_version/_version_generated.py,sha256=pjgSs4CUHp9hTXomUdMFNTRsfsGVvp6o72NElEE4tHQ,149
163
+ modal-0.67.46.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
164
+ modal-0.67.46.dist-info/METADATA,sha256=PHYR8Qz3pB0AUuCuTdgYLEQ3y5pbX-LvxM2naPhVuVk,2329
165
+ modal-0.67.46.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
166
+ modal-0.67.46.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
167
+ modal-0.67.46.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
168
+ modal-0.67.46.dist-info/RECORD,,
modal_proto/api.proto CHANGED
@@ -400,7 +400,6 @@ message AppPublishRequest {
400
400
 
401
401
  message AppPublishResponse {
402
402
  string url = 1;
403
- repeated string warnings = 2; // Deprecated soon in favor of server_warnings
404
403
  repeated Warning server_warnings = 3;
405
404
  }
406
405