modal 1.0.5.dev1__py3-none-any.whl → 1.0.5.dev3__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/runner.pyi CHANGED
@@ -32,7 +32,10 @@ async def _create_all_objects(
32
32
  functions: dict[str, modal._functions._Function],
33
33
  classes: dict[str, modal.cls._Cls],
34
34
  environment_name: str,
35
- ) -> None: ...
35
+ ) -> None:
36
+ """Create objects that have been defined but not created on the server."""
37
+ ...
38
+
36
39
  async def _publish_app(
37
40
  client: modal.client._Client,
38
41
  running_app: modal.running_app.RunningApp,
@@ -42,11 +45,25 @@ async def _publish_app(
42
45
  name: str = "",
43
46
  tag: str = "",
44
47
  commit_info: typing.Optional[modal_proto.api_pb2.CommitInfo] = None,
45
- ) -> tuple[str, list[modal_proto.api_pb2.Warning]]: ...
46
- async def _disconnect(client: modal.client._Client, app_id: str, reason: int, exc_str: str = "") -> None: ...
48
+ ) -> tuple[str, list[modal_proto.api_pb2.Warning]]:
49
+ """Wrapper for AppPublish RPC."""
50
+ ...
51
+
52
+ async def _disconnect(client: modal.client._Client, app_id: str, reason: int, exc_str: str = "") -> None:
53
+ """Tell the server the client has disconnected for this app. Terminates all running tasks
54
+ for ephemeral apps.
55
+ """
56
+ ...
57
+
47
58
  async def _status_based_disconnect(
48
59
  client: modal.client._Client, app_id: str, exc_info: typing.Optional[BaseException] = None
49
- ): ...
60
+ ):
61
+ """Disconnect local session of a running app, sending relevant metadata
62
+
63
+ exc_info: Exception if an exception caused the disconnect
64
+ """
65
+ ...
66
+
50
67
  def _run_app(
51
68
  app: _App,
52
69
  *,
@@ -54,23 +71,47 @@ def _run_app(
54
71
  detach: bool = False,
55
72
  environment_name: typing.Optional[str] = None,
56
73
  interactive: bool = False,
57
- ) -> typing.AsyncContextManager[_App]: ...
74
+ ) -> typing.AsyncContextManager[_App]:
75
+ """mdmd:hidden"""
76
+ ...
77
+
58
78
  async def _serve_update(
59
79
  app: _App, existing_app_id: str, is_ready: multiprocessing.synchronize.Event, environment_name: str
60
- ) -> None: ...
80
+ ) -> None:
81
+ """mdmd:hidden"""
82
+ ...
61
83
 
62
84
  class DeployResult:
85
+ """Dataclass representing the result of deploying an app."""
86
+
63
87
  app_id: str
64
88
  app_page_url: str
65
89
  app_logs_url: str
66
90
  warnings: list[str]
67
91
 
68
- def __init__(self, app_id: str, app_page_url: str, app_logs_url: str, warnings: list[str]) -> None: ...
69
- def __repr__(self): ...
70
- def __eq__(self, other): ...
71
- def __setattr__(self, name, value): ...
72
- def __delattr__(self, name): ...
73
- def __hash__(self): ...
92
+ def __init__(self, app_id: str, app_page_url: str, app_logs_url: str, warnings: list[str]) -> None:
93
+ """Initialize self. See help(type(self)) for accurate signature."""
94
+ ...
95
+
96
+ def __repr__(self):
97
+ """Return repr(self)."""
98
+ ...
99
+
100
+ def __eq__(self, other):
101
+ """Return self==value."""
102
+ ...
103
+
104
+ def __setattr__(self, name, value):
105
+ """Implement setattr(self, name, value)."""
106
+ ...
107
+
108
+ def __delattr__(self, name):
109
+ """Implement delattr(self, name)."""
110
+ ...
111
+
112
+ def __hash__(self):
113
+ """Return hash(self)."""
114
+ ...
74
115
 
75
116
  async def _deploy_app(
76
117
  app: _App,
@@ -79,10 +120,39 @@ async def _deploy_app(
79
120
  client: typing.Optional[modal.client._Client] = None,
80
121
  environment_name: typing.Optional[str] = None,
81
122
  tag: str = "",
82
- ) -> DeployResult: ...
123
+ ) -> DeployResult:
124
+ """Internal function for deploying an App.
125
+
126
+ Users should prefer the `modal deploy` CLI or the `App.deploy` method.
127
+ """
128
+ ...
129
+
83
130
  async def _interactive_shell(
84
131
  _app: _App, cmds: list[str], environment_name: str = "", pty: bool = True, **kwargs: typing.Any
85
- ) -> None: ...
132
+ ) -> None:
133
+ """Run an interactive shell (like `bash`) within the image for this app.
134
+
135
+ This is useful for online debugging and interactive exploration of the
136
+ contents of this image. If `cmd` is optionally provided, it will be run
137
+ instead of the default shell inside this image.
138
+
139
+ **Example**
140
+
141
+ ```python
142
+ import modal
143
+
144
+ app = modal.App(image=modal.Image.debian_slim().apt_install("vim"))
145
+ ```
146
+
147
+ You can now run this using
148
+
149
+ ```
150
+ modal shell script.py --cmd /bin/bash
151
+ ```
152
+
153
+ When calling programmatically, `kwargs` are passed to `Sandbox.create()`.
154
+ """
155
+ ...
86
156
 
87
157
  class __run_app_spec(typing_extensions.Protocol):
88
158
  def __call__(
@@ -94,7 +164,10 @@ class __run_app_spec(typing_extensions.Protocol):
94
164
  detach: bool = False,
95
165
  environment_name: typing.Optional[str] = None,
96
166
  interactive: bool = False,
97
- ) -> synchronicity.combined_types.AsyncAndBlockingContextManager[_App]: ...
167
+ ) -> synchronicity.combined_types.AsyncAndBlockingContextManager[_App]:
168
+ """mdmd:hidden"""
169
+ ...
170
+
98
171
  def aio(
99
172
  self,
100
173
  /,
@@ -104,17 +177,24 @@ class __run_app_spec(typing_extensions.Protocol):
104
177
  detach: bool = False,
105
178
  environment_name: typing.Optional[str] = None,
106
179
  interactive: bool = False,
107
- ) -> typing.AsyncContextManager[_App]: ...
180
+ ) -> typing.AsyncContextManager[_App]:
181
+ """mdmd:hidden"""
182
+ ...
108
183
 
109
184
  run_app: __run_app_spec
110
185
 
111
186
  class __serve_update_spec(typing_extensions.Protocol):
112
187
  def __call__(
113
188
  self, /, app: _App, existing_app_id: str, is_ready: multiprocessing.synchronize.Event, environment_name: str
114
- ) -> None: ...
189
+ ) -> None:
190
+ """mdmd:hidden"""
191
+ ...
192
+
115
193
  async def aio(
116
194
  self, /, app: _App, existing_app_id: str, is_ready: multiprocessing.synchronize.Event, environment_name: str
117
- ) -> None: ...
195
+ ) -> None:
196
+ """mdmd:hidden"""
197
+ ...
118
198
 
119
199
  serve_update: __serve_update_spec
120
200
 
@@ -128,7 +208,13 @@ class __deploy_app_spec(typing_extensions.Protocol):
128
208
  client: typing.Optional[modal.client.Client] = None,
129
209
  environment_name: typing.Optional[str] = None,
130
210
  tag: str = "",
131
- ) -> DeployResult: ...
211
+ ) -> DeployResult:
212
+ """Internal function for deploying an App.
213
+
214
+ Users should prefer the `modal deploy` CLI or the `App.deploy` method.
215
+ """
216
+ ...
217
+
132
218
  async def aio(
133
219
  self,
134
220
  /,
@@ -138,16 +224,68 @@ class __deploy_app_spec(typing_extensions.Protocol):
138
224
  client: typing.Optional[modal.client.Client] = None,
139
225
  environment_name: typing.Optional[str] = None,
140
226
  tag: str = "",
141
- ) -> DeployResult: ...
227
+ ) -> DeployResult:
228
+ """Internal function for deploying an App.
229
+
230
+ Users should prefer the `modal deploy` CLI or the `App.deploy` method.
231
+ """
232
+ ...
142
233
 
143
234
  deploy_app: __deploy_app_spec
144
235
 
145
236
  class __interactive_shell_spec(typing_extensions.Protocol):
146
237
  def __call__(
147
238
  self, /, _app: _App, cmds: list[str], environment_name: str = "", pty: bool = True, **kwargs: typing.Any
148
- ) -> None: ...
239
+ ) -> None:
240
+ """Run an interactive shell (like `bash`) within the image for this app.
241
+
242
+ This is useful for online debugging and interactive exploration of the
243
+ contents of this image. If `cmd` is optionally provided, it will be run
244
+ instead of the default shell inside this image.
245
+
246
+ **Example**
247
+
248
+ ```python
249
+ import modal
250
+
251
+ app = modal.App(image=modal.Image.debian_slim().apt_install("vim"))
252
+ ```
253
+
254
+ You can now run this using
255
+
256
+ ```
257
+ modal shell script.py --cmd /bin/bash
258
+ ```
259
+
260
+ When calling programmatically, `kwargs` are passed to `Sandbox.create()`.
261
+ """
262
+ ...
263
+
149
264
  async def aio(
150
265
  self, /, _app: _App, cmds: list[str], environment_name: str = "", pty: bool = True, **kwargs: typing.Any
151
- ) -> None: ...
266
+ ) -> None:
267
+ """Run an interactive shell (like `bash`) within the image for this app.
268
+
269
+ This is useful for online debugging and interactive exploration of the
270
+ contents of this image. If `cmd` is optionally provided, it will be run
271
+ instead of the default shell inside this image.
272
+
273
+ **Example**
274
+
275
+ ```python
276
+ import modal
277
+
278
+ app = modal.App(image=modal.Image.debian_slim().apt_install("vim"))
279
+ ```
280
+
281
+ You can now run this using
282
+
283
+ ```
284
+ modal shell script.py --cmd /bin/bash
285
+ ```
286
+
287
+ When calling programmatically, `kwargs` are passed to `Sandbox.create()`.
288
+ """
289
+ ...
152
290
 
153
291
  interactive_shell: __interactive_shell_spec