forked from python/typeshed
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fully type docker/api/build (python#11789)
- Loading branch information
Showing
1 changed file
with
38 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]: ... |