modal 1.0.3.dev17__py3-none-any.whl → 1.0.3.dev20__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/cli/run.py CHANGED
@@ -171,6 +171,14 @@ def _write_local_result(result_path: str, res: Any):
171
171
  fid.write(res)
172
172
 
173
173
 
174
+ def _validate_interactive_quiet_params(ctx):
175
+ interactive = ctx.obj["interactive"]
176
+ show_progress = ctx.obj["show_progress"]
177
+
178
+ if not show_progress and interactive:
179
+ raise InvalidError("To use interactive mode, remove the --quiet flag")
180
+
181
+
174
182
  def _make_click_function(app, signature: CliRunnableSignature, inner: Callable[[tuple[str, ...], dict[str, Any]], Any]):
175
183
  @click.pass_context
176
184
  def f(ctx, **kwargs):
@@ -180,6 +188,8 @@ def _make_click_function(app, signature: CliRunnableSignature, inner: Callable[[
180
188
  else:
181
189
  args = ()
182
190
 
191
+ _validate_interactive_quiet_params(ctx)
192
+
183
193
  show_progress: bool = ctx.obj["show_progress"]
184
194
  with enable_output(show_progress):
185
195
  with run_app(
@@ -291,6 +301,8 @@ def _get_click_command_for_local_entrypoint(app: App, entrypoint: LocalEntrypoin
291
301
  assert len(args) == 0 and len(kwargs) == 0
292
302
  args = ctx.args
293
303
 
304
+ _validate_interactive_quiet_params(ctx)
305
+
294
306
  show_progress: bool = ctx.obj["show_progress"]
295
307
  with enable_output(show_progress):
296
308
  with run_app(
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 = "1.0.3.dev17",
34
+ version: str = "1.0.3.dev20",
35
35
  ): ...
36
36
  def is_closed(self) -> bool: ...
37
37
  @property
@@ -94,7 +94,7 @@ class Client:
94
94
  server_url: str,
95
95
  client_type: int,
96
96
  credentials: typing.Optional[tuple[str, str]],
97
- version: str = "1.0.3.dev17",
97
+ version: str = "1.0.3.dev20",
98
98
  ): ...
99
99
  def is_closed(self) -> bool: ...
100
100
  @property
modal/mount.py CHANGED
@@ -21,7 +21,7 @@ from modal_version import __version__
21
21
 
22
22
  from ._object import _get_environment_name, _Object
23
23
  from ._resolver import Resolver
24
- from ._utils.async_utils import aclosing, async_map, synchronize_api
24
+ from ._utils.async_utils import TaskContext, aclosing, async_map, synchronize_api
25
25
  from ._utils.blob_utils import FileUploadSpec, blob_upload_file, get_file_upload_spec_from_path
26
26
  from ._utils.deprecation import deprecation_warning
27
27
  from ._utils.grpc_utils import retry_transient_errors
@@ -115,7 +115,8 @@ class _MountFile(_MountEntry):
115
115
  def get_files_to_upload(self):
116
116
  local_file = self.local_file.resolve()
117
117
  if not local_file.exists():
118
- raise FileNotFoundError(local_file)
118
+ msg = f"local file {local_file} does not exist"
119
+ raise FileNotFoundError(msg)
119
120
 
120
121
  rel_filename = self.remote_path
121
122
  yield local_file, rel_filename
@@ -144,10 +145,12 @@ class _MountDir(_MountEntry):
144
145
  local_dir = self.local_dir.expanduser().absolute()
145
146
 
146
147
  if not local_dir.exists():
147
- raise FileNotFoundError(local_dir)
148
+ msg = f"local dir {local_dir} does not exist"
149
+ raise FileNotFoundError(msg)
148
150
 
149
151
  if not local_dir.is_dir():
150
- raise NotADirectoryError(local_dir)
152
+ msg = f"local dir {local_dir} is not a directory"
153
+ raise NotADirectoryError(msg)
151
154
 
152
155
  if self.recursive:
153
156
  gen = (os.path.join(root, name) for root, dirs, files in os.walk(local_dir) for name in files)
@@ -811,6 +814,7 @@ def _is_modal_path(remote_path: PurePosixPath):
811
814
  return True
812
815
  return False
813
816
 
817
+
814
818
  REMOTE_PACKAGES_PATH = "/__modal/deps"
815
819
  REMOTE_SITECUSTOMIZE_PATH = "/pkg/sitecustomize.py"
816
820
 
@@ -821,6 +825,7 @@ SITECUSTOMIZE_CONTENT = f"""
821
825
  import sys; sys.path.append('{REMOTE_PACKAGES_PATH}')
822
826
  """.strip()
823
827
 
828
+
824
829
  async def _create_single_mount(
825
830
  client: _Client,
826
831
  builder_version: str,
@@ -896,23 +901,32 @@ async def _create_single_mount(
896
901
 
897
902
 
898
903
  async def _create_client_dependency_mounts(client=None, check_if_exists=True):
904
+ coros = []
899
905
  for python_version in PYTHON_STANDALONE_VERSIONS:
900
906
  # glibc >= 2.17
901
- await _create_single_mount(
902
- client,
903
- "PREVIEW",
904
- python_version,
905
- "manylinux_2_17",
906
- "x86_64",
907
- check_if_exists=check_if_exists,
907
+ coros.append(
908
+ _create_single_mount(
909
+ client,
910
+ "PREVIEW",
911
+ python_version,
912
+ "manylinux_2_17",
913
+ "x86_64",
914
+ check_if_exists=check_if_exists,
915
+ )
908
916
  )
909
917
  # musl >= 1.2
910
- await _create_single_mount(
911
- client,
912
- "PREVIEW",
913
- python_version,
914
- "musllinux_1_2",
915
- "x86_64",
916
- uv_python_platform="x86_64-unknown-linux-musl",
917
- check_if_exists=check_if_exists,
918
+ coros.append(
919
+ _create_single_mount(
920
+ client,
921
+ "PREVIEW",
922
+ python_version,
923
+ "musllinux_1_2",
924
+ "x86_64",
925
+ uv_python_platform="x86_64-unknown-linux-musl",
926
+ check_if_exists=check_if_exists,
927
+ )
918
928
  )
929
+ await TaskContext.gather(*coros)
930
+
931
+
932
+ create_client_dependency_mounts = synchronize_api(_create_client_dependency_mounts)
modal/mount.pyi CHANGED
@@ -319,6 +319,12 @@ async def _create_single_mount(
319
319
  ): ...
320
320
  async def _create_client_dependency_mounts(client=None, check_if_exists=True): ...
321
321
 
322
+ class __create_client_dependency_mounts_spec(typing_extensions.Protocol):
323
+ def __call__(self, /, client=None, check_if_exists=True): ...
324
+ async def aio(self, /, client=None, check_if_exists=True): ...
325
+
326
+ create_client_dependency_mounts: __create_client_dependency_mounts_spec
327
+
322
328
  ROOT_DIR: pathlib.PurePosixPath
323
329
 
324
330
  PYTHON_STANDALONE_VERSIONS: dict[str, tuple[str, str]]
modal/runner.py CHANGED
@@ -9,7 +9,6 @@ import dataclasses
9
9
  import os
10
10
  import time
11
11
  import typing
12
- import warnings
13
12
  from collections.abc import AsyncGenerator
14
13
  from multiprocessing.synchronize import Event
15
14
  from typing import TYPE_CHECKING, Any, Optional, TypeVar
@@ -296,12 +295,8 @@ async def _run_app(
296
295
 
297
296
  output_mgr = _get_output_manager()
298
297
  if interactive and output_mgr is None:
299
- warnings.warn(
300
- "Interactive mode is disabled because no output manager is active. "
301
- "Use 'with modal.enable_output():' to enable interactive mode and see logs.",
302
- stacklevel=2,
303
- )
304
- interactive = False
298
+ msg = "Interactive mode requires output to be enabled. (Use the the `modal.enable_output()` context manager.)"
299
+ raise InvalidError(msg)
305
300
 
306
301
  running_app: RunningApp = await _init_local_app_new(
307
302
  client,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modal
3
- Version: 1.0.3.dev17
3
+ Version: 1.0.3.dev20
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=NZ_rJ9TuMfiNiLg8-gOFgufD5flGtXWPHOZI0gdD3hE,46585
22
22
  modal/app.pyi,sha256=4-b_vbe3lNAqQPcMRpQCEDsE1zsVkQRJGUql9B7HvbM,22659
23
23
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
24
24
  modal/client.py,sha256=OwISJvkgMb-rHm9Gc4i-7YcDgGiZgwJ7F_PzwZH7a6Q,16847
25
- modal/client.pyi,sha256=NB4eHSUXATNCpXxNSbegpf1F1tdAZq80Q58_7DvHwYw,8459
25
+ modal/client.pyi,sha256=siMJzDUmt9CfXtMGwCg6HX-F1uUC7kp5NQ1VrN-s6KQ,8459
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=dBbeARwOWftlKd1cwtM0cHFtQWSWkwVXwVmOV4w0SyI,37907
@@ -45,8 +45,8 @@ modal/image.py,sha256=yrI9DCw7GAck3d788GCHJom-_yU55zNu7reNapBhlgE,93284
45
45
  modal/image.pyi,sha256=2xjB6XOZDtm_chDdd90UoIj8pnDt5hCg6bOmu5fNaA4,25625
46
46
  modal/io_streams.py,sha256=YDZVQSDv05DeXg5TwcucC9Rj5hQBx2GXdluan9rIUpw,15467
47
47
  modal/io_streams.pyi,sha256=1UK6kWLREASQfq-wL9wSp5iqjLU0egRZPDn4LXs1PZY,5136
48
- modal/mount.py,sha256=09D3DZZ_kcvUHGflYZLhEza-216esnY0J_je8dG9Z9U,34136
49
- modal/mount.pyi,sha256=WXWU-qhOvHzX2sfoToO0l0RR3k3PtfQkk5at8tBbg1g,12839
48
+ modal/mount.py,sha256=_1FS9dZ-9zp-mhv4gANGpvvRGu35ARWzgdDFBZ2BhoQ,34570
49
+ modal/mount.pyi,sha256=BfbfM10CCscF_bM_m-qHJPChNM3pgYehwljAfCWQ6t4,13120
50
50
  modal/network_file_system.py,sha256=lgtmHYjzA5gDMx0tysH0-WJB2Ao9JD2W15NyYK2A7_w,14612
51
51
  modal/network_file_system.pyi,sha256=58DiUqHGlARmI3cz-Yo7IFObKKFIiGh5UIU5JxGNFfc,8333
52
52
  modal/object.py,sha256=bTeskuY8JFrESjU4_UL_nTwYlBQdOLmVaOX3X6EMxsg,164
@@ -62,7 +62,7 @@ modal/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
62
  modal/queue.py,sha256=lu-QYW8GTqhZgX0TPTndmltT9uIWgLFV5mKZ_yTfmd4,18829
63
63
  modal/queue.pyi,sha256=O0f0S5kM1P0GVgzUzgsN0XsI46B9cJem4kkWluFndjM,10632
64
64
  modal/retries.py,sha256=IvNLDM0f_GLUDD5VgEDoN09C88yoxSrCquinAuxT1Sc,5205
65
- modal/runner.py,sha256=nvpnU7U2O5d2WqME1QUTTwu-NkSLLwblytlGk7HXPAw,24152
65
+ modal/runner.py,sha256=VV-PC03waAdSc_tAwpVN427TelOgs-cKeYS2GFeVRuA,24029
66
66
  modal/runner.pyi,sha256=1AnEu48SUPnLWp3raQ2zJCV5lc85EGLkX2nL0bHWaB0,5162
67
67
  modal/running_app.py,sha256=v61mapYNV1-O-Uaho5EfJlryMLvIT9We0amUOSvSGx8,1188
68
68
  modal/sandbox.py,sha256=6Ki2aBANqqN7THC1U7ymzJEUN7bPRqixAX9TBFh05Mc,36250
@@ -130,7 +130,7 @@ modal/cli/launch.py,sha256=0_sBu6bv2xJEPWi-rbGS6Ri9ggnkWQvrGlgpYSUBMyY,3097
130
130
  modal/cli/network_file_system.py,sha256=DoIdY8I42DjFdTtaYuRKNm7GC6vY0QtA4mk6694fbuU,7983
131
131
  modal/cli/profile.py,sha256=0TYhgRSGUvQZ5LH9nkl6iZllEvAjDniES264dE57wOM,3201
132
132
  modal/cli/queues.py,sha256=1OzC9HdCkbNz6twF3US4FZmIhuVRQ01GOfBY42ux61A,4533
133
- modal/cli/run.py,sha256=DPa-yQ9o7vjqwvs_TAOvVJxS51yVn__ZGCnbkORL37g,23972
133
+ modal/cli/run.py,sha256=vB4Qc0w9-8778Kme038DPxpFLLVAGo_KcJ7403ikMJY,24325
134
134
  modal/cli/secret.py,sha256=2bngl3Gb6THXkQ2eWZIN9pOHeOFJqiSNo_waUCVYgns,6611
135
135
  modal/cli/token.py,sha256=mxSgOWakXG6N71hQb1ko61XAR9ZGkTMZD-Txn7gmTac,1924
136
136
  modal/cli/utils.py,sha256=9Q7DIUX78-c19zBQNA7EtkgqIFatvHWUVGHwUIeBX_0,3366
@@ -147,7 +147,7 @@ modal/requirements/2024.10.txt,sha256=qD-5cVIVM9wXesJ6JC89Ew-3m2KjEElUz3jaw_MddR
147
147
  modal/requirements/PREVIEW.txt,sha256=qD-5cVIVM9wXesJ6JC89Ew-3m2KjEElUz3jaw_MddRo,296
148
148
  modal/requirements/README.md,sha256=9tK76KP0Uph7O0M5oUgsSwEZDj5y-dcUPsnpR0Sc-Ik,854
149
149
  modal/requirements/base-images.json,sha256=57vMSqzMbLBxw5tFWSaMiIkkVEps4JfX5PAtXGnkS4U,740
150
- modal-1.0.3.dev17.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
150
+ modal-1.0.3.dev20.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
151
151
  modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
152
152
  modal_docs/gen_cli_docs.py,sha256=c1yfBS_x--gL5bs0N4ihMwqwX8l3IBWSkBAKNNIi6bQ,3801
153
153
  modal_docs/gen_reference_docs.py,sha256=d_CQUGQ0rfw28u75I2mov9AlS773z9rG40-yq5o7g2U,6359
@@ -170,10 +170,10 @@ modal_proto/options_pb2.pyi,sha256=l7DBrbLO7q3Ir-XDkWsajm0d0TQqqrfuX54i4BMpdQg,1
170
170
  modal_proto/options_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
171
171
  modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0yJSI,247
172
172
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
173
- modal_version/__init__.py,sha256=uPcPQdUgF0iuDk60GQ3Ihk2SeEuLJyqu0INnJzaoN6k,121
173
+ modal_version/__init__.py,sha256=73y_4UF_pxZ_ZWHg5pl6bE47M0Kgv4KRVkIKeDn_8LQ,121
174
174
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
175
- modal-1.0.3.dev17.dist-info/METADATA,sha256=5hxxPNx4LxkOhRUL2pUREfldQuIvUZ_ZasE2GNPhHg4,2455
176
- modal-1.0.3.dev17.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
177
- modal-1.0.3.dev17.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
178
- modal-1.0.3.dev17.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
179
- modal-1.0.3.dev17.dist-info/RECORD,,
175
+ modal-1.0.3.dev20.dist-info/METADATA,sha256=XOKQxvbi5bEtrtcfg4ZLQNi38ZxjpE32-UMgvAmSaCc,2455
176
+ modal-1.0.3.dev20.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
177
+ modal-1.0.3.dev20.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
178
+ modal-1.0.3.dev20.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
179
+ modal-1.0.3.dev20.dist-info/RECORD,,
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.0.3.dev17"
4
+ __version__ = "1.0.3.dev20"