11import datetime
2+ from _io import _BufferedReaderStream
23from _typeshed import Incomplete
3- from collections .abc import Iterable , Mapping
4+ from collections .abc import Iterable , Iterator , Mapping
5+ from socket import SocketIO
46from typing import Literal , NamedTuple , TypedDict , overload , type_check_only
57from typing_extensions import NotRequired
68
79from docker ._types import ContainerWeightDevice , WaitContainerResponse
10+ from docker .transport .sshconn import SSHSocket
811from docker .types import EndpointConfig
912from docker .types .containers import DeviceRequest , LogConfig , Ulimit
1013from docker .types .daemon import CancellableStream
@@ -36,10 +39,12 @@ class Container(Model):
3639 def health (self ) -> str : ...
3740 @property
3841 def ports (self ) -> dict [Incomplete , Incomplete ]: ...
39- def attach (self , ** kwargs ): ...
40- def attach_socket (self , ** kwargs ): ...
41- def commit (self , repository : str | None = None , tag : str | None = None , ** kwargs ): ...
42- def diff (self ): ...
42+ def attach (
43+ self , ** kwargs
44+ ) -> str | tuple [str | None , str | None ] | CancellableStream [str ] | CancellableStream [tuple [str | None , str | None ]]: ...
45+ def attach_socket (self , ** kwargs ) -> SocketIO | _BufferedReaderStream | SSHSocket : ...
46+ def commit (self , repository : str | None = None , tag : str | None = None , ** kwargs ) -> Image : ...
47+ def diff (self ) -> list [dict [str , Incomplete ]]: ...
4348 def exec_run (
4449 self ,
4550 cmd : str | list [str ],
@@ -52,15 +57,15 @@ class Container(Model):
5257 detach : bool = False ,
5358 stream : bool = False ,
5459 socket : bool = False ,
55- environment = None ,
56- workdir = None ,
60+ environment : dict [ str , str ] | list [ str ] | None = None ,
61+ workdir : str | None = None ,
5762 demux : bool = False ,
5863 ) -> ExecResult : ...
5964 def export (self , chunk_size : int | None = 2097152 ) -> str : ...
6065 def get_archive (
6166 self , path : str , chunk_size : int | None = 2097152 , encode_stream : bool = False
6267 ) -> tuple [Incomplete , Incomplete ]: ...
63- def kill (self , signal = None ): ...
68+ def kill (self , signal : str | int | None = None ) -> None : ...
6469 @overload
6570 def logs (
6671 self ,
@@ -90,14 +95,14 @@ class Container(Model):
9095 def pause (self ) -> None : ...
9196 def put_archive (self , path : str , data ) -> bool : ...
9297 def remove (self , * , v : bool = False , link : bool = False , force : bool = False ) -> None : ...
93- def rename (self , name : str ): ...
94- def resize (self , height : int , width : int ): ...
95- def restart (self , * , timeout : float | None = 10 ): ...
98+ def rename (self , name : str ) -> None : ...
99+ def resize (self , height : int , width : int ) -> None : ...
100+ def restart (self , * , timeout : float | None = 10 ) -> None : ...
96101 def start (self ) -> None : ...
97- def stats (self , ** kwargs ): ...
102+ def stats (self , ** kwargs ) -> Iterator [ dict [ str , Incomplete ]] | dict [ str , Incomplete ] : ...
98103 def stop (self , * , timeout : float | None = None ) -> None : ...
99104 def top (self , * , ps_args : str | None = None ) -> _TopResult : ...
100- def unpause (self ): ...
105+ def unpause (self ) -> None : ...
101106 def update (
102107 self ,
103108 * ,
@@ -405,13 +410,13 @@ class ContainerCollection(Collection[Container]):
405410 self ,
406411 all : bool = False ,
407412 before : str | None = None ,
408- filters = None ,
413+ filters : dict [ str , Incomplete ] | None = None ,
409414 limit : int = - 1 ,
410415 since : str | None = None ,
411416 sparse : bool = False ,
412417 ignore_removed : bool = False ,
413- ): ...
414- def prune (self , filters = None ): ...
418+ ) -> list [ Container ] : ...
419+ def prune (self , filters : dict [ str , Incomplete ] | None = None ) -> dict [ str , Incomplete ] : ...
415420
416421RUN_CREATE_KWARGS : list [str ]
417422RUN_HOST_CONFIG_KWARGS : list [str ]
0 commit comments