diff --git a/stubs/docker/docker/api/container.pyi b/stubs/docker/docker/api/container.pyi index 06a6167c8920..d2a58261853f 100644 --- a/stubs/docker/docker/api/container.pyi +++ b/stubs/docker/docker/api/container.pyi @@ -1,6 +1,6 @@ import datetime from _typeshed import Incomplete -from typing import Literal, TypedDict, overload, type_check_only +from typing import Any, Literal, TypedDict, overload, type_check_only from typing_extensions import TypeAlias from docker._types import WaitContainerResponse @@ -61,7 +61,9 @@ class ContainerApiMixin: detach: bool = False, stdin_open: bool = False, tty: bool = False, - ports: list[int] | None = None, + # list is invariant, enumerating all possible union combination would be too complex for: + # list[str | int | tuple[int | str, str] | tuple[int | str, ...]] + ports: dict[str, dict[Incomplete, Incomplete]] | list[Any] | None = None, environment: dict[str, str] | list[str] | None = None, volumes: str | list[str] | None = None, network_disabled: bool = False, diff --git a/stubs/docker/docker/api/network.pyi b/stubs/docker/docker/api/network.pyi index fff9fdfdb8f4..7f20d8707256 100644 --- a/stubs/docker/docker/api/network.pyi +++ b/stubs/docker/docker/api/network.pyi @@ -1,4 +1,5 @@ from _typeshed import Incomplete +from collections.abc import Iterable from typing import Any, Literal, TypedDict, type_check_only from typing_extensions import TypeAlias @@ -43,7 +44,7 @@ class NetworkApiMixin: ipv4_address: Incomplete | None = None, ipv6_address: Incomplete | None = None, aliases: Incomplete | None = None, - links: Incomplete | None = None, + links: dict[str, str] | dict[str, None] | dict[str, str | None] | Iterable[tuple[str, str | None]] | None = None, link_local_ips: Incomplete | None = None, driver_opt: Incomplete | None = None, mac_address: Incomplete | None = None, diff --git a/stubs/docker/docker/models/containers.pyi b/stubs/docker/docker/models/containers.pyi index c3f787b76891..3224f5844cfd 100644 --- a/stubs/docker/docker/models/containers.pyi +++ b/stubs/docker/docker/models/containers.pyi @@ -1,5 +1,6 @@ import datetime from _typeshed import Incomplete +from collections.abc import Iterable, Mapping from typing import Literal, NamedTuple, TypedDict, overload from typing_extensions import NotRequired @@ -152,7 +153,7 @@ class ContainerCollection(Collection[Container]): entrypoint: str | list[str] | None = None, environment: dict[str, str] | list[str] | None = None, extra_hosts: dict[str, str] | None = None, - group_add: list[str | int] | None = None, + group_add: Iterable[str | int] | None = None, healthcheck: dict[Incomplete, Incomplete] | None = None, hostname: str | None = None, init: bool | None = None, @@ -161,7 +162,7 @@ class ContainerCollection(Collection[Container]): isolation: str | None = None, kernel_memory: str | int | None = None, labels: dict[str, str] | list[str] | None = None, - links: dict[str, str | None] | None = None, + links: dict[str, str] | dict[str, None] | dict[str, str | None] | Iterable[tuple[str, str | None]] | None = None, log_config: LogConfig | None = None, lxc_conf: dict[Incomplete, Incomplete] | None = None, mac_address: str | None = None, @@ -181,7 +182,7 @@ class ContainerCollection(Collection[Container]): pid_mode: str | None = None, pids_limit: int | None = None, platform: str | None = None, - ports: dict[str, int | list[int] | tuple[str, int] | None] | None = None, + ports: Mapping[str, int | list[int] | tuple[str, int] | None] | None = None, privileged: bool = False, publish_all_ports: bool = False, read_only: bool | None = None, @@ -247,7 +248,7 @@ class ContainerCollection(Collection[Container]): entrypoint: str | list[str] | None = None, environment: dict[str, str] | list[str] | None = None, extra_hosts: dict[str, str] | None = None, - group_add: list[str | int] | None = None, + group_add: Iterable[str | int] | None = None, healthcheck: dict[Incomplete, Incomplete] | None = None, hostname: str | None = None, init: bool | None = None, @@ -256,7 +257,7 @@ class ContainerCollection(Collection[Container]): isolation: str | None = None, kernel_memory: str | int | None = None, labels: dict[str, str] | list[str] | None = None, - links: dict[str, str | None] | None = None, + links: dict[str, str] | dict[str, None] | dict[str, str | None] | Iterable[tuple[str, str | None]] | None = None, log_config: LogConfig | None = None, lxc_conf: dict[Incomplete, Incomplete] | None = None, mac_address: str | None = None, @@ -276,7 +277,7 @@ class ContainerCollection(Collection[Container]): pid_mode: str | None = None, pids_limit: int | None = None, platform: str | None = None, - ports: dict[str, int | list[int] | tuple[str, int] | None] | None = None, + ports: Mapping[str, int | list[int] | tuple[str, int] | None] | None = None, privileged: bool = False, publish_all_ports: bool = False, read_only: bool | None = None, @@ -338,7 +339,7 @@ class ContainerCollection(Collection[Container]): entrypoint: str | list[str] | None = None, environment: dict[str, str] | list[str] | None = None, extra_hosts: dict[str, str] | None = None, - group_add: list[str | int] | None = None, + group_add: Iterable[str | int] | None = None, healthcheck: dict[Incomplete, Incomplete] | None = None, hostname: str | None = None, init: bool | None = None, @@ -347,7 +348,7 @@ class ContainerCollection(Collection[Container]): isolation: str | None = None, kernel_memory: str | int | None = None, labels: dict[str, str] | list[str] | None = None, - links: dict[str, str | None] | None = None, + links: dict[str, str] | dict[str, None] | dict[str, str | None] | Iterable[tuple[str, str | None]] | None = None, log_config: LogConfig | None = None, lxc_conf: dict[Incomplete, Incomplete] | None = None, mac_address: str | None = None, @@ -367,7 +368,7 @@ class ContainerCollection(Collection[Container]): pid_mode: str | None = None, pids_limit: int | None = None, platform: str | None = None, - ports: dict[str, int | list[int] | tuple[str, int] | None] | None = None, + ports: Mapping[str, int | list[int] | tuple[str, int] | None] | None = None, privileged: bool = False, publish_all_ports: bool = False, read_only: bool | None = None, diff --git a/stubs/docker/docker/types/containers.pyi b/stubs/docker/docker/types/containers.pyi index bd9fffa38d4b..a327c3479141 100644 --- a/stubs/docker/docker/types/containers.pyi +++ b/stubs/docker/docker/types/containers.pyi @@ -1,18 +1,22 @@ from _typeshed import Incomplete -from typing import Literal +from collections.abc import Iterable, Mapping +from typing import Any, Final, Literal from docker._types import ContainerWeightDevice +from .. import errors from .base import DictType +from .healthcheck import Healthcheck +from .networks import NetworkingConfig from .services import Mount class LogConfigTypesEnum: - JSON: Incomplete - SYSLOG: Incomplete - JOURNALD: Incomplete - GELF: Incomplete - FLUENTD: Incomplete - NONE: Incomplete + JSON: Final = "json-file" + SYSLOG: Final = "syslog" + JOURNALD: Final = "journald" + GELF: Final = "gelf" + FLUENTD: Final = "fluentd" + NONE: Final = "none" class LogConfig(DictType): types: type[LogConfigTypesEnum] @@ -68,21 +72,21 @@ class HostConfig(dict[str, Incomplete]): def __init__( self, version: str, - binds: Incomplete | None = None, - port_bindings: Incomplete | None = None, - lxc_conf: dict[Incomplete, Incomplete] | None = None, + binds: dict[str, Mapping[str, str]] | list[str] | None = None, + port_bindings: Mapping[int | str, Incomplete] | None = None, + lxc_conf: dict[str, Incomplete] | list[dict[str, Incomplete]] | None = None, publish_all_ports: bool = False, - links: dict[str, str | None] | None = None, + links: dict[str, str] | dict[str, None] | dict[str, str | None] | Iterable[tuple[str, str | None]] | None = None, privileged: bool = False, - dns: list[Incomplete] | None = None, - dns_search: list[Incomplete] | None = None, + dns: list[str] | None = None, + dns_search: list[str] | None = None, volumes_from: list[str] | None = None, network_mode: str | None = None, - restart_policy: dict[Incomplete, Incomplete] | None = None, + restart_policy: Mapping[str, str | int] | None = None, cap_add: list[str] | None = None, cap_drop: list[str] | None = None, devices: list[str] | None = None, - extra_hosts: dict[Incomplete, Incomplete] | None = None, + extra_hosts: dict[str, Incomplete] | list[Incomplete] | None = None, read_only: bool | None = None, pid_mode: str | None = None, ipc_mode: str | None = None, @@ -95,18 +99,18 @@ class HostConfig(dict[str, Incomplete]): kernel_memory: str | int | None = None, mem_swappiness: int | None = None, cgroup_parent: str | None = None, - group_add: list[str | int] | None = None, + group_add: Iterable[str | int] | None = None, cpu_quota: int | None = None, cpu_period: int | None = None, blkio_weight: int | None = None, blkio_weight_device: list[ContainerWeightDevice] | None = None, - device_read_bps: Incomplete | None = None, - device_write_bps: Incomplete | None = None, - device_read_iops: Incomplete | None = None, - device_write_iops: Incomplete | None = None, + device_read_bps: list[Mapping[str, str | int]] | None = None, + device_write_bps: list[Mapping[str, str | int]] | None = None, + device_read_iops: list[Mapping[str, str | int]] | None = None, + device_write_iops: list[Mapping[str, str | int]] | None = None, oom_kill_disable: bool = False, shm_size: str | int | None = None, - sysctls: dict[Incomplete, Incomplete] | None = None, + sysctls: dict[str, str] | None = None, tmpfs: dict[str, str] | None = None, oom_score_adj: int | None = None, dns_opt: list[Incomplete] | None = None, @@ -134,35 +138,37 @@ class HostConfig(dict[str, Incomplete]): cgroupns: Literal["private", "host"] | None = None, ) -> None: ... -def host_config_type_error(param, param_value, expected): ... -def host_config_version_error(param, version, less_than: bool = True): ... -def host_config_value_error(param, param_value): ... -def host_config_incompatible_error(param, param_value, incompatible_param): ... +def host_config_type_error(param: str, param_value: object, expected: str) -> TypeError: ... +def host_config_version_error(param: str, version: str, less_than: bool = True) -> errors.InvalidVersion: ... +def host_config_value_error(param: str, param_value: object) -> ValueError: ... +def host_config_incompatible_error(param: str, param_value: str, incompatible_param: str) -> errors.InvalidArgument: ... class ContainerConfig(dict[str, Incomplete]): def __init__( self, version: str, - image, + image: str, command: str | list[str], hostname: str | None = None, user: str | int | None = None, detach: bool = False, stdin_open: bool = False, tty: bool = False, - ports: dict[str, int | list[int] | tuple[str, int] | None] | None = None, + # list is invariant, enumerating all possible union combination would be too complex for: + # list[str | int | tuple[int | str, str] | tuple[int | str, ...]] + ports: dict[str, dict[Incomplete, Incomplete]] | list[Any] | None = None, environment: dict[str, str] | list[str] | None = None, volumes: str | list[str] | None = None, network_disabled: bool = False, entrypoint: str | list[str] | None = None, working_dir: str | None = None, domainname: str | None = None, - host_config: Incomplete | None = None, + host_config: HostConfig | None = None, mac_address: str | None = None, labels: dict[str, str] | list[str] | None = None, stop_signal: str | None = None, - networking_config: Incomplete | None = None, - healthcheck: Incomplete | None = None, + networking_config: NetworkingConfig | None = None, + healthcheck: Healthcheck | None = None, stop_timeout: int | None = None, runtime: str | None = None, ) -> None: ... diff --git a/stubs/docker/docker/types/networks.pyi b/stubs/docker/docker/types/networks.pyi index 14c08b01d1ac..fb64d7d9fe61 100644 --- a/stubs/docker/docker/types/networks.pyi +++ b/stubs/docker/docker/types/networks.pyi @@ -1,31 +1,35 @@ from _typeshed import Incomplete +from collections.abc import Iterable class EndpointConfig(dict[str, Incomplete]): def __init__( self, - version, - aliases: Incomplete | None = None, - links: Incomplete | None = None, - ipv4_address: Incomplete | None = None, - ipv6_address: Incomplete | None = None, - link_local_ips: Incomplete | None = None, + version: str, + aliases: list[Incomplete] | None = None, + links: dict[str, str] | dict[str, None] | dict[str, str | None] | Iterable[tuple[str, str | None]] | None = None, + ipv4_address: str | None = None, + ipv6_address: str | None = None, + link_local_ips: list[str] | None = None, driver_opt: Incomplete | None = None, - mac_address: Incomplete | None = None, + mac_address: str | None = None, ) -> None: ... class NetworkingConfig(dict[str, Incomplete]): - def __init__(self, endpoints_config: Incomplete | None = None) -> None: ... + def __init__(self, endpoints_config: EndpointConfig | None = None) -> None: ... class IPAMConfig(dict[str, Incomplete]): def __init__( - self, driver: str = "default", pool_configs: Incomplete | None = None, options: Incomplete | None = None + self, + driver: str = "default", + pool_configs: list[IPAMPool] | None = None, + options: dict[Incomplete, Incomplete] | None = None, ) -> None: ... class IPAMPool(dict[str, Incomplete]): def __init__( self, - subnet: Incomplete | None = None, - iprange: Incomplete | None = None, - gateway: Incomplete | None = None, - aux_addresses: Incomplete | None = None, + subnet: str | None = None, + iprange: str | None = None, + gateway: str | None = None, + aux_addresses: dict[str, str] | None = None, ) -> None: ... diff --git a/stubs/docker/docker/types/services.pyi b/stubs/docker/docker/types/services.pyi index fda53fc07f68..001f1cf5b41c 100644 --- a/stubs/docker/docker/types/services.pyi +++ b/stubs/docker/docker/types/services.pyi @@ -1,170 +1,188 @@ from _typeshed import Incomplete +from collections.abc import Iterable, Mapping +from typing import Final, Literal, TypeVar, overload + +from .healthcheck import Healthcheck + +_T = TypeVar("_T") class TaskTemplate(dict[str, Incomplete]): def __init__( self, - container_spec, - resources: Incomplete | None = None, - restart_policy: Incomplete | None = None, - placement: Incomplete | None = None, - log_driver: Incomplete | None = None, - networks: Incomplete | None = None, - force_update: Incomplete | None = None, + container_spec: ContainerSpec, + resources: Resources | None = None, + restart_policy: RestartPolicy | None = None, + placement: Placement | list[str] | None = None, + log_driver: DriverConfig | None = None, + networks: Iterable[str | NetworkAttachmentConfig] | None = None, + force_update: int | None = None, ) -> None: ... @property - def container_spec(self): ... + def container_spec(self) -> ContainerSpec: ... @property - def resources(self): ... + def resources(self) -> Resources: ... @property - def restart_policy(self): ... + def restart_policy(self) -> RestartPolicy: ... @property - def placement(self): ... + def placement(self) -> Placement: ... class ContainerSpec(dict[str, Incomplete]): def __init__( self, - image, - command: Incomplete | None = None, - args: Incomplete | None = None, - hostname: Incomplete | None = None, - env: Incomplete | None = None, - workdir: Incomplete | None = None, - user: Incomplete | None = None, - labels: Incomplete | None = None, - mounts: Incomplete | None = None, - stop_grace_period: Incomplete | None = None, - secrets: Incomplete | None = None, - tty: Incomplete | None = None, - groups: Incomplete | None = None, - open_stdin: Incomplete | None = None, - read_only: Incomplete | None = None, - stop_signal: Incomplete | None = None, - healthcheck: Incomplete | None = None, - hosts: Incomplete | None = None, - dns_config: Incomplete | None = None, - configs: Incomplete | None = None, - privileges: Incomplete | None = None, - isolation: Incomplete | None = None, - init: Incomplete | None = None, - cap_add: Incomplete | None = None, - cap_drop: Incomplete | None = None, - sysctls: Incomplete | None = None, + image: str, + command: str | list[str] | None = None, + args: list[str] | None = None, + hostname: str | None = None, + env: dict[str, Incomplete] | list[str] | None = None, + workdir: str | None = None, + user: str | None = None, + labels: dict[Incomplete, Incomplete] | None = None, + mounts: Iterable[str | Mount] | None = None, + stop_grace_period: int | None = None, + secrets: list[SecretReference] | None = None, + tty: bool | None = None, + groups: list[Incomplete] | None = None, + open_stdin: bool | None = None, + read_only: bool | None = None, + stop_signal: str | None = None, + healthcheck: Healthcheck | None = None, + hosts: Mapping[str, str] | None = None, + dns_config: DNSConfig | None = None, + configs: list[ConfigReference] | None = None, + privileges: Privileges | None = None, + isolation: str | None = None, + init: bool | None = None, + cap_add: list[Incomplete] | None = None, + cap_drop: list[Incomplete] | None = None, + sysctls: dict[str, Incomplete] | None = None, ) -> None: ... class Mount(dict[str, Incomplete]): def __init__( self, - target, - source, - type: str = "volume", + target: str, + source: str, + type: Literal["bind", "volume", "tmpfs", "npipe"] = "volume", read_only: bool = False, - consistency: Incomplete | None = None, - propagation: Incomplete | None = None, + consistency: Literal["default", "consistent", "cached", "delegated"] | None = None, + propagation: str | None = None, no_copy: bool = False, - labels: Incomplete | None = None, - driver_config: Incomplete | None = None, - tmpfs_size: Incomplete | None = None, - tmpfs_mode: Incomplete | None = None, + labels: dict[Incomplete, Incomplete] | None = None, + driver_config: DriverConfig | None = None, + tmpfs_size: int | str | None = None, + tmpfs_mode: int | None = None, ) -> None: ... @classmethod - def parse_mount_string(cls, string): ... + def parse_mount_string(cls, string: str) -> Mount: ... class Resources(dict[str, Incomplete]): def __init__( self, - cpu_limit: Incomplete | None = None, - mem_limit: Incomplete | None = None, - cpu_reservation: Incomplete | None = None, - mem_reservation: Incomplete | None = None, - generic_resources: Incomplete | None = None, + cpu_limit: int | None = None, + mem_limit: int | None = None, + cpu_reservation: int | None = None, + mem_reservation: int | None = None, + generic_resources: dict[str, Incomplete] | list[str] | None = None, ) -> None: ... class UpdateConfig(dict[str, Incomplete]): def __init__( self, parallelism: int = 0, - delay: Incomplete | None = None, - failure_action: str = "continue", - monitor: Incomplete | None = None, - max_failure_ratio: Incomplete | None = None, - order: Incomplete | None = None, + delay: int | None = None, + failure_action: Literal["pause", "continue", "rollback"] = "continue", + monitor: int | None = None, + max_failure_ratio: float | None = None, + order: Literal["start-first", "stop-first"] | None = None, ) -> None: ... class RollbackConfig(UpdateConfig): ... class RestartConditionTypesEnum: - NONE: Incomplete - ON_FAILURE: Incomplete - ANY: Incomplete + NONE: Final = "none" + ON_FAILURE: Final = "on-failure" + ANY: Final = "any" class RestartPolicy(dict[str, Incomplete]): condition_types: type[RestartConditionTypesEnum] - def __init__(self, condition="none", delay: int = 0, max_attempts: int = 0, window: int = 0) -> None: ... + def __init__( + self, condition: Literal["none", "on-failure", "any"] = "none", delay: int = 0, max_attempts: int = 0, window: int = 0 + ) -> None: ... class DriverConfig(dict[str, Incomplete]): - def __init__(self, name, options: Incomplete | None = None) -> None: ... + def __init__(self, name: str, options: dict[Incomplete, Incomplete] | None = None) -> None: ... class EndpointSpec(dict[str, Incomplete]): - def __init__(self, mode: Incomplete | None = None, ports: Incomplete | None = None) -> None: ... + def __init__( + self, mode: str | None = None, ports: Mapping[str, str | tuple[str | None, ...]] | list[dict[str, str]] | None = None + ) -> None: ... -def convert_service_ports(ports): ... +@overload +def convert_service_ports(ports: list[_T]) -> list[_T]: ... +@overload +def convert_service_ports(ports: Mapping[str, str | tuple[str | None, ...]]) -> list[dict[str, str]]: ... class ServiceMode(dict[str, Incomplete]): - mode: Incomplete - def __init__(self, mode, replicas: Incomplete | None = None, concurrency: Incomplete | None = None) -> None: ... + mode: Literal["replicated", "global", "ReplicatedJob", "GlobalJob"] + def __init__( + self, + mode: Literal["replicated", "global", "replicated-job", "global-job"], + replicas: int | None = None, + concurrency: int | None = None, + ) -> None: ... @property - def replicas(self): ... + def replicas(self) -> int | None: ... class SecretReference(dict[str, Incomplete]): def __init__( self, - secret_id, - secret_name, - filename: Incomplete | None = None, - uid: Incomplete | None = None, - gid: Incomplete | None = None, + secret_id: str, + secret_name: str, + filename: str | None = None, + uid: str | None = None, + gid: str | None = None, mode: int = 292, ) -> None: ... class ConfigReference(dict[str, Incomplete]): def __init__( self, - config_id, - config_name, - filename: Incomplete | None = None, - uid: Incomplete | None = None, - gid: Incomplete | None = None, + config_id: str, + config_name: str, + filename: str | None = None, + uid: str | None = None, + gid: str | None = None, mode: int = 292, ) -> None: ... class Placement(dict[str, Incomplete]): def __init__( self, - constraints: Incomplete | None = None, - preferences: Incomplete | None = None, - platforms: Incomplete | None = None, - maxreplicas: Incomplete | None = None, + constraints: list[str] | None = None, + preferences: Iterable[tuple[str, str] | PlacementPreference] | None = None, + platforms: Iterable[tuple[str, str]] | None = None, + maxreplicas: int | None = None, ) -> None: ... class PlacementPreference(dict[str, Incomplete]): - def __init__(self, strategy, descriptor) -> None: ... + def __init__(self, strategy: Literal["spread"], descriptor: str) -> None: ... class DNSConfig(dict[str, Incomplete]): def __init__( - self, nameservers: Incomplete | None = None, search: Incomplete | None = None, options: Incomplete | None = None + self, nameservers: list[str] | None = None, search: list[str] | None = None, options: list[str] | None = None ) -> None: ... class Privileges(dict[str, Incomplete]): def __init__( self, - credentialspec_file: Incomplete | None = None, - credentialspec_registry: Incomplete | None = None, - selinux_disable: Incomplete | None = None, - selinux_user: Incomplete | None = None, - selinux_role: Incomplete | None = None, - selinux_type: Incomplete | None = None, - selinux_level: Incomplete | None = None, + credentialspec_file: str | None = None, + credentialspec_registry: str | None = None, + selinux_disable: bool | None = None, + selinux_user: str | None = None, + selinux_role: str | None = None, + selinux_type: str | None = None, + selinux_level: str | None = None, ) -> None: ... class NetworkAttachmentConfig(dict[str, Incomplete]): - def __init__(self, target, aliases: Incomplete | None = None, options: Incomplete | None = None) -> None: ... + def __init__(self, target: str, aliases: list[str] | None = None, options: dict[str, Incomplete] | None = None) -> None: ... diff --git a/stubs/docker/docker/types/swarm.pyi b/stubs/docker/docker/types/swarm.pyi index 5811686e9a03..2d99c4a0ae93 100644 --- a/stubs/docker/docker/types/swarm.pyi +++ b/stubs/docker/docker/types/swarm.pyi @@ -1,29 +1,35 @@ from _typeshed import Incomplete from typing import Any +from .services import DriverConfig + class SwarmSpec(dict[str, Any]): def __init__( self, - version, - task_history_retention_limit: Incomplete | None = None, - snapshot_interval: Incomplete | None = None, - keep_old_snapshots: Incomplete | None = None, - log_entries_for_slow_followers: Incomplete | None = None, - heartbeat_tick: Incomplete | None = None, - election_tick: Incomplete | None = None, - dispatcher_heartbeat_period: Incomplete | None = None, - node_cert_expiry: Incomplete | None = None, - external_cas: Incomplete | None = None, - name: Incomplete | None = None, - labels: Incomplete | None = None, - signing_ca_cert: Incomplete | None = None, - signing_ca_key: Incomplete | None = None, - ca_force_rotate: Incomplete | None = None, - autolock_managers: Incomplete | None = None, - log_driver: Incomplete | None = None, + version: str, + task_history_retention_limit: int | None = None, + snapshot_interval: int | None = None, + keep_old_snapshots: int | None = None, + log_entries_for_slow_followers: int | None = None, + heartbeat_tick: int | None = None, + election_tick: int | None = None, + dispatcher_heartbeat_period: int | None = None, + node_cert_expiry: int | None = None, + external_cas: list[SwarmExternalCA] | None = None, + name: str | None = None, + labels: dict[str, Incomplete] | None = None, + signing_ca_cert: str | None = None, + signing_ca_key: str | None = None, + ca_force_rotate: int | None = None, + autolock_managers: bool | None = None, + log_driver: DriverConfig | None = None, ) -> None: ... class SwarmExternalCA(dict[str, Any]): def __init__( - self, url, protocol: Incomplete | None = None, options: Incomplete | None = None, ca_cert: Incomplete | None = None + self, + url: str, + protocol: str | None = None, + options: dict[Incomplete, Incomplete] | None = None, + ca_cert: str | None = None, ) -> None: ... diff --git a/stubs/docker/docker/utils/utils.pyi b/stubs/docker/docker/utils/utils.pyi index 4ac647e39c15..8622c5e04f04 100644 --- a/stubs/docker/docker/utils/utils.pyi +++ b/stubs/docker/docker/utils/utils.pyi @@ -33,7 +33,7 @@ def compare_version(v1: str, v2: str) -> Literal[0, -1, 1]: ... def version_lt(v1: str, v2: str) -> bool: ... def version_gte(v1: str, v2: str) -> bool: ... def convert_port_bindings( - port_bindings: Mapping[object, Incomplete], # keys are converted using str() + port_bindings: Mapping[str, int | list[int] | tuple[str, int] | None], ) -> dict[str, list[dict[str, str]]]: ... @overload def convert_volume_binds(binds: list[_T]) -> list[_T]: ... @@ -61,7 +61,7 @@ def kwargs_from_env(environment: Mapping[str, Incomplete] | None = None) -> _Env def convert_filters(filters) -> str: ... def datetime_to_timestamp(dt: datetime.datetime) -> int: ... def parse_bytes(s: float | str) -> float: ... -def normalize_links(links): ... +def normalize_links(links: dict[str, str] | dict[str, None] | dict[str, str | None] | Iterable[tuple[str, str | None]]): ... def parse_env_file(env_file: FileDescriptorOrPath) -> dict[str, str]: ... def split_command(command: str | _ShlexInstream) -> list[str]: ... def format_environment(environment: Mapping[str, object | None]) -> list[str]: ...