modal 0.67.27__py3-none-any.whl → 0.67.32__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.
@@ -478,7 +478,9 @@ def main(container_args: api_pb2.ContainerArguments, client: Client):
478
478
  if len(service.code_deps) != len(dep_object_ids):
479
479
  raise ExecutionError(
480
480
  f"Function has {len(service.code_deps)} dependencies"
481
- f" but container got {len(dep_object_ids)} object ids."
481
+ f" but container got {len(dep_object_ids)} object ids.\n"
482
+ f"Code deps: {service.code_deps}\n"
483
+ f"Object ids: {dep_object_ids}"
482
484
  )
483
485
  for object_id, obj in zip(dep_object_ids, service.code_deps):
484
486
  metadata: Message = container_app.object_handle_metadata[object_id]
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.67.27"
29
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.67.32"
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.67.27"
84
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.67.32"
85
85
  ): ...
86
86
  def is_closed(self) -> bool: ...
87
87
  @property
modal/cls.py CHANGED
@@ -354,7 +354,7 @@ class _Cls(_Object, type_prefix="cs"):
354
354
  self._method_functions[method_name] = _Function._new_hydrated(
355
355
  self._class_service_function.object_id, self._client, method_handle_metadata
356
356
  )
357
- elif self._class_service_function:
357
+ elif self._class_service_function and self._class_service_function.object_id:
358
358
  # A class with a class service function and method placeholder functions
359
359
  self._method_functions = {}
360
360
  for method in metadata.methods:
modal/functions.pyi CHANGED
@@ -455,11 +455,11 @@ class Function(typing.Generic[P, ReturnType, OriginalReturnType], modal.object.O
455
455
 
456
456
  _call_generator_nowait: ___call_generator_nowait_spec
457
457
 
458
- class __remote_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
458
+ class __remote_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
459
459
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
460
460
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
461
461
 
462
- remote: __remote_spec[P, ReturnType]
462
+ remote: __remote_spec[ReturnType, P]
463
463
 
464
464
  class __remote_gen_spec(typing_extensions.Protocol):
465
465
  def __call__(self, *args, **kwargs) -> typing.Generator[typing.Any, None, None]: ...
@@ -471,17 +471,17 @@ class Function(typing.Generic[P, ReturnType, OriginalReturnType], modal.object.O
471
471
  def _get_obj(self) -> typing.Optional[modal.cls.Obj]: ...
472
472
  def local(self, *args: P.args, **kwargs: P.kwargs) -> OriginalReturnType: ...
473
473
 
474
- class ___experimental_spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
474
+ class ___experimental_spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
475
475
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
476
476
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
477
477
 
478
- _experimental_spawn: ___experimental_spawn_spec[P, ReturnType]
478
+ _experimental_spawn: ___experimental_spawn_spec[ReturnType, P]
479
479
 
480
- class __spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
480
+ class __spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
481
481
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
482
482
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
483
483
 
484
- spawn: __spawn_spec[P, ReturnType]
484
+ spawn: __spawn_spec[ReturnType, P]
485
485
 
486
486
  def get_raw_f(self) -> typing.Callable[..., typing.Any]: ...
487
487
 
modal/image.py CHANGED
@@ -677,13 +677,13 @@ class _Image(_Object, type_prefix="im"):
677
677
  context_mount=mount,
678
678
  )
679
679
 
680
- def _add_local_python_packages(self, *packages: str, copy: bool = False) -> "_Image":
681
- """Adds Python package files to containers
680
+ def add_local_python_source(self, *modules: str, copy: bool = False) -> "_Image":
681
+ """Adds locally available Python packages/modules to containers
682
682
 
683
- Adds all files from the specified Python packages to containers running the Image.
683
+ Adds all files from the specified Python package or module to containers running the Image.
684
684
 
685
685
  Packages are added to the `/root` directory of containers, which is on the `PYTHONPATH`
686
- of any executed Modal Functions.
686
+ of any executed Modal Functions, enabling import of the module by that name.
687
687
 
688
688
  By default (`copy=False`), the files are added to containers on startup and are not built into the actual Image,
689
689
  which speeds up deployment.
@@ -693,9 +693,14 @@ class _Image(_Object, type_prefix="im"):
693
693
  required if you want to run additional build steps after this one.
694
694
 
695
695
  **Note:** This excludes all dot-prefixed subdirectories or files and all `.pyc`/`__pycache__` files.
696
- To add full directories with finer control, use `.add_local_dir()` instead.
696
+ To add full directories with finer control, use `.add_local_dir()` instead and specify `/root` as
697
+ the destination directory.
697
698
  """
698
- mount = _Mount.from_local_python_packages(*packages)
699
+
700
+ def only_py_files(filename):
701
+ return filename.endswith(".py")
702
+
703
+ mount = _Mount.from_local_python_packages(*modules, condition=only_py_files)
699
704
  return self._add_mount_layer_or_copy(mount, copy=copy)
700
705
 
701
706
  def copy_local_dir(self, local_path: Union[str, Path], remote_path: Union[str, Path] = ".") -> "_Image":
@@ -1005,8 +1010,8 @@ class _Image(_Object, type_prefix="im"):
1005
1010
  If not provided as argument the path to the lockfile is inferred. However, the
1006
1011
  file has to exist, unless `ignore_lockfile` is set to `True`.
1007
1012
 
1008
- Note that the root project of the poetry project is not installed,
1009
- only the dependencies. For including local packages see `modal.Mount.from_local_python_packages`
1013
+ Note that the root project of the poetry project is not installed, only the dependencies.
1014
+ For including local python source files see `add_local_python_source`
1010
1015
  """
1011
1016
 
1012
1017
  def build_dockerfile(version: ImageBuilderVersion) -> DockerfileSpec:
modal/image.pyi CHANGED
@@ -115,7 +115,7 @@ class _Image(modal.object._Object):
115
115
  def copy_local_file(
116
116
  self, local_path: typing.Union[str, pathlib.Path], remote_path: typing.Union[str, pathlib.Path] = "./"
117
117
  ) -> _Image: ...
118
- def _add_local_python_packages(self, *module_names: str, copy: bool = False) -> _Image: ...
118
+ def add_local_python_source(self, *module_names: str, copy: bool = False) -> _Image: ...
119
119
  def copy_local_dir(
120
120
  self, local_path: typing.Union[str, pathlib.Path], remote_path: typing.Union[str, pathlib.Path] = "."
121
121
  ) -> _Image: ...
@@ -372,7 +372,7 @@ class Image(modal.object.Object):
372
372
  def copy_local_file(
373
373
  self, local_path: typing.Union[str, pathlib.Path], remote_path: typing.Union[str, pathlib.Path] = "./"
374
374
  ) -> Image: ...
375
- def _add_local_python_packages(self, *module_names: str, copy: bool = False) -> Image: ...
375
+ def add_local_python_source(self, *module_names: str, copy: bool = False) -> Image: ...
376
376
  def copy_local_dir(
377
377
  self, local_path: typing.Union[str, pathlib.Path], remote_path: typing.Union[str, pathlib.Path] = "."
378
378
  ) -> Image: ...
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: modal
3
- Version: 0.67.27
3
+ Version: 0.67.32
4
4
  Summary: Python client library for Modal
5
5
  Author: Modal Labs
6
6
  Author-email: support@modal.com
@@ -2,7 +2,7 @@ modal/__init__.py,sha256=Yn8zS7Jxl5uZjPM331Pc4FdSmp9Rt6VdE7TiE4ZKRc8,2151
2
2
  modal/__main__.py,sha256=scYhGFqh8OJcVDo-VOxIT6CCwxOgzgflYWMnIZiMRqE,2871
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=tPkcwcvAGNLHX4mEPzoDYJaNDdPMsYj0fuQ_Py11a6I,28685
5
+ modal/_container_entrypoint.py,sha256=Tae8hAbgN62HM9Q_UFuCyyswfdh1rOey2zzXkbG4Cns,28795
6
6
  modal/_ipython.py,sha256=HF_DYy0e0qM9WnGDmTY30s1RxzGya9GeORCauCEpRaE,450
7
7
  modal/_location.py,sha256=S3lSxIU3h9HkWpkJ3Pwo0pqjIOSB1fjeSgUsY3x7eec,1202
8
8
  modal/_output.py,sha256=0fWX_KQwhER--U81ys16CL-pA5A-LN20C0EZjElKGJQ,25410
@@ -19,10 +19,10 @@ modal/app.py,sha256=EJ7FUN6rWnSwLJoYJh8nmKg_t-8hdN8_rt0OrkP7JvQ,46084
19
19
  modal/app.pyi,sha256=BE5SlR5tRECuc6-e2lUuOknDdov3zxgZ4N0AsLb5ZVQ,25270
20
20
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
21
21
  modal/client.py,sha256=VMg_aIuo_LOEe2ttxBHEND3PLhTp5lo-onH4wELhIyY,16375
22
- modal/client.pyi,sha256=U2SbKMmiIMBV8qZdf-9-h31sv4t8zKJnv4PivYkQY8g,7354
22
+ modal/client.pyi,sha256=4zbps6HpQ0p5dd-ZtJQM8NK-CarLR8E77Tr10uhI76Q,7354
23
23
  modal/cloud_bucket_mount.py,sha256=G7T7jWLD0QkmrfKR75mSTwdUZ2xNfj7pkVqb4ipmxmI,5735
24
24
  modal/cloud_bucket_mount.pyi,sha256=CEi7vrH3kDUF4LAy4qP6tfImy2UJuFRcRbsgRNM1wo8,1403
25
- modal/cls.py,sha256=FixKHMcZAm8st5Gkw_Pq8zRqnlrRwBSbY6VlGyPG194,27335
25
+ modal/cls.py,sha256=OJqzj_V-n1g48BY_4Jg_BOTQdftEEl4kTWN0X4FOOdg,27378
26
26
  modal/cls.pyi,sha256=47jaIT06fz8PSUrs-MaNn6r03PHsAyUGsKuK5e9RMhQ,8140
27
27
  modal/config.py,sha256=1KhNJkjYsJkX1V8RPPdRYPlM2HE-ZZs0JVSxbiXjmrw,11010
28
28
  modal/container_process.py,sha256=YRCKjn56oqTtGjtLxpl_KSkOhYrcRitgF3LOI6o14Q4,5759
@@ -34,10 +34,10 @@ modal/environments.pyi,sha256=XalNpiPkAtHWAvOU2Cotq0ozmtl-Jv0FDsR8h9mr27Q,3521
34
34
  modal/exception.py,sha256=EBkdWVved2XEPsXaoPRu56xfxFFHL9iuqvUsdj42WDA,6392
35
35
  modal/experimental.py,sha256=jFuNbwrNHos47viMB9q-cHJSvf2RDxDdoEcss9plaZE,2302
36
36
  modal/functions.py,sha256=Lteg8dMa8ly72-RM1ozxeGQ500pdeFyJgtflVwp3U7Q,66629
37
- modal/functions.pyi,sha256=3Jupx4QKaqQ9p9XQSG4zDjB3W-87EYkFg55w2QuSQ8M,24892
37
+ modal/functions.pyi,sha256=DXodybnhZ4kD0CAFmQXRTv6FhcsHIgZ5TT_rInG3xDo,24892
38
38
  modal/gpu.py,sha256=r4rL6uH3UJIQthzYvfWauXNyh01WqCPtKZCmmSX1fd4,6881
39
- modal/image.py,sha256=ZIC8tgjJnqWamN4sZ0Gch3x2VmcM671MWfRLR5SMmoc,79423
40
- modal/image.pyi,sha256=JjicLNuaBsfuPZ_xo_eN0zKZkDrEm2alYg-szENhJjM,24591
39
+ modal/image.py,sha256=cQ6WP1xHXZT_nY8z3aEFiGwKzrTV0yxi3Ab8JzF91eo,79653
40
+ modal/image.pyi,sha256=PIKH6JBA4L5TfdJrQu3pm2ykyIITmiP920TpP8cdyQA,24585
41
41
  modal/io_streams.py,sha256=YfKAlWQAxzPCHE0-wVlAlX5vldrpfKMdr9ggL0c5VJo,15063
42
42
  modal/io_streams.pyi,sha256=bCCVSxkMcosYd8O3PQDDwJw7TQ8JEcnYonLJ5t27TQs,4804
43
43
  modal/mount.py,sha256=liaid5p42o0OKnzoocJJ_oCovDVderk3-JuCTa5pqtA,27656
@@ -142,10 +142,10 @@ modal_global_objects/mounts/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0
142
142
  modal_global_objects/mounts/modal_client_package.py,sha256=W0E_yShsRojPzWm6LtIQqNVolapdnrZkm2hVEQuZK_4,767
143
143
  modal_global_objects/mounts/python_standalone.py,sha256=SL_riIxpd8mP4i4CLDCWiFFNj0Ltknm9c_UIGfX5d60,1836
144
144
  modal_proto/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0VESpjWR0fc,28
145
- modal_proto/api.proto,sha256=I36DzPZ4fs045HqQCEdgEiiJr1Dcd6T6fFA1RbQW7aE,78014
145
+ modal_proto/api.proto,sha256=MMIHOSpeYwPmOlauMBY2FX30Wnkpri-rTU3UUCF4Fs0,78045
146
146
  modal_proto/api_grpc.py,sha256=cQOfwiGd2Nyj9esTgtu39EK1QKGZJXharISgWG7_lQ8,99814
147
- modal_proto/api_pb2.py,sha256=rk-8yxgiqsevrf8ZOQl7Elr5xKKz0nYdI46Yd6S0iJI,284335
148
- modal_proto/api_pb2.pyi,sha256=FCMnndhn2lqdFo1kr49PjfOQzxacPg2UHM9hGpatdS8,380051
147
+ modal_proto/api_pb2.py,sha256=VMQvaiLHdw1Ux5JjqPFHLbHK3Bb6hLUYgzzxw5o9ZrM,284381
148
+ modal_proto/api_pb2.pyi,sha256=n9SMpTlIG3qhNI6XBc3gez5OeSzuaRfs4jkfu8WMIRw,380221
149
149
  modal_proto/api_pb2_grpc.py,sha256=VTrD72cWvA2SscVVpR7w0swwGJ2O6pY-uASamt9Qm7M,215824
150
150
  modal_proto/api_pb2_grpc.pyi,sha256=SbWtkTeCztsSOz8WaM07UZ5fxfKn7nQG4Dxbp5PQUz8,50356
151
151
  modal_proto/modal_api_grpc.py,sha256=AUfZ2n1xOaCv-NzMp5w91fgsQi5zs79IDLH7RGOg1-o,13340
@@ -159,10 +159,10 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
159
159
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
160
160
  modal_version/__init__.py,sha256=3IY-AWLH55r35_mQXIaut0jrJvoPuf1NZJBQQfSbPuo,470
161
161
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
162
- modal_version/_version_generated.py,sha256=ywXYELd_KsMic3fpfOjfFoR6nTm4q6RO_003ggU16KY,149
163
- modal-0.67.27.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
164
- modal-0.67.27.dist-info/METADATA,sha256=zzEw1NV467f49iFBnn2iIwCl0YDrISHZ0FSh6z6VXdA,2329
165
- modal-0.67.27.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
166
- modal-0.67.27.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
167
- modal-0.67.27.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
168
- modal-0.67.27.dist-info/RECORD,,
162
+ modal_version/_version_generated.py,sha256=MDdEWbnNwMHW58F3zcdY0CtQdnfVW_NfYn6ACPPa6eA,149
163
+ modal-0.67.32.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
164
+ modal-0.67.32.dist-info/METADATA,sha256=4bjrH0fCoRPBQWtE2ocYna4zQ0R3ZUJnuiaSJk1ZnB4,2329
165
+ modal-0.67.32.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
166
+ modal-0.67.32.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
167
+ modal-0.67.32.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
168
+ modal-0.67.32.dist-info/RECORD,,
modal_proto/api.proto CHANGED
@@ -589,6 +589,7 @@ message CheckpointInfo {
589
589
  string runtime_fingerprint = 4;
590
590
  int64 size = 5;
591
591
  bool checksum_is_file_index = 6;
592
+ string original_task_id = 7;
592
593
  }
593
594
 
594
595
  message ClassCreateRequest {