Skip to content

Commit ad1f44f

Browse files
committed
fix: allow passing in extra kwargs to connection
1 parent 2990680 commit ad1f44f

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

libsimba/schemas.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,11 @@ class ConnectionConfig(BaseModel):
6161
http2: bool = False
6262
# a path to a cert file or false to turn off verification
6363
verify: Optional[Union[bool, str]] = None
64+
6465
httpx_class: Optional[Type[httpx.Client]] = httpx.Client
66+
httpx_extra_kwargs: Optional[Dict[str, Any]] = {}
6567
async_httpx_class: Optional[Type[httpx.AsyncClient]] = httpx.AsyncClient
68+
async_httpx_extra_kwargs: Optional[Dict[str, Any]] = {}
6669

6770

6871
class Login(BaseModel):

libsimba/utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ def async_http_client(
259259
max_attempts=config.max_attempts,
260260
)
261261
return config.async_httpx_class(timeout=config.timeout,
262-
transport=transport)
262+
transport=transport,
263+
**config.async_httpx_extra_kwargs)
263264

264265

265266
def http_client(
@@ -285,7 +286,9 @@ def http_client(
285286
),
286287
max_attempts=config.max_attempts,
287288
)
288-
return config.httpx_class(timeout=config.timeout, transport=transport)
289+
return config.httpx_class(timeout=config.timeout,
290+
transport=transport,
291+
**config.httpx_extra_kwargs)
289292

290293

291294
def build_url(base_api_url: str, path: str, query_dict: Optional[dict]):

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "libsimba"
3-
version = "1.7.3"
3+
version = "1.7.4"
44
description = "libsimba is a library simplifying the use of SIMBAChain Blocks APIs."
55
authors = [
66
{ name = "SIMBA Chain Inc." }

0 commit comments

Comments
 (0)