diff --git a/README.md b/README.md index ae52eed3..26f36d99 100644 --- a/README.md +++ b/README.md @@ -386,18 +386,19 @@ can also get all the extra fields on the Pydantic model as a dict with You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including: -- Support for proxies -- Custom transports +- Support for [proxies](https://www.python-httpx.org/advanced/proxies/) +- Custom [transports](https://www.python-httpx.org/advanced/transports/) - Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality ```python +import httpx from openlayer import Openlayer, DefaultHttpxClient client = Openlayer( # Or use the `OPENLAYER_BASE_URL` env var base_url="http://my.test.server.example.com:8083", http_client=DefaultHttpxClient( - proxies="http://my.test.proxy.example.com", + proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0"), ), ) diff --git a/requirements-dev.lock b/requirements-dev.lock index b42c3e61..7a726a06 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -74,9 +74,9 @@ pluggy==1.5.0 # via pytest pyarrow==14.0.1 # via openlayer -pydantic==2.9.2 +pydantic==2.10.3 # via openlayer -pydantic-core==2.23.4 +pydantic-core==2.27.1 # via pydantic pygments==2.18.0 # via rich diff --git a/requirements.lock b/requirements.lock index a4be3175..14bdfd3f 100644 --- a/requirements.lock +++ b/requirements.lock @@ -42,9 +42,9 @@ pandas==2.2.2 # via openlayer pyarrow==14.0.1 # via openlayer -pydantic==2.9.2 +pydantic==2.10.3 # via openlayer -pydantic-core==2.23.4 +pydantic-core==2.27.1 # via pydantic python-dateutil==2.9.0.post0 # via pandas diff --git a/src/openlayer/_types.py b/src/openlayer/_types.py index 4135ae9e..c19dc25f 100644 --- a/src/openlayer/_types.py +++ b/src/openlayer/_types.py @@ -192,10 +192,8 @@ def get(self, __key: str) -> str | None: ... StrBytesIntFloat = Union[str, bytes, int, float] # Note: copied from Pydantic -# https://github.com/pydantic/pydantic/blob/32ea570bf96e84234d2992e1ddf40ab8a565925a/pydantic/main.py#L49 -IncEx: TypeAlias = Union[ - Set[int], Set[str], Mapping[int, Union["IncEx", Literal[True]]], Mapping[str, Union["IncEx", Literal[True]]] -] +# https://github.com/pydantic/pydantic/blob/6f31f8f68ef011f84357330186f603ff295312fd/pydantic/main.py#L79 +IncEx: TypeAlias = Union[Set[int], Set[str], Mapping[int, Union["IncEx", bool]], Mapping[str, Union["IncEx", bool]]] PostParser = Callable[[Any], Any]