Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#455)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Jul 30, 2024
1 parent 103d781 commit 023ea97
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]
12 changes: 6 additions & 6 deletions kr8s/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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"]:
Expand Down
2 changes: 1 addition & 1 deletion kr8s/_async_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion kr8s/_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion kr8s/_portforward.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 023ea97

Please sign in to comment.