modal 0.73.166__py3-none-any.whl → 0.73.168__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.
@@ -33,7 +33,6 @@ from modal._partial_function import (
33
33
  _find_callables_for_obj,
34
34
  _PartialFunctionFlags,
35
35
  )
36
- from modal._proxy_tunnel import proxy_tunnel
37
36
  from modal._serialization import deserialize_params
38
37
  from modal._utils.async_utils import TaskContext, synchronizer
39
38
  from modal._utils.function_utils import (
@@ -586,11 +585,9 @@ if __name__ == "__main__":
586
585
  client = Client.from_env()
587
586
 
588
587
  try:
589
- with proxy_tunnel(container_args.proxy_info):
590
- try:
591
- main(container_args, client)
592
- except UserException:
593
- logger.info("User exception caught, exiting")
588
+ main(container_args, client)
589
+ except UserException:
590
+ logger.info("User exception caught, exiting")
594
591
  except KeyboardInterrupt:
595
592
  logger.debug("Container: interrupted")
596
593
 
modal/_functions.py CHANGED
@@ -530,12 +530,6 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
530
530
  if is_generator:
531
531
  raise InvalidError("Generator functions do not support retries.")
532
532
 
533
- if proxy:
534
- # HACK: remove this once we stop using ssh tunnels for this.
535
- if image:
536
- # TODO(elias): this will cause an error if users use prior `.add_local_*` commands without copy=True
537
- image = image.apt_install("autossh")
538
-
539
533
  function_spec = _FunctionSpec(
540
534
  mounts=all_mounts,
541
535
  secrets=secrets,
modal/cli/import_refs.py CHANGED
@@ -69,7 +69,6 @@ def import_file_or_module(import_ref: ImportRef, base_cmd: str = ""):
69
69
  (2025, 2, 6),
70
70
  f"Using Python module paths will require using the -m flag in a future version of Modal.\n"
71
71
  f"Use `{base_cmd} -m {import_ref.file_or_module}` instead.",
72
- pending=True,
73
72
  show_source=False,
74
73
  )
75
74
  try:
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.166",
34
+ version: str = "0.73.168",
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.166",
96
+ version: str = "0.73.168",
97
97
  ): ...
98
98
  def is_closed(self) -> bool: ...
99
99
  @property
modal/cls.py CHANGED
@@ -706,10 +706,9 @@ class _Cls(_Object, type_prefix="cs"):
706
706
  # if not local (== k *could* be a method) or it is local and we know k is a method
707
707
  deprecation_warning(
708
708
  (2025, 1, 13),
709
- "Usage of methods directly on the class will soon be deprecated, "
710
- "instantiate classes before using methods, e.g.:\n"
709
+ "Calling a method on an uninstantiated class will soon be deprecated; "
710
+ "update your code to instantiate the class first, i.e.:\n"
711
711
  f"{self._name}().{k} instead of {self._name}.{k}",
712
- pending=True,
713
712
  )
714
713
  return getattr(self(), k)
715
714
  # non-method attribute access on local class - arguably shouldn't be used either:
modal/image.py CHANGED
@@ -820,7 +820,8 @@ class _Image(_Object, type_prefix="im"):
820
820
  works in a `Dockerfile`.
821
821
  """
822
822
  deprecation_warning(
823
- (2025, 1, 13), COPY_DEPRECATION_MESSAGE_PATTERN.format(replacement="image.add_local_file"), pending=True
823
+ (2025, 1, 13),
824
+ COPY_DEPRECATION_MESSAGE_PATTERN.format(replacement="image.add_local_file"),
824
825
  )
825
826
  basename = str(Path(local_path).name)
826
827
 
@@ -934,7 +935,8 @@ class _Image(_Object, type_prefix="im"):
934
935
  ```
935
936
  """
936
937
  deprecation_warning(
937
- (2025, 1, 13), COPY_DEPRECATION_MESSAGE_PATTERN.format(replacement="image.add_local_dir"), pending=True
938
+ (2025, 1, 13),
939
+ COPY_DEPRECATION_MESSAGE_PATTERN.format(replacement="image.add_local_dir"),
938
940
  )
939
941
 
940
942
  def build_dockerfile(version: ImageBuilderVersion) -> DockerfileSpec:
@@ -1367,9 +1369,8 @@ class _Image(_Object, type_prefix="im"):
1367
1369
  if context_mount is not None:
1368
1370
  deprecation_warning(
1369
1371
  (2025, 1, 13),
1370
- "`context_mount` is deprecated."
1371
- + " Files are now automatically added to the build context based on the commands.",
1372
- pending=True,
1372
+ "The `context_mount` parameter of `Image.dockerfile_commands` is deprecated."
1373
+ " Files are now automatically added to the build context based on the commands.",
1373
1374
  )
1374
1375
  cmds = _flatten_str_args("dockerfile_commands", "dockerfile_commands", dockerfile_commands)
1375
1376
  if not cmds:
@@ -1777,9 +1778,8 @@ class _Image(_Object, type_prefix="im"):
1777
1778
  if context_mount is not None:
1778
1779
  deprecation_warning(
1779
1780
  (2025, 1, 13),
1780
- "`context_mount` is deprecated."
1781
- + " Files are now automatically added to the build context based on the commands in the Dockerfile.",
1782
- pending=True,
1781
+ "The `context_mount` parameter of `Image.from_dockerfile` is deprecated."
1782
+ " Files are now automatically added to the build context based on the commands in the Dockerfile.",
1783
1783
  )
1784
1784
 
1785
1785
  # --- Build the base dockerfile
modal/mount.py CHANGED
@@ -410,7 +410,8 @@ class _Mount(_Object, type_prefix="mo"):
410
410
  ```
411
411
  """
412
412
  deprecation_warning(
413
- (2025, 1, 8), MOUNT_DEPRECATION_MESSAGE_PATTERN.format(replacement="image.add_local_dir"), pending=True
413
+ (2025, 1, 8),
414
+ MOUNT_DEPRECATION_MESSAGE_PATTERN.format(replacement="image.add_local_dir"),
414
415
  )
415
416
  return _Mount._from_local_dir(local_path, remote_path=remote_path, condition=condition, recursive=recursive)
416
417
 
@@ -467,7 +468,8 @@ class _Mount(_Object, type_prefix="mo"):
467
468
  ```
468
469
  """
469
470
  deprecation_warning(
470
- (2025, 1, 8), MOUNT_DEPRECATION_MESSAGE_PATTERN.format(replacement="image.add_local_file"), pending=True
471
+ (2025, 1, 8),
472
+ MOUNT_DEPRECATION_MESSAGE_PATTERN.format(replacement="image.add_local_file"),
471
473
  )
472
474
  return _Mount._from_local_file(local_path, remote_path)
473
475
 
@@ -640,7 +642,6 @@ class _Mount(_Object, type_prefix="mo"):
640
642
  deprecation_warning(
641
643
  (2025, 1, 8),
642
644
  MOUNT_DEPRECATION_MESSAGE_PATTERN.format(replacement="image.add_local_python_source"),
643
- pending=True,
644
645
  )
645
646
  return _Mount._from_local_python_packages(
646
647
  *module_names, remote_dir=remote_dir, condition=condition, ignore=ignore
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modal
3
- Version: 0.73.166
3
+ Version: 0.73.168
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License: Apache-2.0
@@ -2,14 +2,13 @@ modal/__init__.py,sha256=7wz1AT_bpWJJEzXsAo3QMb7i87y7UGXwfneb0bGDhRg,2502
2
2
  modal/__main__.py,sha256=CgIjP8m1xJjjd4AXc-delmR6LdBCZclw2A_V38CFIio,2870
3
3
  modal/_clustered_functions.py,sha256=kTf-9YBXY88NutC1akI-gCbvf01RhMPCw-zoOI_YIUE,2700
4
4
  modal/_clustered_functions.pyi,sha256=vllkegc99A0jrUOWa8mdlSbdp6uz36TsHhGxysAOpaQ,771
5
- modal/_container_entrypoint.py,sha256=85KptUAmlftjHR-mpl32H5deATqqDrRWp0Z1XrKmWyk,29166
6
- modal/_functions.py,sha256=M94gzMA9xfW9086djoG2yYFVihcslKnsleacmNbVrG0,74996
5
+ modal/_container_entrypoint.py,sha256=PVs5WDgm0_vZlECf_Ga58L49zceTMKPlUA10YRpPmy8,29026
6
+ modal/_functions.py,sha256=EoJ2IbApVoJYELjB0KvXwRV2J6jElhwGHzTbXbXef6A,74712
7
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
11
  modal/_partial_function.py,sha256=8mmd5lvjZaC7qi0KAnLR1H590MlxNslAE2_Kr9biJUA,39704
12
- modal/_proxy_tunnel.py,sha256=gnKyCfmVB7x2d1A6c-JDysNIP3kEFxmXzhcXhPrzPn0,1906
13
12
  modal/_pty.py,sha256=JZfPDDpzqICZqtyPI_oMJf_9w-p_lLNuzHhwhodUXio,1329
14
13
  modal/_resolver.py,sha256=RtoXoYzSllPlFu0D1vel_FWiEmDO7RyToiC2bxeN8ZY,6917
15
14
  modal/_resources.py,sha256=5qmcirXUI8dSH926nwkUaeX9H25mqYu9mXD_KuT79-o,1733
@@ -23,10 +22,10 @@ modal/app.py,sha256=bJp7W3liuVG2VwWkG31tMFogDh84EKppzP8YJFWl3eQ,48140
23
22
  modal/app.pyi,sha256=SkqXNrdnGIZ4MmNNvpGtzNLoUdyuvi9IjQQR_DRiRHk,26968
24
23
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
25
24
  modal/client.py,sha256=U-YKSw0n7J1ZLREt9cbEJCtmHe5YoPKFxl0xlkan2yc,15565
26
- modal/client.pyi,sha256=iDprzZTVWygReQ1tdzssE36Uvq1_RfNgdO5GC_dMhSc,7661
25
+ modal/client.pyi,sha256=EVuMDnBwDN6KjVggka2jbjfk49kNwIqk-ymDq07yF4Y,7661
27
26
  modal/cloud_bucket_mount.py,sha256=YOe9nnvSr4ZbeCn587d7_VhE9IioZYRvF9VYQTQux08,5914
28
27
  modal/cloud_bucket_mount.pyi,sha256=30T3K1a89l6wzmEJ_J9iWv9SknoGqaZDx59Xs-ZQcmk,1607
29
- modal/cls.py,sha256=8tvSw7QFTS1FnX2MXaxagu3KwuR6y_DMwhqHv3MZ0Nk,32963
28
+ modal/cls.py,sha256=x3CUDPC-QK7pa9E2eiFsiCS2ULvVi8UzNZQw1i9drsU,32945
30
29
  modal/cls.pyi,sha256=pTYO9JsRENmsa5pDgzfoRJGm_NpCvEjEx--vs-jJkj8,10902
31
30
  modal/config.py,sha256=FlqVyh6LVukMahhmEGQVTwWtwtfoPfHqEo3GDn13EOA,11687
32
31
  modal/container_process.py,sha256=vvyK3DVPUMsuqvkKdUiQ49cDLF9JawGrxpglLk5vfgI,6208
@@ -42,11 +41,11 @@ modal/file_pattern_matcher.py,sha256=trosX-Bp7dOubudN1bLLhRAoidWy1TcoaR4Pv8CedWw
42
41
  modal/functions.py,sha256=kcNHvqeGBxPI7Cgd57NIBBghkfbeFJzXO44WW0jSmao,325
43
42
  modal/functions.pyi,sha256=Bg_zlYSHMYuEXQYLcFU-j1Kwq5zHQ9jggMA_5ZO_du8,14785
44
43
  modal/gpu.py,sha256=Kbhs_u49FaC2Zi0TjCdrpstpRtT5eZgecynmQi5IZVE,6752
45
- modal/image.py,sha256=qagLzHPbeEoM7TqvIuFJ8JV_IEJtRqiR0lik4O_K4Gw,92857
44
+ modal/image.py,sha256=I-9_YZL0SSfnuGPywa3-4PlxDmJ-53p7ce3gP74SrOA,92877
46
45
  modal/image.pyi,sha256=89zv12C1sFrJs7Es9SnX23_m208ASAdeNGCVTrhjzHI,25632
47
46
  modal/io_streams.py,sha256=h5O2LmbRoT9l777z3TQhCAm-JF1r7avZ2ykXlejztDs,15163
48
47
  modal/io_streams.pyi,sha256=bJ7ZLmSmJ0nKoa6r4FJpbqvzdUVa0lEe0Fa-MMpMezU,5071
49
- modal/mount.py,sha256=Y2sXIbUbr3ymVvfvknwbouBkkAUPIW1nkSToRGh8w7g,31973
48
+ modal/mount.py,sha256=_v1VYxryY3BcF4XxyRfOWm7AxAz79D2VRWh5tOHhWuc,31945
50
49
  modal/mount.pyi,sha256=CmHa7zKSxHA_7-vMQLnGfw_ZXvAvHlafvUEVJcQ1LQA,12535
51
50
  modal/network_file_system.py,sha256=WXdyL7du_fvjvuG6hSAREyJ83sSEP2xSLAIAhBsisdI,14869
52
51
  modal/network_file_system.pyi,sha256=4N3eqMbTSlqmS8VV_aJK-uvrgJC8xnf_YtW5FHfRfc8,8156
@@ -124,7 +123,7 @@ modal/cli/container.py,sha256=FYwEgjf93j4NMorAjGbSV98i1wpebqdAeNU1wfrFp1k,3668
124
123
  modal/cli/dict.py,sha256=8Wq3w-UDaywk8EVNdj-ECCNV9TYHqh4kzhUqhhulatM,4593
125
124
  modal/cli/entry_point.py,sha256=dOosuCwhfznwTCB4oMljUFhihq5aLUVoAz7RhcBEDnc,4189
126
125
  modal/cli/environment.py,sha256=Ayddkiq9jdj3XYDJ8ZmUqFpPPH8xajYlbexRkzGtUcg,4334
127
- modal/cli/import_refs.py,sha256=53WmXyOivTk2Pi85NgAr8K5tjwOxNeCmOR0wLNEEX1c,13941
126
+ modal/cli/import_refs.py,sha256=pmzY0hpexx6DtvobNmCOvRqEdS9IriEP4BpMw1TIy2w,13911
128
127
  modal/cli/launch.py,sha256=0_sBu6bv2xJEPWi-rbGS6Ri9ggnkWQvrGlgpYSUBMyY,3097
129
128
  modal/cli/network_file_system.py,sha256=eq3JnwjbfFNsJodIyANHL06ByYc3BSavzdmu8C96cHA,7948
130
129
  modal/cli/profile.py,sha256=0TYhgRSGUvQZ5LH9nkl6iZllEvAjDniES264dE57wOM,3201
@@ -146,7 +145,7 @@ modal/requirements/2024.10.txt,sha256=qD-5cVIVM9wXesJ6JC89Ew-3m2KjEElUz3jaw_MddR
146
145
  modal/requirements/PREVIEW.txt,sha256=qD-5cVIVM9wXesJ6JC89Ew-3m2KjEElUz3jaw_MddRo,296
147
146
  modal/requirements/README.md,sha256=9tK76KP0Uph7O0M5oUgsSwEZDj5y-dcUPsnpR0Sc-Ik,854
148
147
  modal/requirements/base-images.json,sha256=57vMSqzMbLBxw5tFWSaMiIkkVEps4JfX5PAtXGnkS4U,740
149
- modal-0.73.166.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
148
+ modal-0.73.168.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
150
149
  modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
151
150
  modal_docs/gen_cli_docs.py,sha256=c1yfBS_x--gL5bs0N4ihMwqwX8l3IBWSkBAKNNIi6bQ,3801
152
151
  modal_docs/gen_reference_docs.py,sha256=cvTgltucqYLLIX84QxAwf51Z5Vc2n6cLxS8VcrxNCAo,6401
@@ -171,9 +170,9 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
171
170
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
172
171
  modal_version/__init__.py,sha256=wiJQ53c-OMs0Xf1UeXOxQ7FwlV1VzIjnX6o-pRYZ_Pk,470
173
172
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
174
- modal_version/_version_generated.py,sha256=sC0tLCnx3SA3ug30Mb8CeHVzuzTF5kCgUvvoRJgRMB0,150
175
- modal-0.73.166.dist-info/METADATA,sha256=vKOazcM7Fa1cFmz6c1DZZhuPGXzwHG4O0iVSDqHQTwA,2475
176
- modal-0.73.166.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
177
- modal-0.73.166.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
178
- modal-0.73.166.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
179
- modal-0.73.166.dist-info/RECORD,,
173
+ modal_version/_version_generated.py,sha256=-aZvps2fh2rCp0UNwje5SJ9IP_jUoaH-CNdrA4Q-0mo,150
174
+ modal-0.73.168.dist-info/METADATA,sha256=RogiuavaiLYUjRPCDOeC74__s09i-PFiFsUExNzeoAo,2475
175
+ modal-0.73.168.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
176
+ modal-0.73.168.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
177
+ modal-0.73.168.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
178
+ modal-0.73.168.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 = 166 # git: 5e72556
4
+ build_number = 168 # git: cafe25f
modal/_proxy_tunnel.py DELETED
@@ -1,63 +0,0 @@
1
- # Copyright Modal Labs 2022
2
- import contextlib
3
- import os
4
- import subprocess
5
- import tempfile
6
-
7
- from modal_proto import api_pb2
8
-
9
-
10
- @contextlib.contextmanager
11
- def proxy_tunnel(info: api_pb2.ProxyInfo):
12
- if not info.elastic_ip:
13
- yield
14
- return
15
-
16
- with tempfile.NamedTemporaryFile(suffix=".pem") as t:
17
- f = open(t.name, "w")
18
- f.write(info.proxy_key)
19
- f.close()
20
-
21
- if info.remote_addr:
22
- # Forward port from address.
23
- args = [
24
- "-L",
25
- f"{info.remote_port}:{info.remote_addr}:{info.remote_port}",
26
- ]
27
- else:
28
- # Set up SOCKS proxy.
29
- # TODO: add a local_port column and proxy_type (this is all being rewritten anyway)
30
- args = ["-D", f"{info.remote_port}"]
31
- os.environ["HTTP_PROXY"] = f"socks5://localhost:{info.remote_port}"
32
-
33
- # https://github.com/getsentry/sentry-python/issues/1049
34
- os.environ["NO_PROXY"] = "sentry.io"
35
-
36
- cmd = [
37
- "autossh",
38
- "-M 0", # don't use a monitoring port for autossh
39
- "-i",
40
- t.name, # use pem file
41
- "-T", # ignore the tty
42
- "-n", # no input
43
- "-N", # don't execute a command
44
- *args,
45
- f"ubuntu@{info.elastic_ip}",
46
- "-o",
47
- "StrictHostKeyChecking=no", # avoid prompt for host
48
- "-o",
49
- "ServerAliveInterval=5", # seconds before client sends keepalive to server
50
- "-o",
51
- "ServerAliveCountMax=1", # number of failures before terminating ssh (autossh will restart)
52
- "-o",
53
- "LogLevel=ERROR", # disable warning "Permanently added '...' to the list of known hosts."
54
- ]
55
- p = subprocess.Popen(cmd)
56
-
57
- import time
58
-
59
- time.sleep(3)
60
- try:
61
- yield
62
- finally:
63
- p.kill()