From e8720c49f44918d837d96231826005019c973360 Mon Sep 17 00:00:00 2001 From: Urvashi Mohnani Date: Tue, 7 Nov 2023 08:17:00 -0500 Subject: [PATCH] Add some pylint disables This is used towork around some invalid-name issue and cyclic import issue which seems to be a bug in pylint Signed-off-by: Urvashi Mohnani --- podman/api/client.py | 2 +- podman/api/ssh.py | 1 + podman/api/uds.py | 1 + podman/errors/exceptions.py | 5 ++--- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/podman/api/client.py b/podman/api/client.py index c6373050..880fdc3d 100644 --- a/podman/api/client.py +++ b/podman/api/client.py @@ -7,7 +7,7 @@ import requests from requests.adapters import HTTPAdapter -from podman import api +from podman import api # pylint: disable=cyclic-import from podman.api.ssh import SSHAdapter from podman.api.uds import UDSAdapter from podman.errors import APIError, NotFound diff --git a/podman/api/ssh.py b/podman/api/ssh.py index 8ec17626..ccac8c6d 100644 --- a/podman/api/ssh.py +++ b/podman/api/ssh.py @@ -203,6 +203,7 @@ def connect(self) -> None: class SSHConnectionPool(urllib3.HTTPConnectionPool): """Specialized HTTPConnectionPool for holding SSH connections.""" + # pylint: disable=invalid-name ConnectionCls = SSHConnection diff --git a/podman/api/uds.py b/podman/api/uds.py index e159f0cd..72133daf 100644 --- a/podman/api/uds.py +++ b/podman/api/uds.py @@ -90,6 +90,7 @@ def connect(self) -> None: class UDSConnectionPool(urllib3.HTTPConnectionPool): """Specialization of HTTPConnectionPool for holding UNIX domain sockets.""" + # pylint: disable=invalid-name ConnectionCls = UDSConnection diff --git a/podman/errors/exceptions.py b/podman/errors/exceptions.py index e24ed754..5e532f61 100644 --- a/podman/errors/exceptions.py +++ b/podman/errors/exceptions.py @@ -1,13 +1,12 @@ """Podman API Errors.""" -import typing -from typing import Iterable, List, Optional, Union +from typing import Iterable, List, Optional, Union, TYPE_CHECKING from requests import Response from requests.exceptions import HTTPError # Break circular import -if typing.TYPE_CHECKING: +if TYPE_CHECKING: from podman.domain.containers import Container from podman.api.client import APIResponse