Skip to content

Commit 9ce7e90

Browse files
authored
Merge pull request #117 from steel-dev/release-please--branches--main--changes--next
release: 0.7.0
2 parents 026ae8a + 29d659b commit 9ce7e90

21 files changed

+728
-24
lines changed

.release-please-manifest.json

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

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 25
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nen-labs%2Fsteel-efa19cc3cc7e8d1692f1952185eb882fd6250d5bc81af147aab3830fc39b4f8d.yml
3-
openapi_spec_hash: 85a6c998ec4fbd8d526ccd3dd40bdf96
4-
config_hash: 42515bf83f1e0e765071038fcf702122
1+
configured_endpoints: 27
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nen-labs%2Fsteel-c74e7376ab152155b24a3f8f21fa43709cbc94b6e8b33a6ed48a23a62f976d1a.yml
3+
openapi_spec_hash: f430c7e1c4f367245df8145df75fb443
4+
config_hash: e88d2c04584e96ef1e76c72156c3c186

CHANGELOG.md

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

3+
## 0.7.0 (2025-07-12)
4+
5+
Full Changelog: [v0.6.0...v0.7.0](https://github.com/steel-dev/steel-python/compare/v0.6.0...v0.7.0)
6+
7+
### Features
8+
9+
* **api:** api update ([7c3a807](https://github.com/steel-dev/steel-python/commit/7c3a8071ad39d7d371c68bc5632630aba52d1126))
10+
11+
12+
### Bug Fixes
13+
14+
* **client:** don't send Content-Type header on GET requests ([3663409](https://github.com/steel-dev/steel-python/commit/366340962d2ad7252fc25b70399293cb2b8687aa))
15+
* **parsing:** correctly handle nested discriminated unions ([d88c056](https://github.com/steel-dev/steel-python/commit/d88c05684f94be0249181c40365ae1605e65c9d8))
16+
17+
18+
### Chores
19+
20+
* **internal:** bump pinned h11 dep ([f79c166](https://github.com/steel-dev/steel-python/commit/f79c16621c3a9e5b902f28294a82638f7165cf49))
21+
* **package:** mark python 3.13 as supported ([a70bc61](https://github.com/steel-dev/steel-python/commit/a70bc614385d48955991218901b9ae8b0ca2ae1e))
22+
* **readme:** fix version rendering on pypi ([14b7820](https://github.com/steel-dev/steel-python/commit/14b7820aff48a061d6eeb74df86ec2e896d5e25c))
23+
324
## 0.6.0 (2025-07-02)
425

526
Full Changelog: [v0.5.0...v0.6.0](https://github.com/steel-dev/steel-python/compare/v0.5.0...v0.6.0)

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Steel Python API library
22

3-
[![PyPI version](<https://img.shields.io/pypi/v/steel-sdk.svg?label=pypi%20(stable)>)](https://pypi.org/project/steel-sdk/)
3+
<!-- prettier-ignore -->
4+
[![PyPI version](https://img.shields.io/pypi/v/steel-sdk.svg?label=pypi%20(stable))](https://pypi.org/project/steel-sdk/)
45

56
The Steel Python library provides convenient access to the Steel REST API from any Python 3.8+
67
application. The library includes type definitions for all request params and response fields,

api.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,16 @@ Methods:
8484
- <code title="get /v1/sessions/{sessionId}/files/{path}">client.sessions.files.<a href="./src/steel/resources/sessions/files.py">download</a>(path, \*, session_id) -> BinaryAPIResponse</code>
8585
- <code title="get /v1/sessions/{sessionId}/files.zip">client.sessions.files.<a href="./src/steel/resources/sessions/files.py">download_archive</a>(session_id) -> BinaryAPIResponse</code>
8686
- <code title="post /v1/sessions/{sessionId}/files">client.sessions.files.<a href="./src/steel/resources/sessions/files.py">upload</a>(session_id, \*\*<a href="src/steel/types/sessions/file_upload_params.py">params</a>) -> <a href="./src/steel/types/file.py">File</a></code>
87+
88+
## Captchas
89+
90+
Types:
91+
92+
```python
93+
from steel.types.sessions import CaptchaSolveImageResponse, CaptchaStatusResponse
94+
```
95+
96+
Methods:
97+
98+
- <code title="post /v1/sessions/{sessionId}/captchas/solve-image">client.sessions.captchas.<a href="./src/steel/resources/sessions/captchas.py">solve_image</a>(session_id, \*\*<a href="src/steel/types/sessions/captcha_solve_image_params.py">params</a>) -> <a href="./src/steel/types/sessions/captcha_solve_image_response.py">CaptchaSolveImageResponse</a></code>
99+
- <code title="get /v1/sessions/{sessionId}/captchas/status">client.sessions.captchas.<a href="./src/steel/resources/sessions/captchas.py">status</a>(session_id) -> <a href="./src/steel/types/sessions/captcha_status_response.py">CaptchaStatusResponse</a></code>

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "steel-sdk"
3-
version = "0.6.0"
3+
version = "0.7.0"
44
description = "The official Python library for the steel API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -24,6 +24,7 @@ classifiers = [
2424
"Programming Language :: Python :: 3.10",
2525
"Programming Language :: Python :: 3.11",
2626
"Programming Language :: Python :: 3.12",
27+
"Programming Language :: Python :: 3.13",
2728
"Operating System :: OS Independent",
2829
"Operating System :: POSIX",
2930
"Operating System :: MacOS",
@@ -38,7 +39,7 @@ Homepage = "https://github.com/steel-dev/steel-python"
3839
Repository = "https://github.com/steel-dev/steel-python"
3940

4041
[project.optional-dependencies]
41-
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.6"]
42+
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"]
4243

4344
[tool.rye]
4445
managed = true

requirements-dev.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ filelock==3.12.4
4848
frozenlist==1.6.2
4949
# via aiohttp
5050
# via aiosignal
51-
h11==0.14.0
51+
h11==0.16.0
5252
# via httpcore
53-
httpcore==1.0.2
53+
httpcore==1.0.9
5454
# via httpx
5555
httpx==0.28.1
5656
# via httpx-aiohttp
5757
# via respx
5858
# via steel-sdk
59-
httpx-aiohttp==0.1.6
59+
httpx-aiohttp==0.1.8
6060
# via steel-sdk
6161
idna==3.4
6262
# via anyio

requirements.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ exceptiongroup==1.2.2
3636
frozenlist==1.6.2
3737
# via aiohttp
3838
# via aiosignal
39-
h11==0.14.0
39+
h11==0.16.0
4040
# via httpcore
41-
httpcore==1.0.2
41+
httpcore==1.0.9
4242
# via httpx
4343
httpx==0.28.1
4444
# via httpx-aiohttp
4545
# via steel-sdk
46-
httpx-aiohttp==0.1.6
46+
httpx-aiohttp==0.1.8
4747
# via steel-sdk
4848
idna==3.4
4949
# via anyio

src/steel/_base_client.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,15 @@ def _build_request(
529529
# work around https://github.com/encode/httpx/discussions/2880
530530
kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")}
531531

532+
is_body_allowed = options.method.lower() != "get"
533+
534+
if is_body_allowed:
535+
kwargs["json"] = json_data if is_given(json_data) else None
536+
kwargs["files"] = files
537+
else:
538+
headers.pop("Content-Type", None)
539+
kwargs.pop("data", None)
540+
532541
# TODO: report this error to httpx
533542
return self._client.build_request( # pyright: ignore[reportUnknownMemberType]
534543
headers=headers,
@@ -540,8 +549,6 @@ def _build_request(
540549
# so that passing a `TypedDict` doesn't cause an error.
541550
# https://github.com/microsoft/pyright/issues/3526#event-6715453066
542551
params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None,
543-
json=json_data if is_given(json_data) else None,
544-
files=files,
545552
**kwargs,
546553
)
547554

src/steel/_models.py

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

33
import os
44
import inspect
5-
from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, cast
5+
from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, Optional, cast
66
from datetime import date, datetime
77
from typing_extensions import (
8+
List,
89
Unpack,
910
Literal,
1011
ClassVar,
@@ -366,7 +367,7 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object:
366367
if type_ is None:
367368
raise RuntimeError(f"Unexpected field type is None for {key}")
368369

369-
return construct_type(value=value, type_=type_)
370+
return construct_type(value=value, type_=type_, metadata=getattr(field, "metadata", None))
370371

371372

372373
def is_basemodel(type_: type) -> bool:
@@ -420,7 +421,7 @@ def construct_type_unchecked(*, value: object, type_: type[_T]) -> _T:
420421
return cast(_T, construct_type(value=value, type_=type_))
421422

422423

423-
def construct_type(*, value: object, type_: object) -> object:
424+
def construct_type(*, value: object, type_: object, metadata: Optional[List[Any]] = None) -> object:
424425
"""Loose coercion to the expected type with construction of nested values.
425426
426427
If the given value does not match the expected type then it is returned as-is.
@@ -438,8 +439,10 @@ def construct_type(*, value: object, type_: object) -> object:
438439
type_ = type_.__value__ # type: ignore[unreachable]
439440

440441
# unwrap `Annotated[T, ...]` -> `T`
441-
if is_annotated_type(type_):
442-
meta: tuple[Any, ...] = get_args(type_)[1:]
442+
if metadata is not None:
443+
meta: tuple[Any, ...] = tuple(metadata)
444+
elif is_annotated_type(type_):
445+
meta = get_args(type_)[1:]
443446
type_ = extract_type_arg(type_, 0)
444447
else:
445448
meta = tuple()

0 commit comments

Comments
 (0)