From 8f4f874e1bdedd8d9b5eed248a5a1973e7727e5d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 22:04:40 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.5.4 → v0.5.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.4...v0.5.5) - [github.com/asottile/pyupgrade: v3.16.0 → v3.17.0](https://github.com/asottile/pyupgrade/compare/v3.16.0...v3.17.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6208791e..2fca6d28 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: - --target-version=py38 - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: 'v0.5.4' + rev: 'v0.5.5' hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] @@ -32,7 +32,7 @@ repos: exclude: "examples|tests|venv|ci|docs|conftest.py" additional_dependencies: [types-pyyaml>=6.0] - repo: https://github.com/asottile/pyupgrade - rev: v3.16.0 + rev: v3.17.0 hooks: - id: pyupgrade args: [--py38-plus] From 19ff011ec9476156d5945041c320246f490b3f66 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 22:04:52 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- kr8s/_api.py | 12 ++++++------ kr8s/_async_utils.py | 2 +- kr8s/_objects.py | 2 +- kr8s/_portforward.py | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/kr8s/_api.py b/kr8s/_api.py index df12bebd..8d917b00 100644 --- a/kr8s/_api.py +++ b/kr8s/_api.py @@ -141,7 +141,7 @@ async def call_api( raise_for_status: bool = True, stream: bool = False, **kwargs, - ) -> AsyncGenerator[httpx.Response, None]: + ) -> AsyncGenerator[httpx.Response]: """Make a Kubernetes API request.""" if not self._session or self._session.is_closed: await self._create_session() @@ -215,7 +215,7 @@ async def open_websocket( namespace: str | None = None, url: str = "", **kwargs, - ) -> AsyncGenerator[httpx_ws.AsyncWebSocketSession, None]: + ) -> AsyncGenerator[httpx_ws.AsyncWebSocketSession]: """Open a websocket connection to a Kubernetes API endpoint.""" if not self._session or self._session.is_closed: await self._create_session() @@ -341,7 +341,7 @@ async def async_get_kind( watch: bool = False, allow_unknown_type: bool = True, **kwargs, - ) -> AsyncGenerator[tuple[type[APIObject], httpx.Response], None]: + ) -> AsyncGenerator[tuple[type[APIObject], httpx.Response]]: """Get a Kubernetes resource.""" from ._objects import get_class, new_class @@ -499,7 +499,7 @@ async def async_watch( field_selector: str | dict | None = None, since: str | None = None, allow_unknown_type: bool = True, - ) -> AsyncGenerator[tuple[str, APIObject], None]: + ) -> AsyncGenerator[tuple[str, APIObject]]: """Watch a Kubernetes resource.""" async with self.async_get_kind( kind, @@ -557,12 +557,12 @@ async def async_api_resources(self) -> list[dict]: ) return resources - async def api_versions(self) -> AsyncGenerator[str, None]: + async def api_versions(self) -> AsyncGenerator[str]: """Get the Kubernetes API versions.""" async for version in self.async_api_versions(): yield version - async def async_api_versions(self) -> AsyncGenerator[str, None]: + async def async_api_versions(self) -> AsyncGenerator[str]: async with self.call_api(method="GET", version="", base="/api") as response: core_api_list = response.json() for version in core_api_list["versions"]: diff --git a/kr8s/_async_utils.py b/kr8s/_async_utils.py index 27d878c6..e3153a47 100644 --- a/kr8s/_async_utils.py +++ b/kr8s/_async_utils.py @@ -231,7 +231,7 @@ async def check_output(*args, **kwargs) -> str: @asynccontextmanager async def NamedTemporaryFile( # noqa: N802 *args, delete: bool = True, **kwargs -) -> AsyncGenerator[anyio.Path, None]: +) -> AsyncGenerator[anyio.Path]: """Create a temporary file that is deleted when the context exits.""" kwargs.update(delete=False) diff --git a/kr8s/_objects.py b/kr8s/_objects.py index 9707a27d..9f982f82 100644 --- a/kr8s/_objects.py +++ b/kr8s/_objects.py @@ -869,7 +869,7 @@ async def logs( limit_bytes=None, follow=False, timeout=3600, - ) -> AsyncGenerator[str, None]: + ) -> AsyncGenerator[str]: """Streams logs from a Pod. Args: diff --git a/kr8s/_portforward.py b/kr8s/_portforward.py index c1d4b4c4..1af6c361 100644 --- a/kr8s/_portforward.py +++ b/kr8s/_portforward.py @@ -155,7 +155,7 @@ async def run_forever(self) -> None: await server.serve_forever() @asynccontextmanager - async def _run(self) -> AsyncGenerator[int, None]: + async def _run(self) -> AsyncGenerator[int]: """Start the port forward for multiple bind addresses and yield the local port.""" if self.local_port == 0: self.local_port = self._find_available_port()