Repository: tensorzero/tensorzero (language: rust)

Issue:
Make `gateway_url` a kwarg in `build_http` client
Now:

```
def build_http(
        cls, gateway_url: str, *, timeout: Optional[float] = None
    ) -> "TensorZeroGateway":
```

Desired:

```
def build_http(
        cls, *, gateway_url: str, timeout: Optional[float] = None
    ) -> "TensorZeroGateway":
```


(For backwards compatibility, we should still allow the positional argument when using the deprecated constructor.)


Discussion / hints:
lgtm

Fix patch:
diff --git a/Cargo.lock b/Cargo.lock
index b687409cd..a5837ef19 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3314,7 +3314,7 @@ dependencies = [
 
 [[package]]
 name = "tensorzero_python"
-version = "0.2.0"
+version = "0.3.0"
 dependencies = [
  "futures",
  "pyo3",
diff --git a/clients/python-pyo3/Cargo.toml b/clients/python-pyo3/Cargo.toml
index 3541dd92f..92d108e7f 100644
--- a/clients/python-pyo3/Cargo.toml
+++ b/clients/python-pyo3/Cargo.toml
@@ -3,7 +3,7 @@
 # It's named 'tensorzero_python' to avoid confusion with the Rust client
 # (which has a crate name of 'tensorzero')
 name = "tensorzero_python"
-version = "0.2.0"
+version = "0.3.0"
 edition = "2021"
 license = "Apache-2.0"
 
diff --git a/clients/python-pyo3/src/lib.rs b/clients/python-pyo3/src/lib.rs
index ef9307515..c331682f4 100644
--- a/clients/python-pyo3/src/lib.rs
+++ b/clients/python-pyo3/src/lib.rs
@@ -354,7 +354,7 @@ impl TensorZeroGateway {
     }
 
     #[classmethod]
-    #[pyo3(signature = (gateway_url, *, timeout=None))]
+    #[pyo3(signature = (*, gateway_url, timeout=None))]
     /// Initialize the TensorZero client, using the HTTP gateway.
     /// :param gateway_url: The base URL of the TensorZero gateway. Example: "http://localhost:3000"
     /// :param timeout: The timeout for the HTTP client in seconds. If not provided, no timeout will be set.
@@ -593,7 +593,7 @@ impl AsyncTensorZeroGateway {
     }
 
     #[classmethod]
-    #[pyo3(signature = (gateway_url, *, timeout=None))]
+    #[pyo3(signature = (*, gateway_url, timeout=None))]
     fn build_http<'a>(
         cls: &Bound<'a, PyType>,
         gateway_url: &str,
diff --git a/clients/python-pyo3/tensorzero/tensorzero.pyi b/clients/python-pyo3/tensorzero/tensorzero.pyi
index 1d99cae67..4bd48d0d1 100644
--- a/clients/python-pyo3/tensorzero/tensorzero.pyi
+++ b/clients/python-pyo3/tensorzero/tensorzero.pyi
@@ -32,7 +32,7 @@ class TensorZeroGateway(BaseTensorZeroGateway):
 
     @classmethod
     def build_http(
-        cls, gateway_url: str, *, timeout: Optional[float] = None
+        cls, *, gateway_url: str, timeout: Optional[float] = None
     ) -> "TensorZeroGateway":
         """
         Build a TensorZeroGateway instance.
@@ -155,7 +155,7 @@ class AsyncTensorZeroGateway(BaseTensorZeroGateway):
 
     @classmethod
     async def build_http(
-        cls, gateway_url: str, *, timeout: Optional[float] = None
+        cls, *, gateway_url: str, timeout: Optional[float] = None
     ) -> "AsyncTensorZeroGateway":
         """
         Build an AsyncTensorZeroGateway instance.


Test patch:
diff --git a/clients/python-pyo3/tests/test_client.py b/clients/python-pyo3/tests/test_client.py
index 06772c64f..8a1b7e1ac 100644
--- a/clients/python-pyo3/tests/test_client.py
+++ b/clients/python-pyo3/tests/test_client.py
@@ -58,7 +58,7 @@ class ClientType(Enum):
 async def async_client(request):
     if request.param == ClientType.HttpGateway:
         async with await AsyncTensorZeroGateway.build_http(
-            "http://localhost:3000"
+            gateway_url="http://localhost:3000"
         ) as client:
             yield client
     else:
@@ -677,7 +677,9 @@ async def test_async_error():
 @pytest.fixture(params=[ClientType.HttpGateway, ClientType.EmbeddedGateway])
 def sync_client(request):
     if request.param == ClientType.HttpGateway:
-        with TensorZeroGateway.build_http("http://localhost:3000") as client:
+        with TensorZeroGateway.build_http(
+            gateway_url="http://localhost:3000"
+        ) as client:
             yield client
     else:
         with TensorZeroGateway.build_embedded(