modal 1.1.5.dev62__py3-none-any.whl → 1.1.5.dev64__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.

Potentially problematic release.


This version of modal might be problematic. Click here for more details.

modal/cli/environment.py CHANGED
@@ -8,7 +8,7 @@ from rich.text import Text
8
8
 
9
9
  from modal import environments
10
10
  from modal._utils.name_utils import check_environment_name
11
- from modal.cli.utils import display_table
11
+ from modal.cli.utils import YES_OPTION, display_table
12
12
  from modal.config import config
13
13
  from modal.exception import InvalidError
14
14
 
@@ -80,9 +80,10 @@ Deletes all apps in the selected environment and deletes the environment irrevoc
80
80
  @environment_cli.command(name="delete", help=ENVIRONMENT_DELETE_HELP)
81
81
  def delete(
82
82
  name: str = typer.Argument(help="Name of the environment to be deleted. Case sensitive"),
83
- confirm: bool = typer.Option(default=False, help="Set this flag to delete without prompting for confirmation"),
83
+ *,
84
+ yes: bool = YES_OPTION,
84
85
  ):
85
- if not confirm:
86
+ if not yes:
86
87
  typer.confirm(
87
88
  (
88
89
  f"Are you sure you want to irrevocably delete the environment '{name}' and"
modal/cli/run.py CHANGED
@@ -22,7 +22,7 @@ from ..app import App, LocalEntrypoint
22
22
  from ..cls import _get_class_constructor_signature
23
23
  from ..config import config
24
24
  from ..environments import ensure_env
25
- from ..exception import ExecutionError, InvalidError, _CliUserExecutionError
25
+ from ..exception import ExecutionError, InvalidError, NotFoundError, _CliUserExecutionError
26
26
  from ..functions import Function
27
27
  from ..image import Image
28
28
  from ..output import enable_output
@@ -516,13 +516,12 @@ def serve(
516
516
 
517
517
 
518
518
  def shell(
519
- container_or_function: Optional[str] = typer.Argument(
519
+ ref: Optional[str] = typer.Argument(
520
520
  default=None,
521
521
  help=(
522
- "ID of running container, or path to a Python file containing a Modal App."
523
- " Can also include a function specifier, like `module.py::func`, if the file defines multiple functions."
522
+ "ID of running container or Sandbox, or path to a Python file containing an App."
523
+ " Can also include a Function specifier, like `module.py::func`, if the file defines multiple Functions."
524
524
  ),
525
- metavar="REF",
526
525
  ),
527
526
  cmd: str = typer.Option("/bin/bash", "-c", "--cmd", help="Command to run inside the Modal image."),
528
527
  env: str = ENV_OPTION,
@@ -602,6 +601,12 @@ def shell(
602
601
  ```
603
602
  modal shell hello_world.py -c 'uv pip list' > env.txt
604
603
  ```
604
+
605
+ Connect to a running Sandbox by ID:
606
+
607
+ ```
608
+ modal shell sb-abc123xyz
609
+ ```
605
610
  """
606
611
  env = ensure_env(env)
607
612
 
@@ -613,19 +618,28 @@ def shell(
613
618
 
614
619
  app = App("modal shell")
615
620
 
616
- if container_or_function is not None:
621
+ if ref is not None:
622
+ # `modal shell` with a sandbox ID gets the task_id, that's then handled by the `ta-*` flow below.
623
+ if ref.startswith("sb-") and len(ref[3:]) > 0 and ref[3:].isalnum():
624
+ from ..sandbox import Sandbox
625
+
626
+ try:
627
+ sandbox = Sandbox.from_id(ref)
628
+ task_id = sandbox._get_task_id()
629
+ ref = task_id
630
+ except NotFoundError as e:
631
+ raise ClickException(f"Sandbox '{ref}' not found")
632
+ except Exception as e:
633
+ raise ClickException(f"Error connecting to sandbox '{ref}': {str(e)}")
634
+
617
635
  # `modal shell` with a container ID is a special case, alias for `modal container exec`.
618
- if (
619
- container_or_function.startswith("ta-")
620
- and len(container_or_function[3:]) > 0
621
- and container_or_function[3:].isalnum()
622
- ):
636
+ if ref.startswith("ta-") and len(ref[3:]) > 0 and ref[3:].isalnum():
623
637
  from .container import exec
624
638
 
625
- exec(container_id=container_or_function, command=shlex.split(cmd), pty=pty)
639
+ exec(container_id=ref, command=shlex.split(cmd), pty=pty)
626
640
  return
627
641
 
628
- import_ref = parse_import_ref(container_or_function, use_module_mode=use_module_mode)
642
+ import_ref = parse_import_ref(ref, use_module_mode=use_module_mode)
629
643
  runnable, all_usable_commands = import_and_filter(
630
644
  import_ref, base_cmd="modal shell", accept_local_entrypoint=False, accept_webhook=True
631
645
  )
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.1.5.dev62",
36
+ version: str = "1.1.5.dev64",
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.1.5.dev62",
167
+ version: str = "1.1.5.dev64",
168
168
  ):
169
169
  """mdmd:hidden
170
170
  The Modal client object is not intended to be instantiated directly by users.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modal
3
- Version: 1.1.5.dev62
3
+ Version: 1.1.5.dev64
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=RRUz2NjAWIQLHtU2IEslOlnIOCxPiWts3IP3rTFArkY,49635
22
22
  modal/app.pyi,sha256=CDp_rlX3hBuFdv9VRsKvNKCgu_hS2IO2uNU5qhzmXps,44719
23
23
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
24
24
  modal/client.py,sha256=kyAIVB3Ay-XKJizQ_1ufUFB__EagV0MLmHJpyYyJ7J0,18636
25
- modal/client.pyi,sha256=juMCB8TtAdZISFetUsOb4-ihqu6U1HnlX8Pgw6YVG2Q,15831
25
+ modal/client.pyi,sha256=K3zDp-xW9_tbM6L_sv-zmzZ6CDsiIP-Tax5lMhURcHw,15831
26
26
  modal/cloud_bucket_mount.py,sha256=I2GRXYhOWLIz2kJZjXu75jAm9EJkBNcutGc6jR2ReUw,5928
27
27
  modal/cloud_bucket_mount.pyi,sha256=VuUOipMIHqFXMkD-3g2bsoqpSxV5qswlFHDOqPQzYAo,7405
28
28
  modal/cls.py,sha256=R1uLQbdqWRRjvxs0I57a4hZZELZkBVCxOKxvKryU5_s,41639
@@ -133,13 +133,13 @@ modal/cli/config.py,sha256=lhp2Pq4RbTDhaZJ-ZJvhrMqJj8c-WjuRX6gjE3TrvXc,1691
133
133
  modal/cli/container.py,sha256=9Ti-TIZ6vjDSmn9mk9h6SRwyhkQjtwirBN18LjpLyvE,3719
134
134
  modal/cli/dict.py,sha256=YAJtiv41YcCd5Fqam3hXCNTs4Y0yOgGR_i6RfQNSAFM,4572
135
135
  modal/cli/entry_point.py,sha256=F06p54rPOs1xAUeYW76RaimFOgLW_I17RCvNwfZRqPc,4747
136
- modal/cli/environment.py,sha256=QD1el4c1ALlTU5aN3e67SQt2E5sH7gPdXlBf9VHW2yI,4358
136
+ modal/cli/environment.py,sha256=LGBq8RVQjfBH3EWz8QgmYe19UO66JKSDNxOXMUjw7JM,4285
137
137
  modal/cli/import_refs.py,sha256=X59Z5JwgliRO6C-cIFto2Pr7o3SwlZMKQPKA0aI4ZK4,13927
138
138
  modal/cli/launch.py,sha256=VARim2SCzgtI1ZuxQ6JgTTtvFwGA5czCwQZQHWC8Zcc,6498
139
139
  modal/cli/network_file_system.py,sha256=I9IqTpVfk32uKYwGd8LTldkQx6UKYrQYNZ26q7Ab5Oo,8126
140
140
  modal/cli/profile.py,sha256=g8X6tFFK9ccKyu2he9Yu19WLSLNdztzECgmIV__XJFs,3257
141
141
  modal/cli/queues.py,sha256=5vKtKQ7YExdaxNPYZ0g5suU9sX0-F5h0zy0qBV-hN80,6140
142
- modal/cli/run.py,sha256=lVY0U9SsWmRnIdThLBDL3-ufnGun7GuG_wlR4S9WUUc,24929
142
+ modal/cli/run.py,sha256=PHqAt2H_NTAK5FjwNovNqfCaYmTYvxFDqty7Ar8EEA0,25438
143
143
  modal/cli/secret.py,sha256=-Nnk3fq1IEzMtC9VUn61AKmdvZzZ9XQyiKVgQYRpajo,8127
144
144
  modal/cli/token.py,sha256=NAmQzKBfEHkcldWKeFxAVIqQBoo1RTp7_A4yc7-8qM0,1911
145
145
  modal/cli/utils.py,sha256=aUXDU9_VgcJrGaGRy4bGf4dqwKYXHCpoO27x4m_bpuo,3293
@@ -153,7 +153,7 @@ modal/experimental/__init__.py,sha256=QkCGP1lZiOa8sY4ZNqMF8JsnuRaDI7PJpXkGtKMWgD
153
153
  modal/experimental/flash.py,sha256=C4sef08rARYFllsgtqukFmYL18SZW0_JpMS0BejDcUs,28552
154
154
  modal/experimental/flash.pyi,sha256=vV_OQhtdrPn8SW0XrBK-aLLHHIvxAzLzwFbWrke-m74,15463
155
155
  modal/experimental/ipython.py,sha256=TrCfmol9LGsRZMeDoeMPx3Hv3BFqQhYnmD_iH0pqdhk,2904
156
- modal-1.1.5.dev62.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
156
+ modal-1.1.5.dev64.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
157
157
  modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
158
158
  modal_docs/gen_cli_docs.py,sha256=c1yfBS_x--gL5bs0N4ihMwqwX8l3IBWSkBAKNNIi6bQ,3801
159
159
  modal_docs/gen_reference_docs.py,sha256=d_CQUGQ0rfw28u75I2mov9AlS773z9rG40-yq5o7g2U,6359
@@ -182,10 +182,10 @@ modal_proto/sandbox_router_pb2.py,sha256=INd9izYaIYqllESQt4MSv2Rj9Hf5bMjAvtCc9b4
182
182
  modal_proto/sandbox_router_pb2.pyi,sha256=YCK0WnCgRos3-p7t4USQQ7x6WAuM278yeQX2IeU5mLg,13295
183
183
  modal_proto/sandbox_router_pb2_grpc.py,sha256=zonC5flvCwxeZYJPENj1IJo2Mr0J58DpoC1_8IdPYik,8243
184
184
  modal_proto/sandbox_router_pb2_grpc.pyi,sha256=4QgCB9b7_ykvH8YD-hfnogVH9CLyHVDC5QNb03l4_X8,2735
185
- modal_version/__init__.py,sha256=o1AVmeCQl52XKh-GDSZAMx_ilLdtk-NpfYBg8-_kp_U,121
185
+ modal_version/__init__.py,sha256=DDTRVixYcN9T3gI6WWLxROw_FXMe2mRwqviSi8i2Mbc,121
186
186
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
187
- modal-1.1.5.dev62.dist-info/METADATA,sha256=QEO_Ba_TxBjVmedKJryqXG3Yy4DHbGeYPrEH60fjWjU,2481
188
- modal-1.1.5.dev62.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
189
- modal-1.1.5.dev62.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
190
- modal-1.1.5.dev62.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
191
- modal-1.1.5.dev62.dist-info/RECORD,,
187
+ modal-1.1.5.dev64.dist-info/METADATA,sha256=9GPwP4Sjq_fBSXMQ5aRfHEJL-7YaBxuqKbtedREOPX8,2481
188
+ modal-1.1.5.dev64.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
189
+ modal-1.1.5.dev64.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
190
+ modal-1.1.5.dev64.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
191
+ modal-1.1.5.dev64.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.1.5.dev62"
4
+ __version__ = "1.1.5.dev64"