modal 0.72.19__py3-none-any.whl → 0.72.21__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/_tunnel.py CHANGED
@@ -145,7 +145,7 @@ async def _forward(port: int, *, unencrypted: bool = False, client: Optional[_Cl
145
145
  modal.Image.debian_slim()
146
146
  .apt_install("openssh-server")
147
147
  .run_commands("mkdir /run/sshd")
148
- .copy_local_file("~/.ssh/id_rsa.pub", "/root/.ssh/authorized_keys")
148
+ .add_local_file("~/.ssh/id_rsa.pub", "/root/.ssh/authorized_keys", copy=True)
149
149
  )
150
150
 
151
151
 
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.72.19"
29
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.72.21"
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.72.19"
84
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.72.21"
85
85
  ): ...
86
86
  def is_closed(self) -> bool: ...
87
87
  @property
modal/image.py CHANGED
@@ -662,13 +662,16 @@ class _Image(_Object, type_prefix="im"):
662
662
  return obj
663
663
 
664
664
  def copy_mount(self, mount: _Mount, remote_path: Union[str, Path] = ".") -> "_Image":
665
- """Copy the entire contents of a `modal.Mount` into an image.
665
+ """
666
+ **Deprecated**: Use image.add_local_dir(..., copy=True) or similar instead.
667
+
668
+ Copy the entire contents of a `modal.Mount` into an image.
666
669
  Useful when files only available locally are required during the image
667
670
  build process.
668
671
 
669
672
  **Example**
670
673
 
671
- ```python
674
+ ```python notest
672
675
  static_images_dir = "./static"
673
676
  # place all static images in root of mount
674
677
  mount = modal.Mount.from_local_dir(static_images_dir, remote_path="/")
@@ -851,14 +854,17 @@ class _Image(_Object, type_prefix="im"):
851
854
  # Which follows dockerignore syntax.
852
855
  ignore: Union[Sequence[str], Callable[[Path], bool]] = [],
853
856
  ) -> "_Image":
854
- """Copy a directory into the image as a part of building the image.
857
+ """
858
+ **Deprecated**: Use image.add_local_dir instead
859
+
860
+ Copy a directory into the image as a part of building the image.
855
861
 
856
862
  This works in a similar way to [`COPY`](https://docs.docker.com/engine/reference/builder/#copy)
857
863
  works in a `Dockerfile`.
858
864
 
859
865
  **Usage:**
860
866
 
861
- ```python
867
+ ```python notest
862
868
  from pathlib import Path
863
869
  from modal import FilePatternMatcher
864
870
 
modal/mount.py CHANGED
@@ -258,12 +258,15 @@ class NonLocalMountError(Exception):
258
258
 
259
259
 
260
260
  class _Mount(_Object, type_prefix="mo"):
261
- """Create a mount for a local directory or file that can be attached
261
+ """
262
+ **Deprecated**: Mounts should not be used explicitly anymore, use image.add_local_* commands instead
263
+
264
+ Create a mount for a local directory or file that can be attached
262
265
  to one or more Modal functions.
263
266
 
264
267
  **Usage**
265
268
 
266
- ```python
269
+ ```python notest
267
270
  import modal
268
271
  import os
269
272
  app = modal.App()
@@ -394,11 +397,13 @@ class _Mount(_Object, type_prefix="mo"):
394
397
  recursive: bool = True,
395
398
  ) -> "_Mount":
396
399
  """
400
+ **Deprecated:** Use image.add_local_dir() instead
401
+
397
402
  Create a `Mount` from a local directory.
398
403
 
399
404
  **Usage**
400
405
 
401
- ```python
406
+ ```python notest
402
407
  assets = modal.Mount.from_local_dir(
403
408
  "~/assets",
404
409
  condition=lambda pth: not ".venv" in pth,
@@ -449,11 +454,13 @@ class _Mount(_Object, type_prefix="mo"):
449
454
  @staticmethod
450
455
  def from_local_file(local_path: Union[str, Path], remote_path: Union[str, PurePosixPath, None] = None) -> "_Mount":
451
456
  """
457
+ **Deprecated**: Use image.add_local_file() instead
458
+
452
459
  Create a `Mount` mounting a single local file.
453
460
 
454
461
  **Usage**
455
462
 
456
- ```python
463
+ ```python notest
457
464
  # Mount the DBT profile in user's home directory into container.
458
465
  dbt_profiles = modal.Mount.from_local_file(
459
466
  local_path="~/profiles.yml",
@@ -611,6 +618,8 @@ class _Mount(_Object, type_prefix="mo"):
611
618
  ignore: Optional[Union[Sequence[str], Callable[[Path], bool]]] = None,
612
619
  ) -> "_Mount":
613
620
  """
621
+ **Deprecated**: Use image.add_local_python_source instead
622
+
614
623
  Returns a `modal.Mount` that makes local modules listed in `module_names` available inside the container.
615
624
  This works by mounting the local path of each module's package to a directory inside the container
616
625
  that's on `PYTHONPATH`.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: modal
3
- Version: 0.72.19
3
+ Version: 0.72.21
4
4
  Summary: Python client library for Modal
5
5
  Author: Modal Labs
6
6
  Author-email: support@modal.com
@@ -12,14 +12,14 @@ modal/_resolver.py,sha256=TtowKu2LdZ7NpiYkSXs058BZ4ivY8KVYdchqLfREkiA,6775
12
12
  modal/_resources.py,sha256=5qmcirXUI8dSH926nwkUaeX9H25mqYu9mXD_KuT79-o,1733
13
13
  modal/_serialization.py,sha256=qPLH6OUEBas1CT-a6i5pOP1hPGt5AfKr9q7RMUTFOMc,18722
14
14
  modal/_traceback.py,sha256=IZQzB3fVlUfMHOSyKUgw0H6qv4yHnpyq-XVCNZKfUdA,5023
15
- modal/_tunnel.py,sha256=o-jJhS4vQ6-XswDhHcJWGMZZmD03SC0e9i8fEu1JTjo,6310
15
+ modal/_tunnel.py,sha256=zTBxBiuH1O22tS1OliAJdIsSmaZS8PlnifS_6S5z-mk,6320
16
16
  modal/_tunnel.pyi,sha256=JmmDYAy9F1FpgJ_hWx0xkom2nTOFQjn4mTPYlU3PFo4,1245
17
17
  modal/_watcher.py,sha256=K6LYnlmSGQB4tWWI9JADv-tvSvQ1j522FwT71B51CX8,3584
18
18
  modal/app.py,sha256=t-INVjEAhSXppcu8m_rhaa1r5tzZmEPCS3lhAZg7xkc,45611
19
19
  modal/app.pyi,sha256=279Tf7Jmwq_SvAm_BKRnollAqefYI22g7wQqP94Er1Y,25453
20
20
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
21
21
  modal/client.py,sha256=JAnd4-GCN093BwkvOFAK5a6iy5ycxofjpUncMxlrIMw,15253
22
- modal/client.pyi,sha256=nCp9rhz_AHgLbzzISFYY3qVP6ekAzgAHsYyQE3XffbY,7280
22
+ modal/client.pyi,sha256=aGTbWWyktsgcmwlTAXb6k2clqWvb5s6RkL2NLyutDTU,7280
23
23
  modal/cloud_bucket_mount.py,sha256=G7T7jWLD0QkmrfKR75mSTwdUZ2xNfj7pkVqb4ipmxmI,5735
24
24
  modal/cloud_bucket_mount.pyi,sha256=CEi7vrH3kDUF4LAy4qP6tfImy2UJuFRcRbsgRNM1wo8,1403
25
25
  modal/cls.py,sha256=jbGYPMM1AhS3Uj8Wh2lk0YARDCul_imUDiJmbyrfSSc,32158
@@ -39,11 +39,11 @@ modal/file_pattern_matcher.py,sha256=dSo7BMQGZBAuoBFOX-e_72HxmF3FLzjQlEtnGtJiaD4
39
39
  modal/functions.py,sha256=3uJPbrEAWhpFfLfUnoRjGmvEUC-_wVh-8yNJBx8eVeM,68249
40
40
  modal/functions.pyi,sha256=LiSDgH-X7jcZ56pAoLMwo3x9Dzdp_3Sd7W5MVAJPoCg,25407
41
41
  modal/gpu.py,sha256=MTxj6ql8EpgfBg8YmZ5a1cLznyuZFssX1qXbEX4LKVM,7503
42
- modal/image.py,sha256=0eGAw3bImUTS0KzsfnsKreixaZlbWfutgoluo7Hq7RQ,90747
42
+ modal/image.py,sha256=IRNG4g6mrx7sf038yVWCBK3AU2IEJjibt0OqNvLNtGU,90921
43
43
  modal/image.pyi,sha256=NfZyLkl4rmxpc5fokaO4mmEeGFOwGn0AndV1vKwBdbs,26027
44
44
  modal/io_streams.py,sha256=QkQiizKRzd5bnbKQsap31LJgBYlAnj4-XkV_50xPYX0,15079
45
45
  modal/io_streams.pyi,sha256=bCCVSxkMcosYd8O3PQDDwJw7TQ8JEcnYonLJ5t27TQs,4804
46
- modal/mount.py,sha256=nGimxizRzCpyZu9cpTdKQRgU9uqMnl3xBrTRR_rD6fE,31480
46
+ modal/mount.py,sha256=JVaJ9znu81WKP3Wjn3vvAIkaSnEgRSQqppXz6Fh_G6o,31798
47
47
  modal/mount.pyi,sha256=mcKMYwt8dX3oO8OzzKqCdh7K2EhMhWIHEPoJwzi1rl8,12194
48
48
  modal/network_file_system.py,sha256=INj1TfN_Fsmabmlte7anvey1epodjbMmjBW_TIJSST4,14406
49
49
  modal/network_file_system.pyi,sha256=61M-sdWrtaRjmuNVsvusI6kf1Qw-jUOVXvEAeOkM8Aw,7751
@@ -148,10 +148,10 @@ modal_global_objects/mounts/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0
148
148
  modal_global_objects/mounts/modal_client_package.py,sha256=W0E_yShsRojPzWm6LtIQqNVolapdnrZkm2hVEQuZK_4,767
149
149
  modal_global_objects/mounts/python_standalone.py,sha256=pEML5GaV2_0ahci_1vpfc_FnySpsfi2fhYmFF5I7IiQ,1837
150
150
  modal_proto/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0VESpjWR0fc,28
151
- modal_proto/api.proto,sha256=cCephAhAzYqBzstMGl4oJitWm37u5-cfslCnoW7snTQ,82429
151
+ modal_proto/api.proto,sha256=JPmJxNdZPbBPumoC018p8u3boMuuvyR1d7guf_ykBEY,82787
152
152
  modal_proto/api_grpc.py,sha256=U2-xzAtfSS017rCpNHmscNHLl6FSQ1mjJY8BhPXovpk,104423
153
- modal_proto/api_pb2.py,sha256=CxkkTLh7H0HHul_gII7yNxz4gcHFZyz3CpfCgJfX3OY,302179
154
- modal_proto/api_pb2.pyi,sha256=hRJ4w5hb3r8CYhPPsQkSAtDd00O07c3yOnyqW_3HGrc,403130
153
+ modal_proto/api_pb2.py,sha256=QejGk8FYbFoCHJCXwjnVEh9E5CmLNHT-e9nAqJWeZpo,302428
154
+ modal_proto/api_pb2.pyi,sha256=mD3smLXwdjMl_DSI2DBCxsgGiSyBeG2082I2e0Lb9lQ,404511
155
155
  modal_proto/api_pb2_grpc.py,sha256=upL_jT9kJXcvOq-fl6VU8OBPqvDj6bqh0UE2ipgrY4I,225767
156
156
  modal_proto/api_pb2_grpc.pyi,sha256=zEO6zm_ImjG7a8PtkdohHRsPSnrZQKzg5y1ZVi6dFF8,52620
157
157
  modal_proto/modal_api_grpc.py,sha256=f6SJgIPmHx4RJmi5vPIanOCtIFXFdxHoUqcU8wPdn8g,13952
@@ -165,10 +165,10 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
165
165
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
166
166
  modal_version/__init__.py,sha256=kGya2ZlItX2zB7oHORs-wvP4PG8lg_mtbi1QIK3G6SQ,470
167
167
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
168
- modal_version/_version_generated.py,sha256=6Hq4lSJ_DIFz_DVe-D10EzDe9nD8g6TzKPlHm1ikl2Q,149
169
- modal-0.72.19.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
170
- modal-0.72.19.dist-info/METADATA,sha256=L-aCv827WiIU3PdkGtWrxEBGtNPndtPGqmqnZYznj0M,2329
171
- modal-0.72.19.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
172
- modal-0.72.19.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
173
- modal-0.72.19.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
174
- modal-0.72.19.dist-info/RECORD,,
168
+ modal_version/_version_generated.py,sha256=zszePePZlKIur-4eGGPVqHGOUFtIr_f0irJ0aBbKJKs,149
169
+ modal-0.72.21.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
170
+ modal-0.72.21.dist-info/METADATA,sha256=NlMtlDzDoHG-x8LzqIcHfsmeWsidEr-JVsmJKNYqxUQ,2329
171
+ modal-0.72.21.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
172
+ modal-0.72.21.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
173
+ modal-0.72.21.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
174
+ modal-0.72.21.dist-info/RECORD,,
modal_proto/api.proto CHANGED
@@ -2242,10 +2242,13 @@ message SandboxGetLogsRequest {
2242
2242
 
2243
2243
  message SandboxGetTaskIdRequest {
2244
2244
  string sandbox_id = 1;
2245
+ float timeout = 2;
2246
+ bool wait_until_ready = 3; // If true, waits until the container's postStart hook has been run before returning. Useful for detecting init failures.
2245
2247
  }
2246
2248
 
2247
2249
  message SandboxGetTaskIdResponse {
2248
- string task_id = 1;
2250
+ optional string task_id = 1; // This is None if the sandbox was terminated before a task could be scheduled.
2251
+ optional GenericResult task_result = 2; // If the task has already exited, this is the result.
2249
2252
  }
2250
2253
 
2251
2254
  message SandboxGetTunnelsRequest {