modal 0.73.144__py3-none-any.whl → 0.73.145__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/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.144",
34
+ version: str = "0.73.145",
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.144",
96
+ version: str = "0.73.145",
97
97
  ): ...
98
98
  def is_closed(self) -> bool: ...
99
99
  @property
@@ -1,6 +1,8 @@
1
1
  # Copyright Modal Labs 2025
2
+ import os
2
3
  from dataclasses import dataclass
3
- from typing import Any, Callable, Optional
4
+ from pathlib import Path
5
+ from typing import Any, Callable, Literal, Optional, Union
4
6
 
5
7
  from modal_proto import api_pb2
6
8
 
@@ -12,6 +14,8 @@ from .._runtime.container_io_manager import _ContainerIOManager
12
14
  from .._utils.async_utils import synchronizer
13
15
  from ..client import _Client
14
16
  from ..exception import InvalidError
17
+ from ..image import DockerfileSpec, ImageBuilderVersion, _Image, _ImageRegistryConfig
18
+ from ..secret import _Secret
15
19
 
16
20
 
17
21
  def stop_fetching_inputs():
@@ -103,3 +107,82 @@ async def list_deployed_apps(environment_name: str = "", client: Optional[_Clien
103
107
  )
104
108
  )
105
109
  return app_infos
110
+
111
+
112
+ @synchronizer.create_blocking
113
+ async def raw_dockerfile_image(
114
+ path: Union[str, Path],
115
+ force_build: bool = False,
116
+ ) -> _Image:
117
+ """
118
+ Build a Modal Image from a local Dockerfile recipe without any changes.
119
+
120
+ Unlike for `modal.Image.from_dockerfile`, the provided recipe will not be embellished with
121
+ steps to install dependencies for the Modal client package. As a consequence, the resulting
122
+ Image cannot be used with a modal Function unless those dependencies are added in a subsequent
123
+ layer. It _can_ be directly used with a modal Sandbox, which does not need the Modal client.
124
+
125
+ We expect to support this experimental function until the `2025.04` Modal Image Builder is
126
+ stable, at which point Modal Image recipes will no longer install the client dependencies
127
+ by default. At that point, users can upgrade their Image Builder Version and migrate to
128
+ `modal.Image.from_dockerfile` for usecases supported by this function.
129
+
130
+ """
131
+
132
+ def build_dockerfile(version: ImageBuilderVersion) -> DockerfileSpec:
133
+ with open(os.path.expanduser(path)) as f:
134
+ commands = f.read().split("\n")
135
+ return DockerfileSpec(commands=commands, context_files={})
136
+
137
+ return _Image._from_args(
138
+ dockerfile_function=build_dockerfile,
139
+ force_build=force_build,
140
+ )
141
+
142
+
143
+ @synchronizer.create_blocking
144
+ async def raw_registry_image(
145
+ tag: str,
146
+ registry_secret: Optional[_Secret] = None,
147
+ credential_type: Literal["static", "aws", "gcp", None] = None,
148
+ force_build: bool = False,
149
+ ) -> _Image:
150
+ """
151
+ Build a Modal Image from a public or private image registry without any changes.
152
+
153
+ Unlike for `modal.Image.from_registry`, the provided recipe will not be embellished with
154
+ steps to install dependencies for the Modal client package. As a consequence, the resulting
155
+ Image cannot be used with a modal Function unless those dependencies are added in a subsequent
156
+ layer. It _can_ be directly used with a modal Sandbox, which does not need the Modal client.
157
+
158
+ We expect to support this experimental function until the `2025.04` Modal Image Builder is
159
+ stable, at which point Modal Image recipes will no longer install the client dependencies
160
+ by default. At that point, users can upgrade their Image Builder Version and migrate to
161
+ `modal.Image.from_registry` for usecases supported by this function.
162
+
163
+ """
164
+
165
+ def build_dockerfile(version: ImageBuilderVersion) -> DockerfileSpec:
166
+ commands = [f"FROM {tag}"]
167
+ return DockerfileSpec(commands=commands, context_files={})
168
+
169
+ if registry_secret:
170
+ if credential_type is None:
171
+ raise InvalidError("credential_type must be provided when using a registry_secret")
172
+ elif credential_type == "static":
173
+ auth_type = api_pb2.REGISTRY_AUTH_TYPE_STATIC_CREDS
174
+ elif credential_type == "aws":
175
+ auth_type = api_pb2.REGISTRY_AUTH_TYPE_AWS
176
+ elif credential_type == "gcp":
177
+ auth_type = api_pb2.REGISTRY_AUTH_TYPE_GCP
178
+ else:
179
+ raise InvalidError(f"Invalid credential_type: {credential_type!r}")
180
+ registry_config = _ImageRegistryConfig(auth_type, registry_secret)
181
+ else:
182
+ registry_config = None
183
+
184
+ return _Image._from_args(
185
+ dockerfile_function=build_dockerfile,
186
+ image_registry_config=registry_config,
187
+ force_build=force_build,
188
+ )
modal/functions.pyi CHANGED
@@ -199,11 +199,11 @@ class Function(
199
199
 
200
200
  _call_generator_nowait: ___call_generator_nowait_spec[typing_extensions.Self]
201
201
 
202
- class __remote_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
202
+ class __remote_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
203
203
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
204
204
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
205
205
 
206
- remote: __remote_spec[modal._functions.P, modal._functions.ReturnType, typing_extensions.Self]
206
+ remote: __remote_spec[modal._functions.ReturnType, modal._functions.P, typing_extensions.Self]
207
207
 
208
208
  class __remote_gen_spec(typing_extensions.Protocol[SUPERSELF]):
209
209
  def __call__(self, *args, **kwargs) -> typing.Generator[typing.Any, None, None]: ...
@@ -218,19 +218,19 @@ class Function(
218
218
  self, *args: modal._functions.P.args, **kwargs: modal._functions.P.kwargs
219
219
  ) -> modal._functions.OriginalReturnType: ...
220
220
 
221
- class ___experimental_spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
221
+ class ___experimental_spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
222
222
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
223
223
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
224
224
 
225
225
  _experimental_spawn: ___experimental_spawn_spec[
226
- modal._functions.P, modal._functions.ReturnType, typing_extensions.Self
226
+ modal._functions.ReturnType, modal._functions.P, typing_extensions.Self
227
227
  ]
228
228
 
229
- class __spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
229
+ class __spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
230
230
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
231
231
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
232
232
 
233
- spawn: __spawn_spec[modal._functions.P, modal._functions.ReturnType, typing_extensions.Self]
233
+ spawn: __spawn_spec[modal._functions.ReturnType, modal._functions.P, typing_extensions.Self]
234
234
 
235
235
  def get_raw_f(self) -> collections.abc.Callable[..., typing.Any]: ...
236
236
 
modal/image.py CHANGED
@@ -1562,7 +1562,7 @@ class _Image(_Object, type_prefix="im"):
1562
1562
  add_python: Optional[str] = None,
1563
1563
  **kwargs,
1564
1564
  ) -> "_Image":
1565
- """Build a Modal image from a public or private image registry, such as Docker Hub.
1565
+ """Build a Modal Image from a public or private image registry, such as Docker Hub.
1566
1566
 
1567
1567
  The image must be built for the `linux/amd64` platform.
1568
1568
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: modal
3
- Version: 0.73.144
3
+ Version: 0.73.145
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License: Apache-2.0
@@ -23,7 +23,7 @@ modal/app.py,sha256=NKH7Cw1M6eyyrMXFbhWfdo3uRd28-8kv0Pcw56kPiPU,47312
23
23
  modal/app.pyi,sha256=pUEqciyGZ446sc_QoG8XcQ_oc6oU-U4dqjkxjhgOX98,26968
24
24
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
25
25
  modal/client.py,sha256=j9D3hNis1lfhnz9lVFGgJgowbH3PaGUzNKgHPWYG778,15372
26
- modal/client.pyi,sha256=TPAHOAvhShPn02XTJTDuDHKZCGHH4NR5g0cg63AGJn0,7661
26
+ modal/client.pyi,sha256=J7eXuFOFX-QEUY-bFll_4B9V3SqdWS9iuFrslnty0Sc,7661
27
27
  modal/cloud_bucket_mount.py,sha256=YOe9nnvSr4ZbeCn587d7_VhE9IioZYRvF9VYQTQux08,5914
28
28
  modal/cloud_bucket_mount.pyi,sha256=30T3K1a89l6wzmEJ_J9iWv9SknoGqaZDx59Xs-ZQcmk,1607
29
29
  modal/cls.py,sha256=PJimWA9q_sbQJNLbYy7fzjZGBm_hdfXuuZ7O_pKLXdk,31586
@@ -40,9 +40,9 @@ modal/file_io.py,sha256=lcMs_E9Xfm0YX1t9U2wNIBPnqHRxmImqjLW1GHqVmyg,20945
40
40
  modal/file_io.pyi,sha256=NTRft1tbPSWf9TlWVeZmTlgB5AZ_Zhu2srWIrWr7brk,9445
41
41
  modal/file_pattern_matcher.py,sha256=trosX-Bp7dOubudN1bLLhRAoidWy1TcoaR4Pv8CedWw,6497
42
42
  modal/functions.py,sha256=kcNHvqeGBxPI7Cgd57NIBBghkfbeFJzXO44WW0jSmao,325
43
- modal/functions.pyi,sha256=PqApQjvICj11NIMEVCmaUIUyJUfEIuY_KkEzCZ4t6iI,14438
43
+ modal/functions.pyi,sha256=0Au1n37DimTZVvxCIR7HWALuNGxfJ_fcNR-or37eo5k,14438
44
44
  modal/gpu.py,sha256=Kbhs_u49FaC2Zi0TjCdrpstpRtT5eZgecynmQi5IZVE,6752
45
- modal/image.py,sha256=5LQt3gqIUg-OCsrNgDBgnGxxjc-qpoKALh7orazzfns,92835
45
+ modal/image.py,sha256=HtkKomhX4inozqSRi7lf5Vt9IEqCnVHn5bEo59hD64A,92835
46
46
  modal/image.pyi,sha256=iWclz2rxaP-LSsYMgU0X3ZcN5mEFvpyKzIPKJbohmsg,25591
47
47
  modal/io_streams.py,sha256=h5O2LmbRoT9l777z3TQhCAm-JF1r7avZ2ykXlejztDs,15163
48
48
  modal/io_streams.pyi,sha256=bJ7ZLmSmJ0nKoa6r4FJpbqvzdUVa0lEe0Fa-MMpMezU,5071
@@ -137,7 +137,7 @@ modal/cli/volume.py,sha256=c2IuVNO2yJVaXmZkRh3xwQmznlRTgFoJr_BIzzqtVv0,10251
137
137
  modal/cli/programs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
138
138
  modal/cli/programs/run_jupyter.py,sha256=MX6YQ6zRyRk1xo8tYZFiGam0p5KETwax81L6TpaS9I0,2778
139
139
  modal/cli/programs/vscode.py,sha256=kfvhZQ4bJwtVm3MgC1V7AlygZOlKT1a33alr_uwrewA,3473
140
- modal/experimental/__init__.py,sha256=6VY98HfgoQU-65ELJ4Re_PB3VBCjDMZywuK1oOvljkg,4025
140
+ modal/experimental/__init__.py,sha256=DXXQnYEjaRPcr1b4pbKk4DckHKtQ8T8PcWTUuXG4_ug,7595
141
141
  modal/experimental/ipython.py,sha256=epLUZeDSdE226TH_tU3igRKCiVuQi99mUOrIJ4SemOE,2792
142
142
  modal/requirements/2023.12.312.txt,sha256=zWWUVgVQ92GXBKNYYr2-5vn9rlnXcmkqlwlX5u1eTYw,400
143
143
  modal/requirements/2023.12.txt,sha256=OjsbXFkCSdkzzryZP82Q73osr5wxQ6EUzmGcK7twfkA,502
@@ -170,10 +170,10 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
170
170
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
171
171
  modal_version/__init__.py,sha256=wiJQ53c-OMs0Xf1UeXOxQ7FwlV1VzIjnX6o-pRYZ_Pk,470
172
172
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
173
- modal_version/_version_generated.py,sha256=oP8FBwJ_HKXD6yAhf1l_IrgPeFJSa6ZQvwv4tNoQVCI,150
174
- modal-0.73.144.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
175
- modal-0.73.144.dist-info/METADATA,sha256=w8KwgQdaRx180ZIspfveM_SM3EGHff-v9LndELGyNqA,2453
176
- modal-0.73.144.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
177
- modal-0.73.144.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
178
- modal-0.73.144.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
179
- modal-0.73.144.dist-info/RECORD,,
173
+ modal_version/_version_generated.py,sha256=YQBstI23mB655VZiiHXuwQBeJvkuthZrz2UWbWaboK0,150
174
+ modal-0.73.145.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
175
+ modal-0.73.145.dist-info/METADATA,sha256=TN9rgxptFzQz0ByXCsWGymktdRwq5gSl7bpKDvxwDrw,2453
176
+ modal-0.73.145.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
177
+ modal-0.73.145.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
178
+ modal-0.73.145.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
179
+ modal-0.73.145.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 = 144 # git: d3f70c8
4
+ build_number = 145 # git: d6f7843