Skip to content

Commit a4c4076

Browse files
Add types to all "container" parameters in docker.api.container (#11908)
1 parent 96697a8 commit a4c4076

File tree

1 file changed

+30
-22
lines changed

1 file changed

+30
-22
lines changed

stubs/docker/docker/api/container.pyi

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,18 @@ _Container: TypeAlias = _HasId | _HasID | str
1717

1818
class ContainerApiMixin:
1919
def attach(
20-
self, container, stdout: bool = True, stderr: bool = True, stream: bool = False, logs: bool = False, demux: bool = False
20+
self,
21+
container: _Container,
22+
stdout: bool = True,
23+
stderr: bool = True,
24+
stream: bool = False,
25+
logs: bool = False,
26+
demux: bool = False,
2127
): ...
22-
def attach_socket(self, container, params: Incomplete | None = None, ws: bool = False): ...
28+
def attach_socket(self, container: _Container, params: Incomplete | None = None, ws: bool = False): ...
2329
def commit(
2430
self,
25-
container,
31+
container: _Container,
2632
repository: str | None = None,
2733
tag: str | None = None,
2834
message: Incomplete | None = None,
@@ -76,11 +82,11 @@ class ContainerApiMixin:
7682
def create_host_config(self, *args, **kwargs): ...
7783
def create_networking_config(self, *args, **kwargs): ...
7884
def create_endpoint_config(self, *args, **kwargs): ...
79-
def diff(self, container): ...
80-
def export(self, container, chunk_size=2097152): ...
81-
def get_archive(self, container, path, chunk_size=2097152, encode_stream: bool = False): ...
82-
def inspect_container(self, container): ...
83-
def kill(self, container, signal: Incomplete | None = None) -> None: ...
85+
def diff(self, container: _Container): ...
86+
def export(self, container: _Container, chunk_size=2097152): ...
87+
def get_archive(self, container: _Container, path, chunk_size=2097152, encode_stream: bool = False): ...
88+
def inspect_container(self, container: _Container): ...
89+
def kill(self, container: _Container, signal: Incomplete | None = None) -> None: ...
8490
@overload
8591
def logs(
8692
self,
@@ -121,22 +127,24 @@ class ContainerApiMixin:
121127
follow: bool | None = None,
122128
until: datetime.datetime | float | None = None,
123129
) -> bytes: ...
124-
def pause(self, container) -> None: ...
125-
def port(self, container, private_port): ...
126-
def put_archive(self, container, path, data): ...
130+
def pause(self, container: _Container) -> None: ...
131+
def port(self, container: _Container, private_port): ...
132+
def put_archive(self, container: _Container, path, data): ...
127133
def prune_containers(self, filters: Incomplete | None = None): ...
128-
def remove_container(self, container, v: bool = False, link: bool = False, force: bool = False) -> None: ...
129-
def rename(self, container, name) -> None: ...
130-
def resize(self, container, height, width) -> None: ...
131-
def restart(self, container, timeout: int = 10) -> None: ...
132-
def start(self, container, *args, **kwargs) -> None: ...
133-
def stats(self, container, decode: Incomplete | None = None, stream: bool = True, one_shot: Incomplete | None = None): ...
134-
def stop(self, container, timeout: Incomplete | None = None) -> None: ...
135-
def top(self, container, ps_args: Incomplete | None = None): ...
136-
def unpause(self, container) -> None: ...
134+
def remove_container(self, container: _Container, v: bool = False, link: bool = False, force: bool = False) -> None: ...
135+
def rename(self, container: _Container, name) -> None: ...
136+
def resize(self, container: _Container, height, width) -> None: ...
137+
def restart(self, container: _Container, timeout: int = 10) -> None: ...
138+
def start(self, container: _Container, *args, **kwargs) -> None: ...
139+
def stats(
140+
self, container: _Container, decode: Incomplete | None = None, stream: bool = True, one_shot: Incomplete | None = None
141+
): ...
142+
def stop(self, container: _Container, timeout: Incomplete | None = None) -> None: ...
143+
def top(self, container: _Container, ps_args: Incomplete | None = None): ...
144+
def unpause(self, container: _Container) -> None: ...
137145
def update_container(
138146
self,
139-
container,
147+
container: _Container,
140148
blkio_weight: Incomplete | None = None,
141149
cpu_period: Incomplete | None = None,
142150
cpu_quota: Incomplete | None = None,
@@ -149,4 +157,4 @@ class ContainerApiMixin:
149157
kernel_memory: Incomplete | None = None,
150158
restart_policy: Incomplete | None = None,
151159
): ...
152-
def wait(self, container, timeout: Incomplete | None = None, condition: Incomplete | None = None): ...
160+
def wait(self, container: _Container, timeout: Incomplete | None = None, condition: Incomplete | None = None): ...

0 commit comments

Comments
 (0)