Skip to content

Commit

Permalink
Fully type docker/api/build (python#11789)
Browse files Browse the repository at this point in the history
  • Loading branch information
kasium authored Apr 23, 2024
1 parent 7858e60 commit 312dfe5
Showing 1 changed file with 38 additions and 22 deletions.
60 changes: 38 additions & 22 deletions stubs/docker/docker/api/build.pyi
Original file line number Diff line number Diff line change
@@ -1,39 +1,55 @@
from _typeshed import Incomplete
from collections.abc import Generator
from io import StringIO
from logging import Logger
from typing import IO, Any, TypedDict, type_check_only

log: Incomplete
log: Logger

@type_check_only
class _ContainerLimits(TypedDict, total=False):
memory: int
memswap: int
cpushares: int
cpusetcpus: str

@type_check_only
class _Filers(TypedDict, total=False):
dangling: bool
until: str

class BuildApiMixin:
def build(
self,
path: Incomplete | None = None,
path: str | None = None,
tag: str | None = None,
quiet: bool = False,
fileobj: Incomplete | None = None,
fileobj: StringIO | IO[bytes] | None = None,
nocache: bool = False,
rm: bool = False,
timeout: Incomplete | None = None,
timeout: int | None = None,
custom_context: bool = False,
encoding: Incomplete | None = None,
encoding: str | None = None,
pull: bool = False,
forcerm: bool = False,
dockerfile: Incomplete | None = None,
container_limits: Incomplete | None = None,
dockerfile: str | None = None,
container_limits: _ContainerLimits | None = None,
decode: bool = False,
buildargs: Incomplete | None = None,
buildargs: dict[str, Any] | None = None,
gzip: bool = False,
shmsize: Incomplete | None = None,
labels: Incomplete | None = None,
cache_from: Incomplete | None = None,
target: Incomplete | None = None,
network_mode: Incomplete | None = None,
squash: Incomplete | None = None,
extra_hosts: Incomplete | None = None,
platform: Incomplete | None = None,
isolation: Incomplete | None = None,
shmsize: int | None = None,
labels: dict[str, Any] | None = None,
# need to use list, because the type must be json serializable
cache_from: list[str] | None = None,
target: str | None = None,
network_mode: str | None = None,
squash: bool | None = None,
extra_hosts: list[str] | dict[str, str] | None = None,
platform: str | None = None,
isolation: str | None = None,
use_config_proxy: bool = True,
): ...
) -> Generator[Any, None, None]: ...
def prune_builds(
self, filters: Incomplete | None = None, keep_storage: Incomplete | None = None, all: Incomplete | None = None
): ...
self, filters: _Filers | None = None, keep_storage: int | None = None, all: bool | None = None
) -> dict[str, Any]: ...

def process_dockerfile(dockerfile, path): ...
def process_dockerfile(dockerfile: str | None, path: str) -> tuple[str | None, str | None]: ...

0 comments on commit 312dfe5

Please sign in to comment.