Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions stubs/docker/docker/api/daemon.pyi
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
from _typeshed import Incomplete
from datetime import datetime
from typing import Any
from typing import Any, Literal, overload

from docker.types.daemon import CancellableStream

class DaemonApiMixin:
def df(self) -> dict[str, Any]: ...
@overload
def events(
self,
since: datetime | int | None = None,
until: datetime | int | None = None,
filters: dict[str, Any] | None = None,
decode: bool | None = None,
) -> CancellableStream[Incomplete]: ...
decode: Literal[False] | None = None,
) -> CancellableStream[str]: ...
@overload
def events(
self,
since: datetime | int | None = None,
until: datetime | int | None = None,
filters: dict[str, Any] | None = None,
decode: Literal[True] = ...,
) -> CancellableStream[dict[str, Any]]: ...
def info(self) -> dict[str, Any]: ...
def login(
self,
Expand Down
20 changes: 12 additions & 8 deletions stubs/docker/docker/client.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from collections.abc import Iterable
from typing import NoReturn, Protocol, type_check_only
from typing import Any, Literal, NoReturn, Protocol, overload, type_check_only

from docker import APIClient
from docker.models.configs import ConfigCollection
Expand All @@ -12,6 +12,7 @@ from docker.models.secrets import SecretCollection
from docker.models.services import ServiceCollection
from docker.models.swarm import Swarm
from docker.models.volumes import VolumeCollection
from docker.types import CancellableStream

@type_check_only
class _Environ(Protocol):
Expand Down Expand Up @@ -51,13 +52,16 @@ class DockerClient:
def swarm(self) -> Swarm: ...
@property
def volumes(self) -> VolumeCollection: ...
def events(self, *args, **kwargs): ...
def df(self): ...
def info(self, *args, **kwargs): ...
def login(self, *args, **kwargs): ...
def ping(self, *args, **kwargs): ...
def version(self, *args, **kwargs): ...
def close(self): ...
@overload
def events(self, *args, decode: Literal[False] | None = None, **kwargs) -> CancellableStream[str]: ...
@overload
def events(self, *args, decode: Literal[True] = ..., **kwargs) -> CancellableStream[dict[str, Any]]: ...
def df(self) -> dict[str, Any]: ...
def info(self, *args, **kwargs) -> dict[str, Any]: ...
def login(self, *args, **kwargs) -> dict[str, Any]: ...
def ping(self, *args, **kwargs) -> bool: ...
def version(self, *args, **kwargs) -> dict[str, Any]: ...
def close(self) -> None: ...
def __getattr__(self, name: str) -> NoReturn: ...

from_env = DockerClient.from_env