diff --git a/stubs/docker/docker/context/api.pyi b/stubs/docker/docker/context/api.pyi index e825b62e1c2e..350c418d3d04 100644 --- a/stubs/docker/docker/context/api.pyi +++ b/stubs/docker/docker/context/api.pyi @@ -1,9 +1,18 @@ -from _typeshed import Incomplete -from collections.abc import Mapping, Sequence +from collections.abc import Sequence +from typing import Any, Protocol, TypedDict, type_check_only from docker.context.context import Context from docker.tls import TLSConfig +@type_check_only +class _SupportsGet(Protocol): + def get(self, key: str, default: Any = ...) -> Any: ... + +@type_check_only +class _ContextKwargs(TypedDict, total=False): + base_url: str + tls: TLSConfig + class ContextAPI: DEFAULT_CONTEXT: Context @classmethod @@ -24,8 +33,8 @@ class ContextAPI: def get_current_context(cls) -> Context: ... @classmethod def kwargs_from_context( - cls, name: str | None = None, environment: Mapping[str, str | None] | None = None - ) -> dict[str, Incomplete]: ... # TODO: Use TypedDict, use SupportsGet + cls, name: str | None = None, environment: Mapping[str, str | None] | None = None # TODO: Use SupportsGet + ) -> _ContextKwargs: ... @classmethod def set_current_context(cls, name: str = "default") -> None: ... @classmethod