Skip to content

Commit

Permalink
Allow overriding of sync shims in Service (#557)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtomlinson authored Jan 22, 2025
1 parent 947edfd commit ca1eb11
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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

0 comments on commit ca1eb11

Please sign in to comment.