Re-sort imports.

This commit is contained in:
Felix Fontein 2025-12-25 21:59:01 +01:00
parent 42121e3326
commit 712d920941
106 changed files with 0 additions and 127 deletions

View File

@ -10,7 +10,6 @@ import sys
import nox
try:
import antsibull_nox
except ImportError:

View File

@ -9,7 +9,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
author:
- Lorin Hochestein (!UNKNOWN)
@ -131,7 +130,6 @@ from ansible_collections.community.docker.plugins.module_utils._version import (
LooseVersion,
)
display = Display()

View File

@ -4,7 +4,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
author:
- Felix Fontein (@felixfontein)
@ -138,7 +137,6 @@ from ansible_collections.community.docker.plugins.plugin_utils._socket_handler i
DockerSocketHandler,
)
if t.TYPE_CHECKING:
from collections.abc import Callable

View File

@ -7,7 +7,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
name: nsenter
short_description: execute on host running controller container
@ -55,7 +54,6 @@ from ansible.plugins.connection import ConnectionBase
from ansible.utils.display import Display
from ansible.utils.path import unfrackpath
display = Display()

View File

@ -8,7 +8,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
name: docker_containers
short_description: Ansible dynamic inventory plugin for Docker containers
@ -195,7 +194,6 @@ from ansible_collections.community.docker.plugins.plugin_utils._unsafe import (
make_unsafe,
)
if t.TYPE_CHECKING:
from ansible.inventory.data import InventoryData
from ansible.parsing.dataloader import DataLoader

View File

@ -4,7 +4,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
name: docker_machine
author: Ximon Eighteen (@ximon18)
@ -117,7 +116,6 @@ from ansible_collections.community.docker.plugins.plugin_utils._unsafe import (
make_unsafe,
)
if t.TYPE_CHECKING:
from ansible.inventory.data import InventoryData
from ansible.parsing.dataloader import DataLoader

View File

@ -5,7 +5,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
name: docker_swarm
author:
@ -168,7 +167,6 @@ from ansible_collections.community.docker.plugins.plugin_utils._unsafe import (
make_unsafe,
)
if t.TYPE_CHECKING:
from ansible.inventory.data import InventoryData
from ansible.parsing.dataloader import DataLoader

View File

@ -14,7 +14,6 @@ from __future__ import annotations
import traceback
import typing as t
REQUESTS_IMPORT_ERROR: str | None # pylint: disable=invalid-name
try:
from requests import Session # noqa: F401, pylint: disable=unused-import

View File

@ -52,7 +52,6 @@ from ..utils.decorators import minimum_version, update_headers
from ..utils.proxy import ProxyConfig
from ..utils.socket import consume_socket_output, demux_adaptor, frames_iter
if t.TYPE_CHECKING:
from requests import Response
from requests.adapters import BaseAdapter

View File

@ -21,7 +21,6 @@ from .credentials.errors import CredentialsNotFound, StoreError
from .credentials.store import Store
from .utils import config
if t.TYPE_CHECKING:
from ansible_collections.community.docker.plugins.module_utils._api.api.client import (
APIClient,

View File

@ -13,7 +13,6 @@ from __future__ import annotations
import sys
MINIMUM_DOCKER_API_VERSION = "1.21"
DEFAULT_TIMEOUT_SECONDS = 60
STREAM_HEADER_SIZE_BYTES = 8

View File

@ -24,7 +24,6 @@ from .config import (
)
from .context import Context
if t.TYPE_CHECKING:
from ..tls import TLSConfig

View File

@ -19,7 +19,6 @@ from ..constants import DEFAULT_UNIX_SOCKET, IS_WINDOWS_PLATFORM
from ..utils.config import find_config_file, get_default_config_file
from ..utils.utils import parse_host
METAFILE = "meta.json"

View File

@ -25,7 +25,6 @@ from .config import (
get_tls_dir,
)
IN_MEMORY = "IN MEMORY"

View File

@ -11,7 +11,6 @@
from __future__ import annotations
PROGRAM_PREFIX = "docker-credential-"
DEFAULT_LINUX_STORE = "secretservice"
DEFAULT_OSX_STORE = "osxkeychain"

View File

@ -13,7 +13,6 @@ from __future__ import annotations
import typing as t
if t.TYPE_CHECKING:
from subprocess import CalledProcessError

View File

@ -17,7 +17,6 @@ from ansible.module_utils.common.text.converters import to_text
from ._import_helper import HTTPError as _HTTPError
if t.TYPE_CHECKING:
from requests import Response

View File

@ -17,7 +17,6 @@ import typing as t
from . import errors
from .transport.ssladapter import SSLHTTPAdapter
if t.TYPE_CHECKING:
from ansible_collections.community.docker.plugins.module_utils._api.api.client import (
APIClient,

View File

@ -19,7 +19,6 @@ from .._import_helper import HTTPAdapter, urllib3, urllib3_connection
from .basehttpadapter import BaseHTTPAdapter
from .npipesocket import NpipeSocket
if t.TYPE_CHECKING:
from collections.abc import Mapping

View File

@ -17,7 +17,6 @@ import time
import traceback
import typing as t
PYWIN32_IMPORT_ERROR: str | None # pylint: disable=invalid-name
try:
import pywintypes

View File

@ -25,7 +25,6 @@ from .. import constants
from .._import_helper import HTTPAdapter, urllib3, urllib3_connection
from .basehttpadapter import BaseHTTPAdapter
PARAMIKO_IMPORT_ERROR: str | None # pylint: disable=invalid-name
try:
import paramiko

View File

@ -16,7 +16,6 @@ import typing as t
from .._import_helper import HTTPAdapter, urllib3
from .basehttpadapter import BaseHTTPAdapter
# Resolves OpenSSL issues in some servers:
# https://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/
# https://github.com/kennethreitz/requests/pull/799

View File

@ -18,7 +18,6 @@ from .. import constants
from .._import_helper import HTTPAdapter, urllib3, urllib3_connection
from .basehttpadapter import BaseHTTPAdapter
if t.TYPE_CHECKING:
from collections.abc import Mapping

View File

@ -17,7 +17,6 @@ import typing as t
from .._import_helper import urllib3
from ..errors import DockerException
if t.TYPE_CHECKING:
from requests import Response

View File

@ -22,7 +22,6 @@ import typing as t
from ..constants import IS_WINDOWS_PLATFORM, WINDOWS_LONGPATH_PREFIX
from . import fnmatch
if t.TYPE_CHECKING:
from collections.abc import Sequence

View File

@ -18,7 +18,6 @@ import typing as t
from ..constants import IS_WINDOWS_PLATFORM
DOCKER_CONFIG_FILENAME = os.path.join(".docker", "config.json")
LEGACY_DOCKER_CONFIG_FILENAME = ".dockercfg"

View File

@ -17,7 +17,6 @@ import typing as t
from .. import errors
from . import utils
if t.TYPE_CHECKING:
from collections.abc import Callable

View File

@ -25,7 +25,6 @@ from __future__ import annotations
import re
__all__ = ["fnmatch", "fnmatchcase", "translate"]
_cache: dict[str, re.Pattern] = {}

View File

@ -17,7 +17,6 @@ import typing as t
from ..errors import StreamParseError
if t.TYPE_CHECKING:
import re
from collections.abc import Callable

View File

@ -14,7 +14,6 @@ from __future__ import annotations
import re
import typing as t
if t.TYPE_CHECKING:
from collections.abc import Collection, Sequence

View File

@ -20,7 +20,6 @@ import typing as t
from ..transport.npipesocket import NpipeSocket
if t.TYPE_CHECKING:
from collections.abc import Sequence

View File

@ -34,7 +34,6 @@ from ..constants import (
)
from ..tls import TLSConfig
if t.TYPE_CHECKING:
from collections.abc import Mapping, Sequence

View File

@ -34,7 +34,6 @@ from ansible_collections.community.docker.plugins.module_utils._version import (
LooseVersion,
)
HAS_DOCKER_PY_2 = False # pylint: disable=invalid-name
HAS_DOCKER_PY_3 = False # pylint: disable=invalid-name
HAS_DOCKER_ERROR: None | str # pylint: disable=invalid-name

View File

@ -21,7 +21,6 @@ from ansible_collections.community.docker.plugins.module_utils._version import (
LooseVersion,
)
try:
from requests.exceptions import ( # noqa: F401, pylint: disable=unused-import
RequestException,
@ -60,7 +59,6 @@ from ansible_collections.community.docker.plugins.module_utils._util import (
update_tls_hostname,
)
if t.TYPE_CHECKING:
from collections.abc import Callable

View File

@ -31,7 +31,6 @@ from ansible_collections.community.docker.plugins.module_utils._version import (
LooseVersion,
)
if t.TYPE_CHECKING:
from collections.abc import Mapping, Sequence

View File

@ -34,7 +34,6 @@ from ansible_collections.community.docker.plugins.module_utils._version import (
LooseVersion,
)
PYYAML_IMPORT_ERROR: None | str # pylint: disable=invalid-name
try:
import yaml

View File

@ -25,7 +25,6 @@ from ansible_collections.community.docker.plugins.module_utils._api.errors impor
NotFound,
)
if t.TYPE_CHECKING:
from collections.abc import Callable

View File

@ -16,7 +16,6 @@ from __future__ import annotations
import typing as t
from enum import Enum
# The format is defined in https://pkg.go.dev/github.com/kr/logfmt?utm_source=godoc
# (look for "EBNFish")

View File

@ -32,7 +32,6 @@ from ansible_collections.community.docker.plugins.module_utils._util import (
sanitize_labels,
)
if t.TYPE_CHECKING:
from collections.abc import Callable, Sequence

View File

@ -117,7 +117,6 @@ from ansible_collections.community.docker.plugins.module_utils._version import (
LooseVersion,
)
if t.TYPE_CHECKING:
from collections.abc import Callable, Sequence

View File

@ -29,7 +29,6 @@ from ansible_collections.community.docker.plugins.module_utils._util import (
sanitize_result,
)
if t.TYPE_CHECKING:
from collections.abc import Sequence

View File

@ -16,7 +16,6 @@ from __future__ import annotations
import re
import typing as t
_VALID_STR = re.compile("^[A-Za-z0-9_-]+$")

View File

@ -23,7 +23,6 @@ from ansible_collections.community.docker.plugins.module_utils._socket_helper im
write_to_socket,
)
if t.TYPE_CHECKING:
from collections.abc import Callable
from types import TracebackType

View File

@ -14,7 +14,6 @@ import socket as pysocket
import typing as t
from collections.abc import Callable
if t.TYPE_CHECKING:
SocketLike = pysocket.socket

View File

@ -12,7 +12,6 @@ import json
import typing as t
from time import sleep
try:
from docker.errors import APIError, NotFound
except ImportError:

View File

@ -18,7 +18,6 @@ from ansible.module_utils.basic import env_fallback
from ansible.module_utils.common.collections import is_sequence
from ansible.module_utils.common.text.converters import to_text
if t.TYPE_CHECKING:
from collections.abc import Callable

View File

@ -7,7 +7,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: current_container_facts
short_description: Return facts about whether the module runs in a container

View File

@ -8,7 +8,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_compose_v2

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_compose_v2_exec

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_compose_v2_pull

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_compose_v2_run

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_config
@ -200,7 +199,6 @@ import hashlib
import traceback
import typing as t
try:
from docker.errors import APIError, DockerException
except ImportError:

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_container

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_container_copy_into
@ -198,7 +197,6 @@ from ansible_collections.community.docker.plugins.module_utils._scramble import
scramble,
)
if t.TYPE_CHECKING:
import tarfile

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_container_exec

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_container_info

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_context_info
@ -193,7 +192,6 @@ from ansible_collections.community.docker.plugins.module_utils._api.errors impor
DockerException,
)
if t.TYPE_CHECKING:
from ansible_collections.community.docker.plugins.module_utils._api.tls import (
TLSConfig,

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_host_info

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_image
@ -413,7 +412,6 @@ from ansible_collections.community.docker.plugins.module_utils._version import (
LooseVersion,
)
if t.TYPE_CHECKING:
from collections.abc import Callable

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_image_build
@ -304,7 +303,6 @@ from ansible_collections.community.docker.plugins.module_utils._version import (
LooseVersion,
)
if t.TYPE_CHECKING:
from ansible.module_utils.basic import AnsibleModule

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_image_export

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_image_info

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_image_load

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_image_pull

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_image_push

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_image_remove

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_image_tag
@ -121,7 +120,6 @@ from ansible_collections.community.docker.plugins.module_utils._util import (
is_valid_tag,
)
if t.TYPE_CHECKING:
from ansible.module_utils.basic import AnsibleModule

View File

@ -9,7 +9,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_login
short_description: Log into a Docker registry

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_network
short_description: Manage Docker networks

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_network_info

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_node
short_description: Manage Docker Swarm node
@ -136,7 +135,6 @@ node:
import traceback
import typing as t
try:
from docker.errors import APIError, DockerException
except ImportError:

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_node_info
@ -96,7 +95,6 @@ from ansible_collections.community.docker.plugins.module_utils._swarm import (
AnsibleDockerSwarmClient,
)
try:
from docker.errors import DockerException
except ImportError:

View File

@ -7,7 +7,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_plugin
short_description: Manage Docker plugins

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_prune

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_secret
@ -192,7 +191,6 @@ import hashlib
import traceback
import typing as t
try:
from docker.errors import APIError, DockerException
except ImportError:

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_stack
author: "Dario Zanzico (@dariko)"
@ -168,7 +167,6 @@ from ansible_collections.community.docker.plugins.module_utils._common_cli impor
DockerException,
)
try:
from jsondiff import diff as json_diff

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_stack_info
author: "Jose Angel Munoz (@imjoseangel)"

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_stack_task_info
author: "Jose Angel Munoz (@imjoseangel)"

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_swarm
short_description: Manage Swarm cluster
@ -294,7 +293,6 @@ import json
import traceback
import typing as t
try:
from docker.errors import APIError, DockerException
except ImportError:

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_swarm_info
@ -188,7 +187,6 @@ tasks:
import traceback
import typing as t
try:
from docker.errors import APIError, DockerException
except ImportError:

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_swarm_service
author:
@ -874,7 +873,6 @@ from ansible_collections.community.docker.plugins.module_utils._version import (
LooseVersion,
)
try:
from docker import types
from docker.errors import (

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_swarm_service_info
@ -65,7 +64,6 @@ service:
import traceback
import typing as t
try:
from docker.errors import DockerException
except ImportError:

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_volume
short_description: Manage Docker volumes

View File

@ -6,7 +6,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_volume_info
short_description: Retrieve facts about Docker volumes

View File

@ -19,7 +19,6 @@ from ansible_collections.community.docker.plugins.module_utils._util import (
DOCKER_COMMON_ARGS,
)
if t.TYPE_CHECKING:
from ansible.plugins import AnsiblePlugin

View File

@ -19,7 +19,6 @@ from ansible_collections.community.docker.plugins.module_utils._util import (
DOCKER_COMMON_ARGS,
)
if t.TYPE_CHECKING:
from ansible.plugins import AnsiblePlugin

View File

@ -13,7 +13,6 @@ from ansible_collections.community.docker.plugins.module_utils._socket_handler i
DockerSocketHandlerBase,
)
if t.TYPE_CHECKING:
from ansible.utils.display import Display

View File

@ -17,7 +17,6 @@ from ansible.utils.unsafe_proxy import (
)
from ansible.utils.unsafe_proxy import wrap_var as _make_unsafe
_RE_TEMPLATE_CHARS = re.compile("[{}]")
_RE_TEMPLATE_CHARS_BYTES = re.compile(b"[{}]")

View File

@ -19,7 +19,6 @@ from ansible_collections.community.docker.plugins.inventory.docker_containers im
InventoryModule,
)
if t.TYPE_CHECKING:
from collections.abc import Callable

View File

@ -42,7 +42,6 @@ from ansible_collections.community.docker.tests.unit.plugins.module_utils._api.c
from .. import fake_api
if t.TYPE_CHECKING:
from ansible_collections.community.docker.plugins.module_utils._api.auth import (
AuthConfig,

View File

@ -8,5 +8,4 @@
from __future__ import annotations
DEFAULT_DOCKER_API_VERSION = "1.45"

View File

@ -17,7 +17,6 @@ from ansible_collections.community.docker.tests.unit.plugins.module_utils._api.c
from . import fake_stat
if t.TYPE_CHECKING:
from collections.abc import Callable

View File

@ -8,7 +8,6 @@
from __future__ import annotations
OBJ = {
"read": "2015-02-11T19:20:46.667237763+02:00",
"network": {

View File

@ -17,7 +17,6 @@ from ansible_collections.community.docker.plugins.module_utils._api.transport im
ssladapter,
)
try:
from ssl import CertificateError, match_hostname # type: ignore
except ImportError:

View File

@ -27,7 +27,6 @@ from ansible_collections.community.docker.plugins.module_utils._api.utils.build
tar,
)
if t.TYPE_CHECKING:
from collections.abc import Collection

View File

@ -16,7 +16,6 @@ from ansible_collections.community.docker.plugins.module_utils._api.utils.json_s
stream_as_text,
)
if t.TYPE_CHECKING:
T = t.TypeVar("T")

View File

@ -14,7 +14,6 @@ from ansible_collections.community.docker.plugins.module_utils._api.utils.proxy
ProxyConfig,
)
HTTP = "http://test:80"
HTTPS = "https://test:443"
FTP = "ftp://user:password@host:23"

View File

@ -44,7 +44,6 @@ from ansible_collections.community.docker.tests.unit.plugins.module_utils._api.c
DEFAULT_DOCKER_API_VERSION,
)
TEST_CERT_DIR = os.path.join(
os.path.dirname(__file__),
"testdata/certs",

View File

@ -10,7 +10,6 @@ from ansible_collections.community.docker.plugins.module_utils._compose_v2 impor
Event,
)
EVENT_TEST_CASES: list[tuple[str, str, bool, bool, str, list[Event], list[str]]] = [
# #######################################################################################################################
# ## Docker Compose 2.18.1 ##############################################################################################

View File

@ -14,7 +14,6 @@ from ansible_collections.community.docker.plugins.module_utils._compose_v2 impor
from .compose_v2_test_cases import EVENT_TEST_CASES
EXTRA_TEST_CASES: list[tuple[str, str, bool, bool, str, list[Event], list[str]]] = [
(
"2.24.2-manual-build-dry-run",

Some files were not shown because too many files have changed in this diff Show More