modAL 1.2.3.dev6__py3-none-any.whl → 1.2.3.dev8__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.
@@ -219,7 +219,7 @@ class _PartialFunction(typing.Generic[P, ReturnType, OriginalReturnType]):
219
219
  # of the type PartialFunction and this descriptor would be triggered when accessing it,
220
220
  #
221
221
  # However, modal classes are *actually* Cls instances (which isn't reflected in type checkers
222
- # due to Python's lack of type chekcing intersection types), so at runtime the Cls instance would
222
+ # due to Python's lack of type checking intersection types), so at runtime the Cls instance would
223
223
  # use its __getattr__ rather than this descriptor.
224
224
  assert self.raw_f is not None # Should only be relevant in a method context
225
225
  k = self.raw_f.__name__
modal/cli/run.py CHANGED
@@ -10,6 +10,7 @@ import time
10
10
  import typing
11
11
  from dataclasses import dataclass
12
12
  from functools import partial
13
+ from pathlib import Path, PurePosixPath
13
14
  from typing import Any, Callable, Optional
14
15
 
15
16
  import click
@@ -25,6 +26,7 @@ from ..environments import ensure_env
25
26
  from ..exception import ExecutionError, InvalidError, NotFoundError, _CliUserExecutionError
26
27
  from ..functions import Function
27
28
  from ..image import Image
29
+ from ..mount import _Mount
28
30
  from ..output import enable_output
29
31
  from ..runner import deploy_app, interactive_shell, run_app
30
32
  from ..secret import Secret
@@ -542,6 +544,13 @@ def shell(
542
544
  " Can be used multiple times."
543
545
  ),
544
546
  ),
547
+ add_local: Optional[list[str]] = typer.Option(
548
+ default=None,
549
+ help=(
550
+ "Local file or directory to mount inside the shell at `/mnt/{basename}` (if not using REF)."
551
+ " Can be used multiple times."
552
+ ),
553
+ ),
545
554
  secret: Optional[list[str]] = typer.Option(
546
555
  default=None,
547
556
  help=("Name of a `modal.Secret` to mount inside the shell (if not using REF). Can be used multiple times."),
@@ -692,9 +701,23 @@ def shell(
692
701
  modal_image = Image.from_registry(image, add_python=add_python) if image else None
693
702
  volumes = {} if volume is None else {f"/mnt/{vol}": Volume.from_name(vol) for vol in volume}
694
703
  secrets = [] if secret is None else [Secret.from_name(s) for s in secret]
704
+
705
+ mounts = []
706
+ if add_local:
707
+ for local_path_str in add_local:
708
+ local_path = Path(local_path_str).expanduser().resolve()
709
+ remote_path = PurePosixPath(f"/mnt/{local_path.name}")
710
+
711
+ if local_path.is_dir():
712
+ m = _Mount._from_local_dir(local_path, remote_path=remote_path)
713
+ else:
714
+ m = _Mount._from_local_file(local_path, remote_path=remote_path)
715
+ mounts.append(m)
716
+
695
717
  start_shell = partial(
696
718
  interactive_shell,
697
719
  image=modal_image,
720
+ mounts=mounts,
698
721
  cpu=cpu,
699
722
  memory=memory,
700
723
  gpu=gpu,
modal/client.pyi CHANGED
@@ -33,7 +33,7 @@ class _Client:
33
33
  server_url: str,
34
34
  client_type: int,
35
35
  credentials: typing.Optional[tuple[str, str]],
36
- version: str = "1.2.3.dev6",
36
+ version: str = "1.2.3.dev8",
37
37
  ):
38
38
  """mdmd:hidden
39
39
  The Modal client object is not intended to be instantiated directly by users.
@@ -164,7 +164,7 @@ class Client:
164
164
  server_url: str,
165
165
  client_type: int,
166
166
  credentials: typing.Optional[tuple[str, str]],
167
- version: str = "1.2.3.dev6",
167
+ version: str = "1.2.3.dev8",
168
168
  ):
169
169
  """mdmd:hidden
170
170
  The Modal client object is not intended to be instantiated directly by users.
modal/cls.py CHANGED
@@ -867,7 +867,7 @@ More information on class parameterization can be found here: https://modal.com/
867
867
 
868
868
  cls = _Cls._from_loader(
869
869
  _load_from_base,
870
- rep=f"{self._name}.with_concurrency(...)",
870
+ rep=f"{self._name}.with_batching(...)",
871
871
  is_another_app=True,
872
872
  deps=_deps,
873
873
  load_context_overrides=self._load_context_overrides,
modal/functions.pyi CHANGED
@@ -408,7 +408,7 @@ class Function(
408
408
 
409
409
  _call_generator: ___call_generator_spec[typing_extensions.Self]
410
410
 
411
- class __remote_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
411
+ class __remote_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
412
412
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER:
413
413
  """Calls the function remotely, executing it with the given arguments and returning the execution's result."""
414
414
  ...
@@ -417,7 +417,7 @@ class Function(
417
417
  """Calls the function remotely, executing it with the given arguments and returning the execution's result."""
418
418
  ...
419
419
 
420
- remote: __remote_spec[modal._functions.P, modal._functions.ReturnType, typing_extensions.Self]
420
+ remote: __remote_spec[modal._functions.ReturnType, modal._functions.P, typing_extensions.Self]
421
421
 
422
422
  class __remote_gen_spec(typing_extensions.Protocol[SUPERSELF]):
423
423
  def __call__(self, /, *args, **kwargs) -> typing.Generator[typing.Any, None, None]:
@@ -444,7 +444,7 @@ class Function(
444
444
  """
445
445
  ...
446
446
 
447
- class ___experimental_spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
447
+ class ___experimental_spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
448
448
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
449
449
  """[Experimental] Calls the function with the given arguments, without waiting for the results.
450
450
 
@@ -468,7 +468,7 @@ class Function(
468
468
  ...
469
469
 
470
470
  _experimental_spawn: ___experimental_spawn_spec[
471
- modal._functions.P, modal._functions.ReturnType, typing_extensions.Self
471
+ modal._functions.ReturnType, modal._functions.P, typing_extensions.Self
472
472
  ]
473
473
 
474
474
  class ___spawn_map_inner_spec(typing_extensions.Protocol[P_INNER, SUPERSELF]):
@@ -477,7 +477,7 @@ class Function(
477
477
 
478
478
  _spawn_map_inner: ___spawn_map_inner_spec[modal._functions.P, typing_extensions.Self]
479
479
 
480
- class __spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
480
+ class __spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
481
481
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
482
482
  """Calls the function with the given arguments, without waiting for the results.
483
483
 
@@ -498,7 +498,7 @@ class Function(
498
498
  """
499
499
  ...
500
500
 
501
- spawn: __spawn_spec[modal._functions.P, modal._functions.ReturnType, typing_extensions.Self]
501
+ spawn: __spawn_spec[modal._functions.ReturnType, modal._functions.P, typing_extensions.Self]
502
502
 
503
503
  def get_raw_f(self) -> collections.abc.Callable[..., typing.Any]:
504
504
  """Return the inner Python object wrapped by this Modal Function."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modal
3
- Version: 1.2.3.dev6
3
+ Version: 1.2.3.dev8
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License: Apache-2.0
@@ -11,7 +11,7 @@ modal/_load_context.py,sha256=YU5vhnnaLg_OexEp5W16a9pivwfmYw9I1ItPvYmLuoE,3706
11
11
  modal/_location.py,sha256=joiX-0ZeutEUDTrrqLF1GHXCdVLF-rHzstocbMcd_-k,366
12
12
  modal/_object.py,sha256=kuXkifDts65m1noObXNwKxDdxaurrtVs8DXj0iAZlXU,12833
13
13
  modal/_output.py,sha256=eikFqD82RA8uwF-LLVzO-A9EtmoVLnqg0X5nZE5hdLA,26852
14
- modal/_partial_function.py,sha256=t0yOVrYrDUdCJt7eVNyBS-atnUtjO56izKB3rDuN17Q,38573
14
+ modal/_partial_function.py,sha256=NCkeFLiYVEAM2ykTj6wXflTzIexgDhVgzxa42tmcBnc,38573
15
15
  modal/_pty.py,sha256=E58MQ8d5-wkbMatRKpQR-G9FdbCRcZGiZxOpGy__VuY,1481
16
16
  modal/_resolver.py,sha256=j_nhDXxT2gbmNEx5b0B8An4ZEt4EKdVLncIj8zF9-nU,7241
17
17
  modal/_resources.py,sha256=NMAp0GCLutiZI4GuKSIVnRHVlstoD3hNGUabjTUtzf4,1794
@@ -26,10 +26,10 @@ modal/app.pyi,sha256=5XnLb07hnNS5mI7MpLTHSFrDVJbh7lYqHOdU0jz7lnk,50683
26
26
  modal/billing.py,sha256=zmQ3bcCJlwa4KD1IA_QgdWpm1pn13c-7qfy79iEauYI,195
27
27
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
28
28
  modal/client.py,sha256=tPzihC7R9WtP56k6dyPKi5GLGdLEHdMA6YUj9Ry5G8o,14409
29
- modal/client.pyi,sha256=DlforCbg8wEcYOFdMxAvfMxDwzi9HH0-Q4mWqQkl7Jw,13092
29
+ modal/client.pyi,sha256=23Si0Z9cbO-xKEt2Ov4E7I77xHDqbnQo9PhUhAptVdA,13092
30
30
  modal/cloud_bucket_mount.py,sha256=cvVj5Rt4nDHoQbTneoJPTaAcnl_Ab_mrsjnnzd0v9OI,6013
31
31
  modal/cloud_bucket_mount.pyi,sha256=vXusGMOUk9HjCs4lhxteuCK4xLQclPfugGWKo7LECEA,7539
32
- modal/cls.py,sha256=TSkc7XOdfYcMkVfXBHZzhqgnQTUYA8RPdv-DySIT9L0,41883
32
+ modal/cls.py,sha256=Gu8SnRMVjuIYU6uiIlbdTOu9q_CUP_Ya4h0r7ynvybU,41880
33
33
  modal/cls.pyi,sha256=p8Unbfr0yUdAzYYnD7erSRO7dH-87HkAg4oAn6srBzA,27424
34
34
  modal/config.py,sha256=xUbw_ETdR7S3guj4dyzqdd9EYwRRht3aGYQRogZbi1o,13050
35
35
  modal/container_process.py,sha256=KG2ZkFOWe2KN1b8dFSBLBoW5pWoRxBzJ20MLhDTicJs,16749
@@ -43,7 +43,7 @@ modal/file_io.py,sha256=Whs3QSl3pQbSoLzSRIIWfK4XyP-kwgyZmWgx3bhJ9u0,20933
43
43
  modal/file_io.pyi,sha256=xtO6Glf_BFwDE7QiQQo24QqcMf_Vv-iz7WojcGVlLBU,15932
44
44
  modal/file_pattern_matcher.py,sha256=A_Kdkej6q7YQyhM_2-BvpFmPqJ0oHb54B6yf9VqvPVE,8116
45
45
  modal/functions.py,sha256=kcNHvqeGBxPI7Cgd57NIBBghkfbeFJzXO44WW0jSmao,325
46
- modal/functions.pyi,sha256=l0w4BTq6iYuTgxTKnYiNtuEMhs6pP3ffMxUIc2jPajA,38049
46
+ modal/functions.pyi,sha256=11hKG3vRpHzXUycfz6ozZzJ-EUHLzBUo6la_et3pEPY,38049
47
47
  modal/gpu.py,sha256=Fe5ORvVPDIstSq1xjmM6OoNgLYFWvogP9r5BgmD3hYg,6769
48
48
  modal/image.py,sha256=wdgZlQqewK8Tj95uGOq7s8YZ8wFxMhKZtzJFTN-RT0Y,108328
49
49
  modal/image.pyi,sha256=grkqK9BfyKDXmJYNme-lGa0O3u7pOU5GifyLOAhG3sc,78202
@@ -144,7 +144,7 @@ modal/cli/launch.py,sha256=oJKGWjTJiXQTdw-SUiCmCQ76bY_8nlzJMUMu0zew0zs,6435
144
144
  modal/cli/network_file_system.py,sha256=MO4YHBdwokXaVv95W4ucmxvi-Q2IpiMrxWLOBhEED5c,8029
145
145
  modal/cli/profile.py,sha256=g8X6tFFK9ccKyu2he9Yu19WLSLNdztzECgmIV__XJFs,3257
146
146
  modal/cli/queues.py,sha256=S5dqk6lEd_2fJolHqoN9iRs6EkeTa0k7KqJWBBGS23k,6170
147
- modal/cli/run.py,sha256=3_UF2Vdye_KEgY8JzBBomt0i944cCJx96RfNbeAEPDo,25783
147
+ modal/cli/run.py,sha256=sagcnvlLzmp9bf9PkJnItHelD2021m0hBTBePVwXGEY,26629
148
148
  modal/cli/secret.py,sha256=zkCztov8c4x8CI8G0EoyieUfv9XLQQtVXV8xeMLK-Os,8044
149
149
  modal/cli/token.py,sha256=NAmQzKBfEHkcldWKeFxAVIqQBoo1RTp7_A4yc7-8qM0,1911
150
150
  modal/cli/utils.py,sha256=aUXDU9_VgcJrGaGRy4bGf4dqwKYXHCpoO27x4m_bpuo,3293
@@ -158,7 +158,7 @@ modal/experimental/__init__.py,sha256=sCwNbBLcR2t-jhrpwtMAPGKt2WNqXBg0xkNZdyB-6C
158
158
  modal/experimental/flash.py,sha256=RKS3X3h4tY_mOLcMzbRs5tNCLPFL01dBAhCZSqCeBgA,26675
159
159
  modal/experimental/flash.pyi,sha256=uwinKAYxpunNNfBj58FP88DXb535Qik4F6tnJKPAIwQ,14696
160
160
  modal/experimental/ipython.py,sha256=TrCfmol9LGsRZMeDoeMPx3Hv3BFqQhYnmD_iH0pqdhk,2904
161
- modal-1.2.3.dev6.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
161
+ modal-1.2.3.dev8.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
162
162
  modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
163
163
  modal_docs/gen_cli_docs.py,sha256=c1yfBS_x--gL5bs0N4ihMwqwX8l3IBWSkBAKNNIi6bQ,3801
164
164
  modal_docs/gen_reference_docs.py,sha256=d_CQUGQ0rfw28u75I2mov9AlS773z9rG40-yq5o7g2U,6359
@@ -186,10 +186,10 @@ modal_proto/task_command_router_pb2.py,sha256=_pD2ZpU0bNzhwBdzmLoLyLtAtftI_Agxwn
186
186
  modal_proto/task_command_router_pb2.pyi,sha256=EyDgXPLr7alqjXYERV8w_MPuO404x0uCppmSkrfE9IE,14589
187
187
  modal_proto/task_command_router_pb2_grpc.py,sha256=uEQ0HdrCp8v-9bB5yIic9muA8spCShLHY6Bz9cCgOUE,10114
188
188
  modal_proto/task_command_router_pb2_grpc.pyi,sha256=s3Yxsrawdj4nr8vqQqsAxyX6ilWaGbdECy425KKbLIA,3301
189
- modal_version/__init__.py,sha256=ykL1YDnG84Kbye1SdzYmB6p-uaExQbAqflEytOVoVBI,120
189
+ modal_version/__init__.py,sha256=xX1t1CY6ZKi0O56-EokKMUUYraIoYqy3Oa37-om8s6I,120
190
190
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
191
- modal-1.2.3.dev6.dist-info/METADATA,sha256=520rY66GN3k7rL_GD8qRQIXLFHJ6zH21fprULuM-f6w,2489
192
- modal-1.2.3.dev6.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
193
- modal-1.2.3.dev6.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
194
- modal-1.2.3.dev6.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
195
- modal-1.2.3.dev6.dist-info/RECORD,,
191
+ modal-1.2.3.dev8.dist-info/METADATA,sha256=MDuEh08b9UwUjUPF8iybg5iB-7ZFjNUR6-U9pkucmGk,2489
192
+ modal-1.2.3.dev8.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
193
+ modal-1.2.3.dev8.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
194
+ modal-1.2.3.dev8.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
195
+ modal-1.2.3.dev8.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.2.3.dev6"
4
+ __version__ = "1.2.3.dev8"