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

Allow overriding of sync shims in Service #557

Merged
merged 2 commits into from
Jan 22, 2025
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
rev: 'v1.14.1'
hooks:
- id: mypy
exclude: "examples|venv|ci|docs|conftest.py"
exclude: "examples|venv|ci|docs"
additional_dependencies: [types-pyyaml>=6.0]
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
Expand Down
8 changes: 4 additions & 4 deletions kr8s/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,25 +281,25 @@ class ServiceAccount(APIObjectSyncMixin, _ServiceAccount):


class Service(APIObjectSyncMixin, _Service):
def proxy_http_request(
def proxy_http_request( # type: ignore
self, method: str, path: str, port: int | None = None, **kwargs: Any
) -> httpx.Response:
return run_sync(self.async_proxy_http_request)(method, path, port=port, **kwargs) # type: ignore

def proxy_http_get(
def proxy_http_get( # type: ignore
self, path: str, port: int | None = None, **kwargs
) -> httpx.Response:
return run_sync(self.async_proxy_http_request)("GET", path, port, **kwargs) # type: ignore

def proxy_http_post(self, path: str, port: int | None = None, **kwargs) -> None: # type: ignore
return run_sync(self.async_proxy_http_request)("POST", path, port, **kwargs) # type: ignore

def proxy_http_put(
def proxy_http_put( # type: ignore
self, path: str, port: int | None = None, **kwargs
) -> httpx.Response:
return run_sync(self.async_proxy_http_request)("PUT", path, port, **kwargs) # type: ignore

def proxy_http_delete(
def proxy_http_delete( # type: ignore
self, path: str, port: int | None = None, **kwargs
) -> httpx.Response:
return run_sync(self.async_proxy_http_request)("DELETE", path, port, **kwargs) # type: ignore
Expand Down
Loading