Skip to content
Open
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 pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ Source = "https://github.com/restatedev/sdk-python"
[project.optional-dependencies]
test = ["pytest", "hypercorn", "anyio"]
lint = ["mypy>=1.11.2", "pyright>=1.1.390", "ruff>=0.6.9"]
harness = ["testcontainers", "hypercorn", "httpx"]
harness = ["testcontainers", "hypercorn", "httpx2[http2]>=2.12,<3"]
serde = ["dacite", "pydantic", "msgspec"]
client = ["httpx[http2]"]
client = ["httpx2[http2]>=2.12,<3"]
adk = ["google-adk>=1.20.0"]
openai = ["openai-agents>=0.6.1"]
pydantic_ai = ["pydantic-ai-slim>=2.0,<3"]
Expand Down
6 changes: 3 additions & 3 deletions python/restate/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"""

from datetime import timedelta
import httpx
import httpx2
import typing
from contextlib import asynccontextmanager

Expand All @@ -32,7 +32,7 @@ class Client(RestateClient):
A basic client for connecting to the Restate service.
"""

def __init__(self, client: httpx.AsyncClient, headers: typing.Optional[dict] = None):
def __init__(self, client: httpx2.AsyncClient, headers: typing.Optional[dict] = None):
self.headers = headers or {}
self.client = client

Expand Down Expand Up @@ -476,5 +476,5 @@ async def create_client(
"""
Create a new Restate client.
"""
async with httpx.AsyncClient(base_url=ingress, headers=headers, http2=True) as http_client:
async with httpx2.AsyncClient(base_url=ingress, headers=headers, http2=True) as http_client:
yield Client(http_client, headers)
12 changes: 6 additions & 6 deletions python/restate/harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from testcontainers.core.container import DockerContainer # type: ignore
from testcontainers.core.wait_strategies import CompositeWaitStrategy, HttpWaitStrategy

import httpx
import httpx2


def find_free_port():
Expand Down Expand Up @@ -169,12 +169,12 @@ def admin_url(self):
return f"http://{self.get_container_host_ip()}:{self.get_exposed_port(9070)}"

def get_admin_client(self):
"""return an httpx client to access the admin interface"""
return httpx.Client(base_url=self.admin_url())
"""return an HTTPX2 client to access the admin interface"""
return httpx2.Client(base_url=self.admin_url())

def get_ingress_client(self):
"""return an httpx client to access the ingress interface"""
return httpx.Client(base_url=self.ingress_url())
"""return an HTTPX2 client to access the ingress interface"""
return httpx2.Client(base_url=self.ingress_url())

def start(self, stream_logs=False):
"""start the container and wait for health checks to pass"""
Expand Down Expand Up @@ -253,7 +253,7 @@ def stop(self):
self.bind_address.cleanup()

def ingress_client(self):
"""return an httpx client to access the restate server's ingress"""
"""return an HTTPX2 client to access the restate server's ingress"""
if self.restate is None:
raise AssertionError("The Restate server has not been started. Use .start()")
return self.restate.get_ingress_client()
Expand Down
4 changes: 2 additions & 2 deletions tests/servercontext.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async def test_retryable_exception():
invocation_retry_policy=InvocationRetryPolicy(
max_attempts=3,
# Something really long to trigger a test timeout.
# Default httpx client timeout is 5 seconds.
# Default HTTPX2 client timeout is 5 seconds.
initial_interval=timedelta(hours=1),
),
)
Expand Down Expand Up @@ -120,7 +120,7 @@ async def test_accidentally_wrapped_retryable_exception():
invocation_retry_policy=InvocationRetryPolicy(
max_attempts=3,
# Something really long to trigger a test timeout.
# Default httpx client timeout is 5 seconds.
# Default HTTPX2 client timeout is 5 seconds.
initial_interval=timedelta(hours=1),
),
)
Expand Down
48 changes: 32 additions & 16 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading