Skip to content

Commit a7e84d5

Browse files
authored
Merge pull request #114 from lumalabs/release-please--branches--main--changes--next
2 parents 9305f8d + 9c7c576 commit a7e84d5

File tree

9 files changed

+35
-105
lines changed

9 files changed

+35
-105
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ USER vscode
66
RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.35.0" RYE_INSTALL_OPTION="--yes" bash
77
ENV PATH=/home/vscode/.rye/shims:$PATH
88

9-
RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc
9+
RUN echo "[[ -d .venv ]] && source .venv/bin/activate || export PATH=\$PATH" >> /home/vscode/.bashrc

.devcontainer/devcontainer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
}
2525
}
2626
}
27+
},
28+
"features": {
29+
"ghcr.io/devcontainers/features/node:1": {}
2730
}
2831

2932
// Features to add to the dev container. More info: https://containers.dev/features.

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.5.0"
2+
".": "1.5.1"
33
}

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## 1.5.1 (2025-03-04)
4+
5+
Full Changelog: [v1.5.0...v1.5.1](https://github.com/lumalabs/lumaai-python/compare/v1.5.0...v1.5.1)
6+
7+
### Chores
8+
9+
* **docs:** update client docstring ([#117](https://github.com/lumalabs/lumaai-python/issues/117)) ([33e4b1c](https://github.com/lumalabs/lumaai-python/commit/33e4b1caa0856141fddf96c1f0f11eded04b37b8))
10+
* **internal:** fix devcontainers setup ([#113](https://github.com/lumalabs/lumaai-python/issues/113)) ([51d77c4](https://github.com/lumalabs/lumaai-python/commit/51d77c41886232b0fa1e3e82ed9fec3a08204b56))
11+
* **internal:** properly set __pydantic_private__ ([#115](https://github.com/lumalabs/lumaai-python/issues/115)) ([b9c7a3f](https://github.com/lumalabs/lumaai-python/commit/b9c7a3ff7f20f3bf06aeb85452235a6a6176e778))
12+
* **internal:** remove unused http client options forwarding ([#118](https://github.com/lumalabs/lumaai-python/issues/118)) ([b68b130](https://github.com/lumalabs/lumaai-python/commit/b68b130141096a575f893136721bf62cb792b4fe))
13+
14+
15+
### Documentation
16+
17+
* update URLs from stainlessapi.com to stainless.com ([#116](https://github.com/lumalabs/lumaai-python/issues/116)) ([b7ee94c](https://github.com/lumalabs/lumaai-python/commit/b7ee94c17aa885c4b7f8d01d6c0b172cbf205a07))
18+
319
## 1.5.0 (2025-02-22)
420

521
Full Changelog: [v1.4.1...v1.5.0](https://github.com/lumalabs/lumaai-python/compare/v1.4.1...v1.5.0)

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## Reporting Security Issues
44

5-
This SDK is generated by [Stainless Software Inc](http://stainlessapi.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.
5+
This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.
66

7-
To report a security issue, please contact the Stainless team at security@stainlessapi.com.
7+
To report a security issue, please contact the Stainless team at security@stainless.com.
88

99
## Responsible Disclosure
1010

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "lumaai"
3-
version = "1.5.0"
3+
version = "1.5.1"
44
description = "The official Python library for the lumaai API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/lumaai/_base_client.py

Lines changed: 8 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import inspect
1010
import logging
1111
import platform
12-
import warnings
1312
import email.utils
1413
from types import TracebackType
1514
from random import random
@@ -36,7 +35,7 @@
3635
import httpx
3736
import distro
3837
import pydantic
39-
from httpx import URL, Limits
38+
from httpx import URL
4039
from pydantic import PrivateAttr
4140

4241
from . import _exceptions
@@ -51,19 +50,16 @@
5150
Timeout,
5251
NotGiven,
5352
ResponseT,
54-
Transport,
5553
AnyMapping,
5654
PostParser,
57-
ProxiesTypes,
5855
RequestFiles,
5956
HttpxSendArgs,
60-
AsyncTransport,
6157
RequestOptions,
6258
HttpxRequestFiles,
6359
ModelBuilderProtocol,
6460
)
6561
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
66-
from ._compat import model_copy, model_dump
62+
from ._compat import PYDANTIC_V2, model_copy, model_dump
6763
from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type
6864
from ._response import (
6965
APIResponse,
@@ -207,6 +203,9 @@ def _set_private_attributes(
207203
model: Type[_T],
208204
options: FinalRequestOptions,
209205
) -> None:
206+
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
207+
self.__pydantic_private__ = {}
208+
210209
self._model = model
211210
self._client = client
212211
self._options = options
@@ -292,6 +291,9 @@ def _set_private_attributes(
292291
client: AsyncAPIClient,
293292
options: FinalRequestOptions,
294293
) -> None:
294+
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
295+
self.__pydantic_private__ = {}
296+
295297
self._model = model
296298
self._client = client
297299
self._options = options
@@ -331,9 +333,6 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
331333
_base_url: URL
332334
max_retries: int
333335
timeout: Union[float, Timeout, None]
334-
_limits: httpx.Limits
335-
_proxies: ProxiesTypes | None
336-
_transport: Transport | AsyncTransport | None
337336
_strict_response_validation: bool
338337
_idempotency_header: str | None
339338
_default_stream_cls: type[_DefaultStreamT] | None = None
@@ -346,19 +345,13 @@ def __init__(
346345
_strict_response_validation: bool,
347346
max_retries: int = DEFAULT_MAX_RETRIES,
348347
timeout: float | Timeout | None = DEFAULT_TIMEOUT,
349-
limits: httpx.Limits,
350-
transport: Transport | AsyncTransport | None,
351-
proxies: ProxiesTypes | None,
352348
custom_headers: Mapping[str, str] | None = None,
353349
custom_query: Mapping[str, object] | None = None,
354350
) -> None:
355351
self._version = version
356352
self._base_url = self._enforce_trailing_slash(URL(base_url))
357353
self.max_retries = max_retries
358354
self.timeout = timeout
359-
self._limits = limits
360-
self._proxies = proxies
361-
self._transport = transport
362355
self._custom_headers = custom_headers or {}
363356
self._custom_query = custom_query or {}
364357
self._strict_response_validation = _strict_response_validation
@@ -794,46 +787,11 @@ def __init__(
794787
base_url: str | URL,
795788
max_retries: int = DEFAULT_MAX_RETRIES,
796789
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
797-
transport: Transport | None = None,
798-
proxies: ProxiesTypes | None = None,
799-
limits: Limits | None = None,
800790
http_client: httpx.Client | None = None,
801791
custom_headers: Mapping[str, str] | None = None,
802792
custom_query: Mapping[str, object] | None = None,
803793
_strict_response_validation: bool,
804794
) -> None:
805-
kwargs: dict[str, Any] = {}
806-
if limits is not None:
807-
warnings.warn(
808-
"The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
809-
category=DeprecationWarning,
810-
stacklevel=3,
811-
)
812-
if http_client is not None:
813-
raise ValueError("The `http_client` argument is mutually exclusive with `connection_pool_limits`")
814-
else:
815-
limits = DEFAULT_CONNECTION_LIMITS
816-
817-
if transport is not None:
818-
kwargs["transport"] = transport
819-
warnings.warn(
820-
"The `transport` argument is deprecated. The `http_client` argument should be passed instead",
821-
category=DeprecationWarning,
822-
stacklevel=3,
823-
)
824-
if http_client is not None:
825-
raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
826-
827-
if proxies is not None:
828-
kwargs["proxies"] = proxies
829-
warnings.warn(
830-
"The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
831-
category=DeprecationWarning,
832-
stacklevel=3,
833-
)
834-
if http_client is not None:
835-
raise ValueError("The `http_client` argument is mutually exclusive with `proxies`")
836-
837795
if not is_given(timeout):
838796
# if the user passed in a custom http client with a non-default
839797
# timeout set then we use that timeout.
@@ -854,12 +812,9 @@ def __init__(
854812

855813
super().__init__(
856814
version=version,
857-
limits=limits,
858815
# cast to a valid type because mypy doesn't understand our type narrowing
859816
timeout=cast(Timeout, timeout),
860-
proxies=proxies,
861817
base_url=base_url,
862-
transport=transport,
863818
max_retries=max_retries,
864819
custom_query=custom_query,
865820
custom_headers=custom_headers,
@@ -869,9 +824,6 @@ def __init__(
869824
base_url=base_url,
870825
# cast to a valid type because mypy doesn't understand our type narrowing
871826
timeout=cast(Timeout, timeout),
872-
limits=limits,
873-
follow_redirects=True,
874-
**kwargs, # type: ignore
875827
)
876828

877829
def is_closed(self) -> bool:
@@ -1366,45 +1318,10 @@ def __init__(
13661318
_strict_response_validation: bool,
13671319
max_retries: int = DEFAULT_MAX_RETRIES,
13681320
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
1369-
transport: AsyncTransport | None = None,
1370-
proxies: ProxiesTypes | None = None,
1371-
limits: Limits | None = None,
13721321
http_client: httpx.AsyncClient | None = None,
13731322
custom_headers: Mapping[str, str] | None = None,
13741323
custom_query: Mapping[str, object] | None = None,
13751324
) -> None:
1376-
kwargs: dict[str, Any] = {}
1377-
if limits is not None:
1378-
warnings.warn(
1379-
"The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
1380-
category=DeprecationWarning,
1381-
stacklevel=3,
1382-
)
1383-
if http_client is not None:
1384-
raise ValueError("The `http_client` argument is mutually exclusive with `connection_pool_limits`")
1385-
else:
1386-
limits = DEFAULT_CONNECTION_LIMITS
1387-
1388-
if transport is not None:
1389-
kwargs["transport"] = transport
1390-
warnings.warn(
1391-
"The `transport` argument is deprecated. The `http_client` argument should be passed instead",
1392-
category=DeprecationWarning,
1393-
stacklevel=3,
1394-
)
1395-
if http_client is not None:
1396-
raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
1397-
1398-
if proxies is not None:
1399-
kwargs["proxies"] = proxies
1400-
warnings.warn(
1401-
"The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
1402-
category=DeprecationWarning,
1403-
stacklevel=3,
1404-
)
1405-
if http_client is not None:
1406-
raise ValueError("The `http_client` argument is mutually exclusive with `proxies`")
1407-
14081325
if not is_given(timeout):
14091326
# if the user passed in a custom http client with a non-default
14101327
# timeout set then we use that timeout.
@@ -1426,11 +1343,8 @@ def __init__(
14261343
super().__init__(
14271344
version=version,
14281345
base_url=base_url,
1429-
limits=limits,
14301346
# cast to a valid type because mypy doesn't understand our type narrowing
14311347
timeout=cast(Timeout, timeout),
1432-
proxies=proxies,
1433-
transport=transport,
14341348
max_retries=max_retries,
14351349
custom_query=custom_query,
14361350
custom_headers=custom_headers,
@@ -1440,9 +1354,6 @@ def __init__(
14401354
base_url=base_url,
14411355
# cast to a valid type because mypy doesn't understand our type narrowing
14421356
timeout=cast(Timeout, timeout),
1443-
limits=limits,
1444-
follow_redirects=True,
1445-
**kwargs, # type: ignore
14461357
)
14471358

14481359
def is_closed(self) -> bool:

src/lumaai/_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def __init__(
7070
# part of our public interface in the future.
7171
_strict_response_validation: bool = False,
7272
) -> None:
73-
"""Construct a new synchronous lumaai client instance.
73+
"""Construct a new synchronous LumaAI client instance.
7474
7575
This automatically infers the `auth_token` argument from the `LUMAAI_API_KEY` environment variable if it is not provided.
7676
"""
@@ -242,7 +242,7 @@ def __init__(
242242
# part of our public interface in the future.
243243
_strict_response_validation: bool = False,
244244
) -> None:
245-
"""Construct a new async lumaai client instance.
245+
"""Construct a new async AsyncLumaAI client instance.
246246
247247
This automatically infers the `auth_token` argument from the `LUMAAI_API_KEY` environment variable if it is not provided.
248248
"""

src/lumaai/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "lumaai"
4-
__version__ = "1.5.0" # x-release-please-version
4+
__version__ = "1.5.1" # x-release-please-version

0 commit comments

Comments
 (0)