modal 1.0.5.dev2__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.
@@ -7,6 +7,26 @@ import typing_extensions
7
7
  T = typing.TypeVar("T")
8
8
 
9
9
  class _ContainerProcess(typing.Generic[T]):
10
+ """Abstract base class for generic types.
11
+
12
+ A generic type is typically declared by inheriting from
13
+ this class parameterized with one or more type variables.
14
+ For example, a generic mapping type might be defined as::
15
+
16
+ class Mapping(Generic[KT, VT]):
17
+ def __getitem__(self, key: KT) -> VT:
18
+ ...
19
+ # Etc.
20
+
21
+ This class can then be used as follows::
22
+
23
+ def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
24
+ try:
25
+ return mapping[key]
26
+ except KeyError:
27
+ return default
28
+ """
29
+
10
30
  _process_id: typing.Optional[str]
11
31
  _stdout: modal.io_streams._StreamReader[T]
12
32
  _stderr: modal.io_streams._StreamReader[T]
@@ -23,23 +43,67 @@ class _ContainerProcess(typing.Generic[T]):
23
43
  stderr: modal.stream_type.StreamType = modal.stream_type.StreamType.PIPE,
24
44
  text: bool = True,
25
45
  by_line: bool = False,
26
- ) -> None: ...
27
- def __repr__(self) -> str: ...
46
+ ) -> None:
47
+ """Initialize self. See help(type(self)) for accurate signature."""
48
+ ...
49
+
50
+ def __repr__(self) -> str:
51
+ """Return repr(self)."""
52
+ ...
53
+
28
54
  @property
29
- def stdout(self) -> modal.io_streams._StreamReader[T]: ...
55
+ def stdout(self) -> modal.io_streams._StreamReader[T]:
56
+ """StreamReader for the container process's stdout stream."""
57
+ ...
58
+
30
59
  @property
31
- def stderr(self) -> modal.io_streams._StreamReader[T]: ...
60
+ def stderr(self) -> modal.io_streams._StreamReader[T]:
61
+ """StreamReader for the container process's stderr stream."""
62
+ ...
63
+
32
64
  @property
33
- def stdin(self) -> modal.io_streams._StreamWriter: ...
65
+ def stdin(self) -> modal.io_streams._StreamWriter:
66
+ """StreamWriter for the container process's stdin stream."""
67
+ ...
68
+
34
69
  @property
35
70
  def returncode(self) -> int: ...
36
- async def poll(self) -> typing.Optional[int]: ...
37
- async def wait(self) -> int: ...
71
+ async def poll(self) -> typing.Optional[int]:
72
+ """Check if the container process has finished running.
73
+
74
+ Returns `None` if the process is still running, else returns the exit code.
75
+ """
76
+ ...
77
+
78
+ async def wait(self) -> int:
79
+ """Wait for the container process to finish running. Returns the exit code."""
80
+ ...
81
+
38
82
  async def attach(self): ...
39
83
 
40
84
  SUPERSELF = typing.TypeVar("SUPERSELF", covariant=True)
41
85
 
42
86
  class ContainerProcess(typing.Generic[T]):
87
+ """Abstract base class for generic types.
88
+
89
+ A generic type is typically declared by inheriting from
90
+ this class parameterized with one or more type variables.
91
+ For example, a generic mapping type might be defined as::
92
+
93
+ class Mapping(Generic[KT, VT]):
94
+ def __getitem__(self, key: KT) -> VT:
95
+ ...
96
+ # Etc.
97
+
98
+ This class can then be used as follows::
99
+
100
+ def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
101
+ try:
102
+ return mapping[key]
103
+ except KeyError:
104
+ return default
105
+ """
106
+
43
107
  _process_id: typing.Optional[str]
44
108
  _stdout: modal.io_streams.StreamReader[T]
45
109
  _stderr: modal.io_streams.StreamReader[T]
@@ -59,23 +123,48 @@ class ContainerProcess(typing.Generic[T]):
59
123
  ) -> None: ...
60
124
  def __repr__(self) -> str: ...
61
125
  @property
62
- def stdout(self) -> modal.io_streams.StreamReader[T]: ...
126
+ def stdout(self) -> modal.io_streams.StreamReader[T]:
127
+ """StreamReader for the container process's stdout stream."""
128
+ ...
129
+
63
130
  @property
64
- def stderr(self) -> modal.io_streams.StreamReader[T]: ...
131
+ def stderr(self) -> modal.io_streams.StreamReader[T]:
132
+ """StreamReader for the container process's stderr stream."""
133
+ ...
134
+
65
135
  @property
66
- def stdin(self) -> modal.io_streams.StreamWriter: ...
136
+ def stdin(self) -> modal.io_streams.StreamWriter:
137
+ """StreamWriter for the container process's stdin stream."""
138
+ ...
139
+
67
140
  @property
68
141
  def returncode(self) -> int: ...
69
142
 
70
143
  class __poll_spec(typing_extensions.Protocol[SUPERSELF]):
71
- def __call__(self, /) -> typing.Optional[int]: ...
72
- async def aio(self, /) -> typing.Optional[int]: ...
144
+ def __call__(self, /) -> typing.Optional[int]:
145
+ """Check if the container process has finished running.
146
+
147
+ Returns `None` if the process is still running, else returns the exit code.
148
+ """
149
+ ...
150
+
151
+ async def aio(self, /) -> typing.Optional[int]:
152
+ """Check if the container process has finished running.
153
+
154
+ Returns `None` if the process is still running, else returns the exit code.
155
+ """
156
+ ...
73
157
 
74
158
  poll: __poll_spec[typing_extensions.Self]
75
159
 
76
160
  class __wait_spec(typing_extensions.Protocol[SUPERSELF]):
77
- def __call__(self, /) -> int: ...
78
- async def aio(self, /) -> int: ...
161
+ def __call__(self, /) -> int:
162
+ """Wait for the container process to finish running. Returns the exit code."""
163
+ ...
164
+
165
+ async def aio(self, /) -> int:
166
+ """Wait for the container process to finish running. Returns the exit code."""
167
+ ...
79
168
 
80
169
  wait: __wait_spec[typing_extensions.Self]
81
170