Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #455

Merged
merged 2 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading