Skip to content

Commit 05fb7ef

Browse files
authored
Merge branch 'main' into chore/uv-build-0.12
2 parents 36c5272 + 2aae596 commit 05fb7ef

40 files changed

Lines changed: 126 additions & 118 deletions

File tree

end_to_end_tests/docstrings-on-attributes-golden-record/my_test_api_client/client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import ssl
2-
from typing import Any
2+
from typing import Any, Self
33

44
import httpx
55
from attrs import define, evolve, field
@@ -65,7 +65,7 @@ def with_timeout(self, timeout: httpx.Timeout) -> "Client":
6565
self._async_client.timeout = timeout
6666
return evolve(self, timeout=timeout)
6767

68-
def set_httpx_client(self, client: httpx.Client) -> "Client":
68+
def set_httpx_client(self, client: httpx.Client) -> Self:
6969
"""Manually set the underlying httpx.Client
7070
7171
**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
@@ -87,7 +87,7 @@ def get_httpx_client(self) -> httpx.Client:
8787
)
8888
return self._client
8989

90-
def __enter__(self) -> "Client":
90+
def __enter__(self) -> Self:
9191
"""Enter a context manager for self.client—you cannot enter twice (see httpx docs)"""
9292
self.get_httpx_client().__enter__()
9393
return self
@@ -96,7 +96,7 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None:
9696
"""Exit a context manager for internal httpx.Client (see httpx docs)"""
9797
self.get_httpx_client().__exit__(*args, **kwargs)
9898

99-
def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client":
99+
def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> Self:
100100
"""Manually set the underlying httpx.AsyncClient
101101
102102
**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
@@ -118,7 +118,7 @@ def get_async_httpx_client(self) -> httpx.AsyncClient:
118118
)
119119
return self._async_client
120120

121-
async def __aenter__(self) -> "Client":
121+
async def __aenter__(self) -> Self:
122122
"""Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)"""
123123
await self.get_async_httpx_client().__aenter__()
124124
return self
@@ -195,7 +195,7 @@ def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient":
195195
self._async_client.timeout = timeout
196196
return evolve(self, timeout=timeout)
197197

198-
def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient":
198+
def set_httpx_client(self, client: httpx.Client) -> Self:
199199
"""Manually set the underlying httpx.Client
200200
201201
**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
@@ -218,7 +218,7 @@ def get_httpx_client(self) -> httpx.Client:
218218
)
219219
return self._client
220220

221-
def __enter__(self) -> "AuthenticatedClient":
221+
def __enter__(self) -> Self:
222222
"""Enter a context manager for self.client—you cannot enter twice (see httpx docs)"""
223223
self.get_httpx_client().__enter__()
224224
return self
@@ -227,7 +227,7 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None:
227227
"""Exit a context manager for internal httpx.Client (see httpx docs)"""
228228
self.get_httpx_client().__exit__(*args, **kwargs)
229229

230-
def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient":
230+
def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> Self:
231231
"""Manually set the underlying httpx.AsyncClient
232232
233233
**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
@@ -250,7 +250,7 @@ def get_async_httpx_client(self) -> httpx.AsyncClient:
250250
)
251251
return self._async_client
252252

253-
async def __aenter__(self) -> "AuthenticatedClient":
253+
async def __aenter__(self) -> Self:
254254
"""Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)"""
255255
await self.get_async_httpx_client().__aenter__()
256256
return self

end_to_end_tests/generated_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from pathlib import Path
66
import sys
77
import tempfile
8-
from typing import Any
8+
from typing import Any, Self
99

1010
from attrs import define
1111
import pytest
@@ -29,7 +29,7 @@ class GeneratedClientContext:
2929
monkeypatch: pytest.MonkeyPatch
3030
old_modules: set[str] | None = None
3131

32-
def __enter__(self) -> "GeneratedClientContext":
32+
def __enter__(self) -> Self:
3333
self.monkeypatch.syspath_prepend(self.output_path)
3434
self.old_modules = set(sys.modules.keys())
3535
return self

end_to_end_tests/golden-record/my_test_api_client/client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import ssl
2-
from typing import Any
2+
from typing import Any, Self
33

44
import httpx
55
from attrs import define, evolve, field
@@ -69,7 +69,7 @@ def with_timeout(self, timeout: httpx.Timeout) -> "Client":
6969
self._async_client.timeout = timeout
7070
return evolve(self, timeout=timeout)
7171

72-
def set_httpx_client(self, client: httpx.Client) -> "Client":
72+
def set_httpx_client(self, client: httpx.Client) -> Self:
7373
"""Manually set the underlying httpx.Client
7474
7575
**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
@@ -91,7 +91,7 @@ def get_httpx_client(self) -> httpx.Client:
9191
)
9292
return self._client
9393

94-
def __enter__(self) -> "Client":
94+
def __enter__(self) -> Self:
9595
"""Enter a context manager for self.client—you cannot enter twice (see httpx docs)"""
9696
self.get_httpx_client().__enter__()
9797
return self
@@ -100,7 +100,7 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None:
100100
"""Exit a context manager for internal httpx.Client (see httpx docs)"""
101101
self.get_httpx_client().__exit__(*args, **kwargs)
102102

103-
def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client":
103+
def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> Self:
104104
"""Manually set the underlying httpx.AsyncClient
105105
106106
**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
@@ -122,7 +122,7 @@ def get_async_httpx_client(self) -> httpx.AsyncClient:
122122
)
123123
return self._async_client
124124

125-
async def __aenter__(self) -> "Client":
125+
async def __aenter__(self) -> Self:
126126
"""Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)"""
127127
await self.get_async_httpx_client().__aenter__()
128128
return self
@@ -203,7 +203,7 @@ def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient":
203203
self._async_client.timeout = timeout
204204
return evolve(self, timeout=timeout)
205205

206-
def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient":
206+
def set_httpx_client(self, client: httpx.Client) -> Self:
207207
"""Manually set the underlying httpx.Client
208208
209209
**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
@@ -226,7 +226,7 @@ def get_httpx_client(self) -> httpx.Client:
226226
)
227227
return self._client
228228

229-
def __enter__(self) -> "AuthenticatedClient":
229+
def __enter__(self) -> Self:
230230
"""Enter a context manager for self.client—you cannot enter twice (see httpx docs)"""
231231
self.get_httpx_client().__enter__()
232232
return self
@@ -235,7 +235,7 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None:
235235
"""Exit a context manager for internal httpx.Client (see httpx docs)"""
236236
self.get_httpx_client().__exit__(*args, **kwargs)
237237

238-
def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient":
238+
def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> Self:
239239
"""Manually set the underlying httpx.AsyncClient
240240
241241
**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
@@ -258,7 +258,7 @@ def get_async_httpx_client(self) -> httpx.AsyncClient:
258258
)
259259
return self._async_client
260260

261-
async def __aenter__(self) -> "AuthenticatedClient":
261+
async def __aenter__(self) -> Self:
262262
"""Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)"""
263263
await self.get_async_httpx_client().__aenter__()
264264
return self

end_to_end_tests/golden-record/my_test_api_client/models/a_model.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ class AModel:
8181
not_required_nullable_model: ModelWithUnionProperty | None | Unset = UNSET
8282

8383
def to_dict(self) -> dict[str, Any]:
84-
from ..models.free_form_model import FreeFormModel
85-
from ..models.model_with_union_property import ModelWithUnionProperty
84+
from ..models.free_form_model import FreeFormModel # noqa: PLC0415
85+
from ..models.model_with_union_property import ModelWithUnionProperty # noqa: PLC0415
8686

8787
an_enum_value = self.an_enum_value.value
8888

@@ -256,8 +256,8 @@ def to_dict(self) -> dict[str, Any]:
256256

257257
@classmethod
258258
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
259-
from ..models.free_form_model import FreeFormModel
260-
from ..models.model_with_union_property import ModelWithUnionProperty
259+
from ..models.free_form_model import FreeFormModel # noqa: PLC0415
260+
from ..models.model_with_union_property import ModelWithUnionProperty # noqa: PLC0415
261261

262262
d = dict(src_dict)
263263
an_enum_value = AnEnum(d.pop("an_enum_value"))

end_to_end_tests/golden-record/my_test_api_client/models/an_all_of_enum.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from enum import Enum
1+
from enum import StrEnum
22

33

4-
class AnAllOfEnum(str, Enum):
4+
class AnAllOfEnum(StrEnum):
55
A_DEFAULT = "a_default"
66
BAR = "bar"
77
FOO = "foo"

end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_a_item.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def to_dict(self) -> dict[str, Any]:
4646
@classmethod
4747
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
4848
from ..models.an_array_with_a_circular_ref_in_items_object_b_item import (
49-
AnArrayWithACircularRefInItemsObjectBItem,
49+
AnArrayWithACircularRefInItemsObjectBItem, # noqa: PLC0415
5050
)
5151

5252
d = dict(src_dict)

end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_a_item.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def to_dict(self) -> dict[str, Any]:
4141
@classmethod
4242
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
4343
from ..models.an_array_with_a_circular_ref_in_items_object_additional_properties_b_item import (
44-
AnArrayWithACircularRefInItemsObjectAdditionalPropertiesBItem,
44+
AnArrayWithACircularRefInItemsObjectAdditionalPropertiesBItem, # noqa: PLC0415
4545
)
4646

4747
d = dict(src_dict)

end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_b_item.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def to_dict(self) -> dict[str, Any]:
4141
@classmethod
4242
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
4343
from ..models.an_array_with_a_circular_ref_in_items_object_additional_properties_a_item import (
44-
AnArrayWithACircularRefInItemsObjectAdditionalPropertiesAItem,
44+
AnArrayWithACircularRefInItemsObjectAdditionalPropertiesAItem, # noqa: PLC0415
4545
)
4646

4747
d = dict(src_dict)

end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_b_item.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def to_dict(self) -> dict[str, Any]:
4646
@classmethod
4747
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
4848
from ..models.an_array_with_a_circular_ref_in_items_object_a_item import (
49-
AnArrayWithACircularRefInItemsObjectAItem,
49+
AnArrayWithACircularRefInItemsObjectAItem, # noqa: PLC0415
5050
)
5151

5252
d = dict(src_dict)

end_to_end_tests/golden-record/my_test_api_client/models/an_enum.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from enum import Enum
1+
from enum import StrEnum
22

33

4-
class AnEnum(str, Enum):
4+
class AnEnum(StrEnum):
55
FIRST_VALUE = "FIRST_VALUE"
66
SECOND_VALUE = "SECOND_VALUE"
77

0 commit comments

Comments
 (0)