modAL 1.4.3.dev24__py3-none-any.whl → 1.4.3.dev25__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
@@ -35,7 +35,7 @@ class _Client:
35
35
  server_url: str,
36
36
  client_type: int,
37
37
  credentials: typing.Optional[tuple[str, str]],
38
- version: str = "1.4.3.dev24",
38
+ version: str = "1.4.3.dev25",
39
39
  ):
40
40
  """mdmd:hidden
41
41
  The Modal client object is not intended to be instantiated directly by users.
@@ -175,7 +175,7 @@ class Client:
175
175
  server_url: str,
176
176
  client_type: int,
177
177
  credentials: typing.Optional[tuple[str, str]],
178
- version: str = "1.4.3.dev24",
178
+ version: str = "1.4.3.dev25",
179
179
  ):
180
180
  """mdmd:hidden
181
181
  The Modal client object is not intended to be instantiated directly by users.
modal/functions.pyi CHANGED
@@ -347,7 +347,7 @@ class Function(
347
347
 
348
348
  _call_generator: ___call_generator_spec
349
349
 
350
- class __remote_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
350
+ class __remote_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
351
351
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER:
352
352
  """Calls the function remotely, executing it with the given arguments and returning the execution's result."""
353
353
  ...
@@ -356,7 +356,7 @@ class Function(
356
356
  """Calls the function remotely, executing it with the given arguments and returning the execution's result."""
357
357
  ...
358
358
 
359
- remote: __remote_spec[modal._functions.ReturnType, modal._functions.P]
359
+ remote: __remote_spec[modal._functions.P, modal._functions.ReturnType]
360
360
 
361
361
  class __remote_gen_spec(typing_extensions.Protocol):
362
362
  def __call__(self, /, *args, **kwargs) -> typing.Generator[typing.Any, None, None]:
@@ -383,7 +383,7 @@ class Function(
383
383
  """
384
384
  ...
385
385
 
386
- class ___experimental_spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
386
+ class ___experimental_spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
387
387
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
388
388
  """[Experimental] Calls the function with the given arguments, without waiting for the results.
389
389
 
@@ -406,7 +406,7 @@ class Function(
406
406
  """
407
407
  ...
408
408
 
409
- _experimental_spawn: ___experimental_spawn_spec[modal._functions.ReturnType, modal._functions.P]
409
+ _experimental_spawn: ___experimental_spawn_spec[modal._functions.P, modal._functions.ReturnType]
410
410
 
411
411
  class ___spawn_map_inner_spec(typing_extensions.Protocol[P_INNER]):
412
412
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> None: ...
@@ -414,7 +414,7 @@ class Function(
414
414
 
415
415
  _spawn_map_inner: ___spawn_map_inner_spec[modal._functions.P]
416
416
 
417
- class __spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
417
+ class __spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
418
418
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
419
419
  """Calls the function with the given arguments, without waiting for the results.
420
420
 
@@ -435,7 +435,7 @@ class Function(
435
435
  """
436
436
  ...
437
437
 
438
- spawn: __spawn_spec[modal._functions.ReturnType, modal._functions.P]
438
+ spawn: __spawn_spec[modal._functions.P, modal._functions.ReturnType]
439
439
 
440
440
  def get_raw_f(self) -> collections.abc.Callable[..., typing.Any]:
441
441
  """Return the inner Python object wrapped by this Modal Function."""
modal/sandbox.py CHANGED
@@ -37,9 +37,11 @@ from .client import _Client
37
37
  from .container_process import _ContainerProcess
38
38
  from .exception import (
39
39
  ClientClosed,
40
+ ConflictError,
40
41
  Error,
41
42
  ExecutionError,
42
43
  InvalidError,
44
+ NotFoundError,
43
45
  SandboxTerminatedError,
44
46
  SandboxTimeoutError,
45
47
  TimeoutError,
@@ -1261,12 +1263,15 @@ class _Sandbox(_Object, type_prefix="sb"):
1261
1263
 
1262
1264
  async def _get_command_router_client(self, task_id: str) -> TaskCommandRouterClient:
1263
1265
  if self._command_router_client is None:
1264
- if self._is_v2:
1265
- self._command_router_client = await TaskCommandRouterClient.init_v2(
1266
- self._client, self.object_id, task_id
1267
- )
1268
- else:
1269
- self._command_router_client = await TaskCommandRouterClient.init(self._client, task_id)
1266
+ try:
1267
+ if self._is_v2:
1268
+ self._command_router_client = await TaskCommandRouterClient.init_v2(
1269
+ self._client, self.object_id, task_id
1270
+ )
1271
+ else:
1272
+ self._command_router_client = await TaskCommandRouterClient.init(self._client, task_id)
1273
+ except (ConflictError, NotFoundError):
1274
+ raise NotFoundError("Sandbox already finished")
1270
1275
  return self._command_router_client
1271
1276
 
1272
1277
  @property
modal/sandbox_fs.py CHANGED
@@ -112,7 +112,7 @@ class _SandboxFilesystem:
112
112
 
113
113
  **Usage**
114
114
 
115
- ```python fixture:sandbox
115
+ ```python fixture:sandbox fixture:tmpdir
116
116
  import tempfile
117
117
  from pathlib import Path
118
118
 
@@ -173,7 +173,7 @@ class _SandboxFilesystem:
173
173
 
174
174
  **Usage**
175
175
 
176
- ```python fixture:sandbox
176
+ ```python fixture:sandbox fixture:tmpdir
177
177
  sandbox.filesystem.write_text("Hello, world!\\n", "/tmp/hello.txt")
178
178
  sandbox.filesystem.copy_to_local("/tmp/hello.txt", "/tmp/local-hello.txt")
179
179
  ```
modal/sandbox_fs.pyi CHANGED
@@ -101,7 +101,7 @@ class _SandboxFilesystem:
101
101
 
102
102
  **Usage**
103
103
 
104
- ```python fixture:sandbox
104
+ ```python fixture:sandbox fixture:tmpdir
105
105
  import tempfile
106
106
  from pathlib import Path
107
107
 
@@ -131,7 +131,7 @@ class _SandboxFilesystem:
131
131
 
132
132
  **Usage**
133
133
 
134
- ```python fixture:sandbox
134
+ ```python fixture:sandbox fixture:tmpdir
135
135
  sandbox.filesystem.write_text("Hello, world!\n", "/tmp/hello.txt")
136
136
  sandbox.filesystem.copy_to_local("/tmp/hello.txt", "/tmp/local-hello.txt")
137
137
  ```
@@ -365,7 +365,7 @@ class SandboxFilesystem:
365
365
 
366
366
  **Usage**
367
367
 
368
- ```python fixture:sandbox
368
+ ```python fixture:sandbox fixture:tmpdir
369
369
  import tempfile
370
370
  from pathlib import Path
371
371
 
@@ -395,7 +395,7 @@ class SandboxFilesystem:
395
395
 
396
396
  **Usage**
397
397
 
398
- ```python fixture:sandbox
398
+ ```python fixture:sandbox fixture:tmpdir
399
399
  import tempfile
400
400
  from pathlib import Path
401
401
 
@@ -428,7 +428,7 @@ class SandboxFilesystem:
428
428
 
429
429
  **Usage**
430
430
 
431
- ```python fixture:sandbox
431
+ ```python fixture:sandbox fixture:tmpdir
432
432
  sandbox.filesystem.write_text("Hello, world!\n", "/tmp/hello.txt")
433
433
  sandbox.filesystem.copy_to_local("/tmp/hello.txt", "/tmp/local-hello.txt")
434
434
  ```
@@ -454,7 +454,7 @@ class SandboxFilesystem:
454
454
 
455
455
  **Usage**
456
456
 
457
- ```python fixture:sandbox
457
+ ```python fixture:sandbox fixture:tmpdir
458
458
  sandbox.filesystem.write_text("Hello, world!\n", "/tmp/hello.txt")
459
459
  sandbox.filesystem.copy_to_local("/tmp/hello.txt", "/tmp/local-hello.txt")
460
460
  ```
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modal
3
- Version: 1.4.3.dev24
3
+ Version: 1.4.3.dev25
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License-Expression: Apache-2.0
@@ -27,7 +27,7 @@ modal/app.pyi,sha256=-9667eLtUgoinLTRrJ-Z3SOgMR0S89Qw_vpwEZfp2Pk,53910
27
27
  modal/billing.py,sha256=B2zXa7KeMnpqi2AQINycEk-KSXVYaLTTTAQTtuf2Gfs,257
28
28
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
29
29
  modal/client.py,sha256=jjT4eLFHGcvIF6Xw4kPptIx-VmExtphRN8XJ1JA7fWI,15502
30
- modal/client.pyi,sha256=el3f1cVbAcF8Tws2AZauC4tXWiL6Yk_MaVZjKUPFByA,15703
30
+ modal/client.pyi,sha256=vpc3Q6h27GhvrFwba4jcqR8UWIR7_gbRbGPByExAfxk,15703
31
31
  modal/cloud_bucket_mount.py,sha256=KkaJVy5vpO_u2NtDYtv1JM-M3y4J0UtWBapTDKpQRcA,6034
32
32
  modal/cloud_bucket_mount.pyi,sha256=mGDeEd1XvxGpCE6O5jRBSfIvMXvZ5AtIybea5k-0w9w,7560
33
33
  modal/cls.py,sha256=Yrl5b_tQhZMhc5avInM-i5UlGuqeog6Gs4rX2d9lLjI,40390
@@ -44,7 +44,7 @@ modal/file_io.py,sha256=DYQXrPUNkKG-0lyzc81E3rh7g56Fg5y6eIQkTqhfqbU,22015
44
44
  modal/file_io.pyi,sha256=DPaq0BhySaiCX3g56QHhyIMdU1izbfWsjpSp30JoJUU,15745
45
45
  modal/file_pattern_matcher.py,sha256=A_Kdkej6q7YQyhM_2-BvpFmPqJ0oHb54B6yf9VqvPVE,8116
46
46
  modal/functions.py,sha256=EZRcHFfnoYbvawUJnAHF5nIvoo9GX2Djy7mUmOCXmXc,258
47
- modal/functions.pyi,sha256=_sZ27MFClkElRg0iyVXmn9pGXwm9F-r49sHjrYhH4Sg,34255
47
+ modal/functions.pyi,sha256=m2uNU9DMi9LWprk9PJykCM1Zs_oEG2-Vl2FaJMGSNpY,34255
48
48
  modal/image.py,sha256=K-105RcY39Kq8uC4toG6WOMTnAVlPn_6P8J_DiNxiyQ,113430
49
49
  modal/image.pyi,sha256=FUAY23rnaUmpRBVazrzh3Z3b9tYTMikbyk2SbuIpihI,81004
50
50
  modal/io_streams.py,sha256=15dSqTktIFvqANRDO8pjFjuwgybGAdRBorEM-3ag-fw,25000
@@ -69,10 +69,10 @@ modal/retries.py,sha256=vPWWKP-FRolJwTBuLPXdWqHV7aJfSQFgEW7vhlBBXRQ,5067
69
69
  modal/runner.py,sha256=GLx_JwZ2hpA5yuHMY2b2Gt8Ri-KxJZHF2Zp1N_qVLD4,30144
70
70
  modal/runner.pyi,sha256=7QHbZawq1P5N9DiSrrEYtXtBCDAWlRibNonBO0q6MdM,9570
71
71
  modal/running_app.py,sha256=v61mapYNV1-O-Uaho5EfJlryMLvIT9We0amUOSvSGx8,1188
72
- modal/sandbox.py,sha256=gibxetDNoZivsDn_BmJvOJHeTLzjWGko60Q8sj3ZM1U,81851
72
+ modal/sandbox.py,sha256=d-En0gdO2GwljRln37X9Krfxr9POVO14KI3SH9OwAD0,82045
73
73
  modal/sandbox.pyi,sha256=zigvkGY9j7Zrw1eD2cmiKgHuFnIJI4OFmc-YtlUhi64,84785
74
- modal/sandbox_fs.py,sha256=bivQ3c27PqG1HazInNWMVcKSjqJhspe5A_Qc2z3Cm8c,22442
75
- modal/sandbox_fs.pyi,sha256=zsSDGNSTkjo_gJYQH3J7if8Y6J8_Uy4f9u0CypCo5uc,34946
74
+ modal/sandbox_fs.py,sha256=3EGten2nvZ7H451FnH0gbFXcdLvQtQNVX-7qI0TtT3c,22472
75
+ modal/sandbox_fs.pyi,sha256=01VyLN0AIplD45qh8F6NJXYj5YxGPaqRETMp4rDLZcQ,35036
76
76
  modal/schedule.py,sha256=ng0g0AqNY5GQI9KhkXZQ5Wam5G42glbkqVQsNpBtbDE,3078
77
77
  modal/scheduler_placement.py,sha256=BAREdOY5HzHpzSBqt6jDVR6YC_jYfHMVqOzkyqQfngU,1235
78
78
  modal/secret.py,sha256=N44g75jJ8r8kcit4U_m5Vu9AdQwi9pXFehpKviP8amQ,18655
@@ -177,7 +177,7 @@ modal/experimental/__init__.py,sha256=Wb1YoAKAnNxH_0c2wA0T12I7bSu9PSO2nS_LuLska7
177
177
  modal/experimental/flash.py,sha256=ATGhVO8AleJ-TOe2PGolI5T7zfCEtj0kl_ivMPp7Rqg,33362
178
178
  modal/experimental/flash.pyi,sha256=R4h2nQl7-oiwqq_twCp0YqID_LnPjPGqxywXvxbiLIk,17011
179
179
  modal/experimental/ipython.py,sha256=TrCfmol9LGsRZMeDoeMPx3Hv3BFqQhYnmD_iH0pqdhk,2904
180
- modal-1.4.3.dev24.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
180
+ modal-1.4.3.dev25.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
181
181
  modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
182
182
  modal_docs/gen_cli_docs.py,sha256=bfUSLscHfoQoKkKjIqJvQMe3fURzqcQK7gF1h9WQLtM,3742
183
183
  modal_docs/gen_cli_docs_main.py,sha256=UPGr7O1DYTIRLwfINe2rbdh89J3cPVTU1OWL-SjxnOQ,198
@@ -187,22 +187,22 @@ modal_docs/mdmd/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,2
187
187
  modal_docs/mdmd/mdmd.py,sha256=z9T3lMktTq3N4r6T6MSSyw8lebbqKc3Igw8l9EdMJNM,9998
188
188
  modal_docs/mdmd/signatures.py,sha256=XJaZrK7Mdepk5fdX51A8uENiLFNil85Ud0d4MH8H5f0,3218
189
189
  modal_proto/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0VESpjWR0fc,28
190
- modal_proto/api_grpc.py,sha256=H4Z21x81592KlGzgDIcgltk5WixY5vs5EyOH8Q89wvA,153140
191
- modal_proto/api_pb2.py,sha256=aidSPW5uZb4F35XlDp95dzZcT6E2ocEll7QEjI4VZLg,424219
192
- modal_proto/api_pb2.pyi,sha256=af6_IDtrNplPKkonrmJwQeiUfoLceP00USGR23r5eFw,594154
193
- modal_proto/api_pb2_grpc.py,sha256=dWnojBtfuaqHvBos1FL-JMNEB7LsNHM1UGUpKXO5IFY,329867
194
- modal_proto/api_pb2_grpc.pyi,sha256=qDqqKIs18olWaoBjLOJ8Z6Gn8_GjpNn3Z1Pw1yG_M4I,77024
195
- modal_proto/modal_api_grpc.py,sha256=bBPhTehvCriGANMHxXNxKa58ew_2QbSvO88zhKCr4CE,24177
190
+ modal_proto/api_grpc.py,sha256=m0qewo8OuWxTAQkTN0-_mBX9V3DJTWJ0Gw-jo4Ug_x8,153908
191
+ modal_proto/api_pb2.py,sha256=U45lMgpFFjnu17GPMPh4NSOUUFKPyou1izr7q23deIk,431810
192
+ modal_proto/api_pb2.pyi,sha256=yxyCVGzs5gnkEFMRlUJw-0roH3F922XZjOeuniEz-Yk,604798
193
+ modal_proto/api_pb2_grpc.py,sha256=-ulRQTC92M00MDa7O2OKABgwgq3w5MYKbQAem9QLBTg,331488
194
+ modal_proto/api_pb2_grpc.pyi,sha256=R3HeGMYv8cTBuzohYodGZf63g_1EILXUj9IfuWdQJMQ,77441
195
+ modal_proto/modal_api_grpc.py,sha256=uLaaPRcnDBe_MQkShJ2Zpw1MtcbF10yjMEF5YNFtjmw,24293
196
196
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
197
197
  modal_proto/task_command_router_grpc.py,sha256=zogBeCYu_EYOz9Gv3699R-cM_ZRc7rtH8Ve5A0d5eKU,15467
198
198
  modal_proto/task_command_router_pb2.py,sha256=FQkKO2A32g8EnaIZvtmYK4qD7gzjNdLDBw5Ar2Wur60,29760
199
199
  modal_proto/task_command_router_pb2.pyi,sha256=bDyqZqe0_UBdBedYEEbc74V6-lW5l5yCxd85L0-VRFI,33421
200
200
  modal_proto/task_command_router_pb2_grpc.py,sha256=BCg4KzeMxsWJlKTTk7Kp5EOKzE_O6IyuEAe5mTi9mRs,30645
201
201
  modal_proto/task_command_router_pb2_grpc.pyi,sha256=5PzLp8Mddys_uygAmzM23bB1dSwhwXDIgj-twKGaKMo,9594
202
- modal_version/__init__.py,sha256=uRoZbpu1gEgo7Nh9M4GRBWh5CmQPUjO7a4xyDfTiURI,121
202
+ modal_version/__init__.py,sha256=X8tHuT3RNNTYDgl8hrSAND27ChTLMy7WhrcKRYcAWf4,121
203
203
  modal_version/__main__.py,sha256=nLUbubxKx7GXNzJIkTB7M7_u8080LyLM0IS0rzFkC_c,119
204
- modal-1.4.3.dev24.dist-info/METADATA,sha256=GEFtkzKy9Cr8cCdKlG1RBEf2hZy4caSYZo-gb_0ChfU,2339
205
- modal-1.4.3.dev24.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
206
- modal-1.4.3.dev24.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
207
- modal-1.4.3.dev24.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
208
- modal-1.4.3.dev24.dist-info/RECORD,,
204
+ modal-1.4.3.dev25.dist-info/METADATA,sha256=QBaejcXjsGRi7Xr_j_JSdQy8zshW6FEjgIZNeJlPfiQ,2339
205
+ modal-1.4.3.dev25.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
206
+ modal-1.4.3.dev25.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
207
+ modal-1.4.3.dev25.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
208
+ modal-1.4.3.dev25.dist-info/RECORD,,
modal_proto/api_grpc.py CHANGED
@@ -259,6 +259,10 @@ class ModalClientBase(abc.ABC):
259
259
  async def DomainList(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.DomainListRequest, modal_proto.api_pb2.DomainListResponse]') -> None:
260
260
  pass
261
261
 
262
+ @abc.abstractmethod
263
+ async def EndpointCreate(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.EndpointCreateRequest, modal_proto.api_pb2.EndpointCreateResponse]') -> None:
264
+ pass
265
+
262
266
  @abc.abstractmethod
263
267
  async def EnvironmentCreate(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.EnvironmentCreateRequest, google.protobuf.empty_pb2.Empty]') -> None:
264
268
  pass
@@ -1173,6 +1177,12 @@ class ModalClientBase(abc.ABC):
1173
1177
  modal_proto.api_pb2.DomainListRequest,
1174
1178
  modal_proto.api_pb2.DomainListResponse,
1175
1179
  ),
1180
+ '/modal.client.ModalClient/EndpointCreate': grpclib.const.Handler(
1181
+ self.EndpointCreate,
1182
+ grpclib.const.Cardinality.UNARY_UNARY,
1183
+ modal_proto.api_pb2.EndpointCreateRequest,
1184
+ modal_proto.api_pb2.EndpointCreateResponse,
1185
+ ),
1176
1186
  '/modal.client.ModalClient/EnvironmentCreate': grpclib.const.Handler(
1177
1187
  self.EnvironmentCreate,
1178
1188
  grpclib.const.Cardinality.UNARY_UNARY,
@@ -2367,6 +2377,12 @@ class ModalClientStub:
2367
2377
  modal_proto.api_pb2.DomainListRequest,
2368
2378
  modal_proto.api_pb2.DomainListResponse,
2369
2379
  )
2380
+ self.EndpointCreate = grpclib.client.UnaryUnaryMethod(
2381
+ channel,
2382
+ '/modal.client.ModalClient/EndpointCreate',
2383
+ modal_proto.api_pb2.EndpointCreateRequest,
2384
+ modal_proto.api_pb2.EndpointCreateResponse,
2385
+ )
2370
2386
  self.EnvironmentCreate = grpclib.client.UnaryUnaryMethod(
2371
2387
  channel,
2372
2388
  '/modal.client.ModalClient/EnvironmentCreate',