modal 0.74.36__py3-none-any.whl → 0.74.37__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/_object.py +1 -0
- modal/client.pyi +2 -2
- modal/sandbox.py +24 -7
- {modal-0.74.36.dist-info → modal-0.74.37.dist-info}/METADATA +1 -1
- {modal-0.74.36.dist-info → modal-0.74.37.dist-info}/RECORD +10 -10
- modal_version/_version_generated.py +1 -1
- {modal-0.74.36.dist-info → modal-0.74.37.dist-info}/WHEEL +0 -0
- {modal-0.74.36.dist-info → modal-0.74.37.dist-info}/entry_points.txt +0 -0
- {modal-0.74.36.dist-info → modal-0.74.37.dist-info}/licenses/LICENSE +0 -0
- {modal-0.74.36.dist-info → modal-0.74.37.dist-info}/top_level.txt +0 -0
modal/_object.py
CHANGED
modal/client.pyi
CHANGED
@@ -27,7 +27,7 @@ class _Client:
|
|
27
27
|
_snapshotted: bool
|
28
28
|
|
29
29
|
def __init__(
|
30
|
-
self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.74.
|
30
|
+
self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.74.37"
|
31
31
|
): ...
|
32
32
|
def is_closed(self) -> bool: ...
|
33
33
|
@property
|
@@ -85,7 +85,7 @@ class Client:
|
|
85
85
|
_snapshotted: bool
|
86
86
|
|
87
87
|
def __init__(
|
88
|
-
self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.74.
|
88
|
+
self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.74.37"
|
89
89
|
): ...
|
90
90
|
def is_closed(self) -> bool: ...
|
91
91
|
@property
|
modal/sandbox.py
CHANGED
@@ -253,6 +253,18 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
253
253
|
] = None, # Experimental controls over fine-grained scheduling (alpha).
|
254
254
|
client: Optional[_Client] = None,
|
255
255
|
) -> "_Sandbox":
|
256
|
+
"""
|
257
|
+
Create a new Sandbox to run untrusted, arbitrary code.
|
258
|
+
|
259
|
+
**Usage**
|
260
|
+
|
261
|
+
```python
|
262
|
+
app = modal.App.lookup('sandbox-hello-world', create_if_missing=True)
|
263
|
+
sandbox = modal.Sandbox.create("echo", "hello world", app=app)
|
264
|
+
print(sandbox.stdout.read())
|
265
|
+
sandbox.wait()
|
266
|
+
```
|
267
|
+
"""
|
256
268
|
from .app import _App
|
257
269
|
|
258
270
|
environment_name = _get_environment_name(environment_name)
|
@@ -411,13 +423,14 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
411
423
|
break
|
412
424
|
|
413
425
|
async def tunnels(self, timeout: int = 50) -> dict[int, Tunnel]:
|
414
|
-
"""Get
|
426
|
+
"""Get Tunnel metadata for the sandbox.
|
415
427
|
|
416
428
|
Raises `SandboxTimeoutError` if the tunnels are not available after the timeout.
|
417
429
|
|
418
430
|
Returns a dictionary of `Tunnel` objects which are keyed by the container port.
|
419
431
|
|
420
|
-
NOTE: Previous to client v0.64.
|
432
|
+
NOTE: Previous to client [v0.64.153](/docs/reference/changelog#064153-2024-09-30), this
|
433
|
+
returned a list of `TunnelData` objects.
|
421
434
|
"""
|
422
435
|
|
423
436
|
if self._tunnels:
|
@@ -659,6 +672,10 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
659
672
|
recursive: Optional[bool] = None,
|
660
673
|
timeout: Optional[int] = None,
|
661
674
|
) -> AsyncIterator[FileWatchEvent]:
|
675
|
+
"""Watch a file or directory in the Sandbox for changes.
|
676
|
+
|
677
|
+
See the [guide](/docs/guide/sandbox-files#file-watching) for usage information.
|
678
|
+
"""
|
662
679
|
task_id = await self._get_task_id()
|
663
680
|
async for event in _FileIO.watch(path, self._client, task_id, filter, recursive, timeout):
|
664
681
|
yield event
|
@@ -675,7 +692,7 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
675
692
|
@property
|
676
693
|
def stderr(self) -> _StreamReader[str]:
|
677
694
|
"""[`StreamReader`](/docs/reference/modal.io_streams#modalio_streamsstreamreader) for
|
678
|
-
the
|
695
|
+
the Sandbox's stderr stream.
|
679
696
|
"""
|
680
697
|
|
681
698
|
return self._stderr
|
@@ -684,14 +701,14 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
684
701
|
def stdin(self) -> _StreamWriter:
|
685
702
|
"""
|
686
703
|
[`StreamWriter`](/docs/reference/modal.io_streams#modalio_streamsstreamwriter) for
|
687
|
-
the
|
704
|
+
the Sandbox's stdin stream.
|
688
705
|
"""
|
689
706
|
|
690
707
|
return self._stdin
|
691
708
|
|
692
709
|
@property
|
693
710
|
def returncode(self) -> Optional[int]:
|
694
|
-
"""Return code of the
|
711
|
+
"""Return code of the Sandbox process if it has finished running, else `None`."""
|
695
712
|
|
696
713
|
if self._result is None:
|
697
714
|
return None
|
@@ -708,8 +725,8 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
708
725
|
async def list(
|
709
726
|
*, app_id: Optional[str] = None, tags: Optional[dict[str, str]] = None, client: Optional[_Client] = None
|
710
727
|
) -> AsyncGenerator["_Sandbox", None]:
|
711
|
-
"""List all
|
712
|
-
|
728
|
+
"""List all Sandboxes for the current Environment or App ID (if specified). If tags are specified, only
|
729
|
+
Sandboxes that have at least those tags are returned. Returns an iterator over `Sandbox` objects."""
|
713
730
|
before_timestamp = None
|
714
731
|
environment_name = _get_environment_name()
|
715
732
|
if client is None:
|
@@ -6,7 +6,7 @@ modal/_container_entrypoint.py,sha256=DymOImhc3uGRkIq_qXmBsEbWMB4EBMpfuXzz2S4BcG
|
|
6
6
|
modal/_functions.py,sha256=R6L5cWIy2Lls6O6_taAIalUCigXwm1VU5Kb98Qffxr0,74233
|
7
7
|
modal/_ipython.py,sha256=TW1fkVOmZL3YYqdS2YlM1hqpf654Yf8ZyybHdBnlhSw,301
|
8
8
|
modal/_location.py,sha256=joiX-0ZeutEUDTrrqLF1GHXCdVLF-rHzstocbMcd_-k,366
|
9
|
-
modal/_object.py,sha256=
|
9
|
+
modal/_object.py,sha256=6ve4sI2nRAnjPCuAXdSoUplaXfzC9MqRlF_ZLULwwy0,11472
|
10
10
|
modal/_output.py,sha256=Z0nngPh2mKHMQc4MQ92YjVPc3ewOLa3I4dFBlL9nvQY,25656
|
11
11
|
modal/_partial_function.py,sha256=pdMPMjZYBiOm037U1W-97Omw7NZ3nNyRUHAXpdTK7M4,39704
|
12
12
|
modal/_pty.py,sha256=JZfPDDpzqICZqtyPI_oMJf_9w-p_lLNuzHhwhodUXio,1329
|
@@ -22,7 +22,7 @@ modal/app.py,sha256=r-9vVU1lrR1CWtJEo60fuaianvxY_oOXZyv1Qx1DEkI,51231
|
|
22
22
|
modal/app.pyi,sha256=0QNtnUpAFbOPcbwCt119ge7OmoBqMFw5SajLgdE5eOw,28600
|
23
23
|
modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
|
24
24
|
modal/client.py,sha256=U-YKSw0n7J1ZLREt9cbEJCtmHe5YoPKFxl0xlkan2yc,15565
|
25
|
-
modal/client.pyi,sha256=
|
25
|
+
modal/client.pyi,sha256=j0VOKvtzC3x7NfhC6dEoqHLaP9qUAYFhyMYEIf858pA,7593
|
26
26
|
modal/cloud_bucket_mount.py,sha256=YOe9nnvSr4ZbeCn587d7_VhE9IioZYRvF9VYQTQux08,5914
|
27
27
|
modal/cloud_bucket_mount.pyi,sha256=30T3K1a89l6wzmEJ_J9iWv9SknoGqaZDx59Xs-ZQcmk,1607
|
28
28
|
modal/cls.py,sha256=pfEKqzNldQbtoM45CApRhSd8jJ7hD6o-83SLX8DTXXk,33549
|
@@ -65,7 +65,7 @@ modal/retries.py,sha256=IvNLDM0f_GLUDD5VgEDoN09C88yoxSrCquinAuxT1Sc,5205
|
|
65
65
|
modal/runner.py,sha256=yK1mBkX1_ZKvvWLoe1e2mGehJSWs97Mpyglo9Oj5rQw,24783
|
66
66
|
modal/runner.pyi,sha256=HW2pvC_PLwg1Es_EkrfQgMZsktIr9zzVEtmjOVFG6Dw,5351
|
67
67
|
modal/running_app.py,sha256=v61mapYNV1-O-Uaho5EfJlryMLvIT9We0amUOSvSGx8,1188
|
68
|
-
modal/sandbox.py,sha256=
|
68
|
+
modal/sandbox.py,sha256=aLW1hCMrk9ndfXaWjDcknS0U-ei-GhUpSjo-pURrnW8,32722
|
69
69
|
modal/sandbox.pyi,sha256=cLmSwI1ab-2DgEuXNf6S1PiK63wfUR9dHtxlZtSOuX8,22719
|
70
70
|
modal/schedule.py,sha256=ewa7hb9NKYnoeSCW2PujZAbGGJL8btX6X3KalCFpc_M,2626
|
71
71
|
modal/scheduler_placement.py,sha256=BAREdOY5HzHpzSBqt6jDVR6YC_jYfHMVqOzkyqQfngU,1235
|
@@ -145,7 +145,7 @@ modal/requirements/2024.10.txt,sha256=qD-5cVIVM9wXesJ6JC89Ew-3m2KjEElUz3jaw_MddR
|
|
145
145
|
modal/requirements/PREVIEW.txt,sha256=qD-5cVIVM9wXesJ6JC89Ew-3m2KjEElUz3jaw_MddRo,296
|
146
146
|
modal/requirements/README.md,sha256=9tK76KP0Uph7O0M5oUgsSwEZDj5y-dcUPsnpR0Sc-Ik,854
|
147
147
|
modal/requirements/base-images.json,sha256=57vMSqzMbLBxw5tFWSaMiIkkVEps4JfX5PAtXGnkS4U,740
|
148
|
-
modal-0.74.
|
148
|
+
modal-0.74.37.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
|
149
149
|
modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
|
150
150
|
modal_docs/gen_cli_docs.py,sha256=c1yfBS_x--gL5bs0N4ihMwqwX8l3IBWSkBAKNNIi6bQ,3801
|
151
151
|
modal_docs/gen_reference_docs.py,sha256=d_CQUGQ0rfw28u75I2mov9AlS773z9rG40-yq5o7g2U,6359
|
@@ -170,9 +170,9 @@ 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=m94xZNWIjH8oUtJk4l9xfovzDJede2o7X-q0MHVECtM,470
|
172
172
|
modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
|
173
|
-
modal_version/_version_generated.py,sha256=
|
174
|
-
modal-0.74.
|
175
|
-
modal-0.74.
|
176
|
-
modal-0.74.
|
177
|
-
modal-0.74.
|
178
|
-
modal-0.74.
|
173
|
+
modal_version/_version_generated.py,sha256=PB-gH-R4770NE3ZBydLXbZYx8iv_QtT64ZmTRVd_-CE,149
|
174
|
+
modal-0.74.37.dist-info/METADATA,sha256=jIMdBqVoCP7nT6ibdeqo9giPWFaBD_ysv1hoAlpM2VI,2474
|
175
|
+
modal-0.74.37.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
176
|
+
modal-0.74.37.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
|
177
|
+
modal-0.74.37.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
|
178
|
+
modal-0.74.37.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|