modal 0.68.0__py3-none-any.whl → 0.68.2__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/sandbox.pyi CHANGED
@@ -1,3 +1,4 @@
1
+ import _typeshed
1
2
  import collections.abc
2
3
  import google.protobuf.message
3
4
  import modal._tunnel
@@ -5,6 +6,7 @@ import modal.app
5
6
  import modal.client
6
7
  import modal.cloud_bucket_mount
7
8
  import modal.container_process
9
+ import modal.file_io
8
10
  import modal.gpu
9
11
  import modal.image
10
12
  import modal.io_streams
@@ -122,6 +124,10 @@ class _Sandbox(modal.object._Object):
122
124
  bufsize: typing.Literal[-1, 1] = -1,
123
125
  _pty_info: typing.Optional[modal_proto.api_pb2.PTYInfo] = None,
124
126
  ) -> modal.container_process._ContainerProcess[bytes]: ...
127
+ @typing.overload
128
+ async def open(self, path: str, mode: _typeshed.OpenTextMode) -> modal.file_io._FileIO[str]: ...
129
+ @typing.overload
130
+ async def open(self, path: str, mode: _typeshed.OpenBinaryMode) -> modal.file_io._FileIO[bytes]: ...
125
131
  @property
126
132
  def stdout(self) -> modal.io_streams._StreamReader[str]: ...
127
133
  @property
@@ -349,6 +355,18 @@ class Sandbox(modal.object.Object):
349
355
 
350
356
  exec: __exec_spec
351
357
 
358
+ class __open_spec(typing_extensions.Protocol):
359
+ @typing.overload
360
+ def __call__(self, path: str, mode: _typeshed.OpenTextMode) -> modal.file_io.FileIO[str]: ...
361
+ @typing.overload
362
+ def __call__(self, path: str, mode: _typeshed.OpenBinaryMode) -> modal.file_io.FileIO[bytes]: ...
363
+ @typing.overload
364
+ async def aio(self, path: str, mode: _typeshed.OpenTextMode) -> modal.file_io.FileIO[str]: ...
365
+ @typing.overload
366
+ async def aio(self, path: str, mode: _typeshed.OpenBinaryMode) -> modal.file_io.FileIO[bytes]: ...
367
+
368
+ open: __open_spec
369
+
352
370
  @property
353
371
  def stdout(self) -> modal.io_streams.StreamReader[str]: ...
354
372
  @property
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: modal
3
- Version: 0.68.0
3
+ Version: 0.68.2
4
4
  Summary: Python client library for Modal
5
5
  Author: Modal Labs
6
6
  Author-email: support@modal.com
@@ -21,7 +21,7 @@ Requires-Dist: fastapi
21
21
  Requires-Dist: grpclib (==0.4.7)
22
22
  Requires-Dist: protobuf (!=4.24.0,<6.0,>=3.19)
23
23
  Requires-Dist: rich (>=12.0.0)
24
- Requires-Dist: synchronicity (~=0.9.4)
24
+ Requires-Dist: synchronicity (~=0.9.6)
25
25
  Requires-Dist: toml
26
26
  Requires-Dist: typer (>=0.9)
27
27
  Requires-Dist: types-certifi
@@ -19,7 +19,7 @@ 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=uy1Lw3hipt9ILv19VdmBBGYIW7VHmr4rzXi7pO7Kg7s,15791
22
- modal/client.pyi,sha256=RdtGO0h2wX6teBDdQhqA9B8JV77fDxOzHARozUTQF6I,7352
22
+ modal/client.pyi,sha256=HARg2kCIdOYmjEulbyyZJAN3F01iJPF8IiBZbqlcEFk,7352
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=pMirIOmb59YzaIK2rn7Vd756E1QKDDweYT90GYIHiMk,27472
@@ -31,10 +31,12 @@ modal/dict.py,sha256=RmJlEwFJOdSfAYcVa50hbbFccV8e7BvC5tc5g1HXF-c,12622
31
31
  modal/dict.pyi,sha256=2cYgOqBxYZih4BYgMV0c3rNPuxYR6-cB1GBXzFkHA5c,7265
32
32
  modal/environments.py,sha256=5cgA-zbm6ngKLsRA19zSOgtgo9-BarJK3FJK0BiF2Lo,6505
33
33
  modal/environments.pyi,sha256=XalNpiPkAtHWAvOU2Cotq0ozmtl-Jv0FDsR8h9mr27Q,3521
34
- modal/exception.py,sha256=eSQZ0u1z-RPMW9x6AGMySi-LWyqkTtjZM-RnvhyfWWQ,6997
34
+ modal/exception.py,sha256=dRK789TD1HaB63kHhu1yZuvS2vP_Vua3iLMBtA6dgqk,7128
35
35
  modal/experimental.py,sha256=jFuNbwrNHos47viMB9q-cHJSvf2RDxDdoEcss9plaZE,2302
36
+ modal/file_io.py,sha256=q8s872qf6Ntdw7dPogDlpYbixxGkwCA0BlQn2UUoVhY,14637
37
+ modal/file_io.pyi,sha256=pfkmJiaBpMCZReE6-KCjYOzB1dVtyYDYokJoYX8ARK4,6932
36
38
  modal/functions.py,sha256=Z2g1CuDTz_491ReOJKs66qGlodPDpKAiKHVwARL2zYA,66792
37
- modal/functions.pyi,sha256=4k5CaJ9iTuEyHQ2rC5OysNHBLv1CZrD7zBMU1zXIU4w,24988
39
+ modal/functions.pyi,sha256=IyuM9TV79JfrtfTaJ4yq3EcWp3yHuxLavpxTOwSWEDw,24988
38
40
  modal/gpu.py,sha256=r4rL6uH3UJIQthzYvfWauXNyh01WqCPtKZCmmSX1fd4,6881
39
41
  modal/image.py,sha256=cQ6WP1xHXZT_nY8z3aEFiGwKzrTV0yxi3Ab8JzF91eo,79653
40
42
  modal/image.pyi,sha256=PIKH6JBA4L5TfdJrQu3pm2ykyIITmiP920TpP8cdyQA,24585
@@ -60,8 +62,8 @@ modal/retries.py,sha256=HKR2Q9aNPWkMjQ5nwobqYTuZaSuw0a8lI2zrtY5IW98,5230
60
62
  modal/runner.py,sha256=Q02VdfLCO7YKpnOSqqh58XL3hR2XHaDeiJVYW3MKz_8,24580
61
63
  modal/runner.pyi,sha256=BvMS1ZVzWSn8B8q0KnIZOJKPkN5L-i5b-USbV6SWWHQ,5177
62
64
  modal/running_app.py,sha256=CshNvGDJtagOdKW54uYjY8HY73j2TpnsL9jkPFZAsfA,560
63
- modal/sandbox.py,sha256=Yd__KipEINH2euDPOcm5MPBnagRv19Sa5z5tJCvGOQs,26360
64
- modal/sandbox.pyi,sha256=fRl32Pt5F6TbK7aYewjlcL4WQxxmp7m6Ybktmkd2VOk,18108
65
+ modal/sandbox.py,sha256=abmprnPtA-WVsHKu4J1deoltpAUvXtIHQHX-ZpYjYPE,27293
66
+ modal/sandbox.pyi,sha256=QPNuiTLNoKwYf8JK_fmfUBXpdGYlukyaksFV1DpCd2g,18987
65
67
  modal/schedule.py,sha256=0ZFpKs1bOxeo5n3HZjoL7OE2ktsb-_oGtq-WJEPO4tY,2615
66
68
  modal/scheduler_placement.py,sha256=BAREdOY5HzHpzSBqt6jDVR6YC_jYfHMVqOzkyqQfngU,1235
67
69
  modal/secret.py,sha256=Y1WgybQIkfkxdzH9CQ1h-Wd1DJJpzipigMhyyvSxTww,10007
@@ -131,7 +133,7 @@ modal/requirements/README.md,sha256=9tK76KP0Uph7O0M5oUgsSwEZDj5y-dcUPsnpR0Sc-Ik,
131
133
  modal/requirements/base-images.json,sha256=kLNo5Sqmnhp9H6Hr9IcaGJFrRaRg1yfuepUWkm-y8iQ,571
132
134
  modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
133
135
  modal_docs/gen_cli_docs.py,sha256=c1yfBS_x--gL5bs0N4ihMwqwX8l3IBWSkBAKNNIi6bQ,3801
134
- modal_docs/gen_reference_docs.py,sha256=AI8h-JKfwn7Tohm3P3D5G0SivSpdGgN6gnw-fED-S0s,6613
136
+ modal_docs/gen_reference_docs.py,sha256=aDcUSSDtAAZ4eeFWyroeIg2TOzyRoYcic-d9Zh9TdLY,6656
135
137
  modal_docs/mdmd/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
136
138
  modal_docs/mdmd/mdmd.py,sha256=F6EXKkjwrTbOiG6I7wKtNGVVmmeWLAJ5pnE7DUkDpvM,6231
137
139
  modal_docs/mdmd/signatures.py,sha256=XJaZrK7Mdepk5fdX51A8uENiLFNil85Ud0d4MH8H5f0,3218
@@ -142,10 +144,10 @@ modal_global_objects/mounts/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0
142
144
  modal_global_objects/mounts/modal_client_package.py,sha256=W0E_yShsRojPzWm6LtIQqNVolapdnrZkm2hVEQuZK_4,767
143
145
  modal_global_objects/mounts/python_standalone.py,sha256=SL_riIxpd8mP4i4CLDCWiFFNj0Ltknm9c_UIGfX5d60,1836
144
146
  modal_proto/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0VESpjWR0fc,28
145
- modal_proto/api.proto,sha256=B0FedF8MXOVp1O9yPgjHU8QzFP0aeONN3WvhCaYaMO8,78738
147
+ modal_proto/api.proto,sha256=LDL_Y59tvHAvX50HOXTr2NqQ2TohFiO6Fi05G9_RkC0,79106
146
148
  modal_proto/api_grpc.py,sha256=DveC4ejFYEhCLiWbQShnmY31_FWGYU675Bmr7nHhsgs,101342
147
- modal_proto/api_pb2.py,sha256=YE26HpQSPu6x6hs5S58PeER2FEESNBMu2Ka6ieCjxpk,287062
148
- modal_proto/api_pb2.pyi,sha256=wk_QhoXo1v3S1Tmukt1M8SiH9vfq8TBp9uqb7WUAm68,383922
149
+ modal_proto/api_pb2.py,sha256=lTl_nGWDFgLkvvRiTbpQQhNgj3vvrMc31miwZ0BtLf4,289195
150
+ modal_proto/api_pb2.pyi,sha256=MG8arF8Z48_hXLON0L0T0ZDv9joW855lsTLaEoviBOY,386425
149
151
  modal_proto/api_pb2_grpc.py,sha256=2PEP6JPOoTw2rDC5qYjLNuumP68ZwAouRhCoayisAhY,219162
150
152
  modal_proto/api_pb2_grpc.pyi,sha256=uWtCxVEd0cFpOZ1oOGfZNO7Dv45OP4kp09jMnNyx9D4,51098
151
153
  modal_proto/modal_api_grpc.py,sha256=-8mLby_om5MYo6yu1zA_hqhz0yLsQW7k2YWBVZW1iVs,13546
@@ -159,10 +161,10 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
159
161
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
160
162
  modal_version/__init__.py,sha256=RT6zPoOdFO99u5Wcxxaoir4ZCuPTbQ22cvzFAXl3vUY,470
161
163
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
162
- modal_version/_version_generated.py,sha256=A2gYAoil3sMRmFcVTXZe4ZPIgKxW6sEe_EQMOEvqLkM,148
163
- modal-0.68.0.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
164
- modal-0.68.0.dist-info/METADATA,sha256=ZKusxovFok96SO9vcQlf9FMApEKaexIQLFwAlzoEagE,2328
165
- modal-0.68.0.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
166
- modal-0.68.0.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
167
- modal-0.68.0.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
168
- modal-0.68.0.dist-info/RECORD,,
164
+ modal_version/_version_generated.py,sha256=6Pvpcc5MvVX_YgJS7zOEdJe-DbGK8uv3kqiGt-OVVXE,148
165
+ modal-0.68.2.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
166
+ modal-0.68.2.dist-info/METADATA,sha256=5nS06eizxvISwpNNTho3610CO0mCCjpisIfo5STyfYY,2328
167
+ modal-0.68.2.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
168
+ modal-0.68.2.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
169
+ modal-0.68.2.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
170
+ modal-0.68.2.dist-info/RECORD,,
@@ -86,6 +86,7 @@ def run(output_dir: str = None):
86
86
  ("modal.Sandbox", "modal.sandbox"),
87
87
  ("modal.ContainerProcess", "modal.container_process"),
88
88
  ("modal.io_streams", "modal.io_streams"),
89
+ ("modal.FileIO", "modal.file_io"),
89
90
  ]
90
91
  # These aren't defined in `modal`, but should still be documented as top-level entries.
91
92
  forced_members = {"web_endpoint", "asgi_app", "method", "wsgi_app", "forward"}
modal_proto/api.proto CHANGED
@@ -771,6 +771,15 @@ message ContainerFileFlushRequest {
771
771
  string file_descriptor = 1;
772
772
  }
773
773
 
774
+ message ContainerFileLsRequest {
775
+ string path = 1;
776
+ }
777
+
778
+ message ContainerFileMkdirRequest {
779
+ string path = 1;
780
+ bool make_parents = 2;
781
+ }
782
+
774
783
  message ContainerFileOpenRequest {
775
784
  // file descriptor is hydrated when sent from server -> worker
776
785
  optional string file_descriptor = 1;
@@ -787,6 +796,11 @@ message ContainerFileReadRequest {
787
796
  optional uint32 n = 2;
788
797
  }
789
798
 
799
+ message ContainerFileRmRequest {
800
+ string path = 1;
801
+ bool recursive = 2;
802
+ }
803
+
790
804
  message ContainerFileSeekRequest {
791
805
  string file_descriptor = 1;
792
806
  int32 offset = 2;
@@ -821,6 +835,9 @@ message ContainerFilesystemExecRequest {
821
835
  ContainerFileDeleteBytesRequest file_delete_bytes_request = 7;
822
836
  ContainerFileWriteReplaceBytesRequest file_write_replace_bytes_request = 8;
823
837
  ContainerFileCloseRequest file_close_request = 9;
838
+ ContainerFileLsRequest file_ls_request = 11;
839
+ ContainerFileMkdirRequest file_mkdir_request = 12;
840
+ ContainerFileRmRequest file_rm_request = 13;
824
841
  }
825
842
  string task_id = 10;
826
843
  }