Skip to content

Commit 2868990

Browse files
authored
Merge pull request #115 from steel-dev/release-please--branches--main--changes--next
release: 0.5.0
2 parents 39cdda9 + a9a81fe commit 2868990

20 files changed

+347
-253
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@ on:
77
- 'integrated/**'
88
- 'stl-preview-head/**'
99
- 'stl-preview-base/**'
10+
pull_request:
11+
branches-ignore:
12+
- 'stl-preview-head/**'
13+
- 'stl-preview-base/**'
1014

1115
jobs:
1216
lint:
1317
timeout-minutes: 10
1418
name: lint
1519
runs-on: ${{ github.repository == 'stainless-sdks/steel-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
20+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
1621
steps:
1722
- uses: actions/checkout@v4
1823

@@ -31,7 +36,7 @@ jobs:
3136
run: ./scripts/lint
3237

3338
upload:
34-
if: github.repository == 'stainless-sdks/steel-python'
39+
if: github.repository == 'stainless-sdks/steel-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
3540
timeout-minutes: 10
3641
name: upload
3742
permissions:
@@ -58,6 +63,7 @@ jobs:
5863
timeout-minutes: 10
5964
name: test
6065
runs-on: ${{ github.repository == 'stainless-sdks/steel-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
66+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
6167
steps:
6268
- uses: actions/checkout@v4
6369

.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.4.0"
2+
".": "0.5.0"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 25
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nen-labs%2Fsteel-d5a9cdf80ea29558c755cdebab1f876a01bbb6f6e7cd480b677b8b8313d6e92c.yml
3-
openapi_spec_hash: ac6ed4b57809802e0924cdf97ca92102
4-
config_hash: 8fee9983d818d458fca9da01d2013f05
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nen-labs%2Fsteel-f81cef6f87adc0530d9bc21e8d47c95aadef9d5bc3c282837ae0ad41d7f71bac.yml
3+
openapi_spec_hash: 5b273b225abb80a969ea1485bf399745
4+
config_hash: 42515bf83f1e0e765071038fcf702122

CHANGELOG.md

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

3+
## 0.5.0 (2025-06-30)
4+
5+
Full Changelog: [v0.4.0...v0.5.0](https://github.com/steel-dev/steel-python/compare/v0.4.0...v0.5.0)
6+
7+
### Features
8+
9+
* **api:** api update ([978ad9c](https://github.com/steel-dev/steel-python/commit/978ad9cb86523cf783ca1c059b137d497422d626))
10+
* **client:** add support for aiohttp ([87bc6e2](https://github.com/steel-dev/steel-python/commit/87bc6e2420ea32f8336251fdda4c8353b8181f35))
11+
12+
13+
### Bug Fixes
14+
15+
* **ci:** correct conditional ([76d9c3f](https://github.com/steel-dev/steel-python/commit/76d9c3f76a200bc1d2e567bd0bf9decebf6998cc))
16+
* **ci:** release-doctor — report correct token name ([0500644](https://github.com/steel-dev/steel-python/commit/0500644bda4e13e3ff0975a3be3af641fb731dea))
17+
* **client:** correctly parse binary response | stream ([96bc0a5](https://github.com/steel-dev/steel-python/commit/96bc0a57989271ac57a5e916a9678798e8bc7123))
18+
* **tests:** fix: tests which call HTTP endpoints directly with the example parameters ([ffacf10](https://github.com/steel-dev/steel-python/commit/ffacf10a70b267665f65ee31aa176a2d0fdb0fca))
19+
20+
21+
### Chores
22+
23+
* **ci:** enable for pull requests ([4f581f1](https://github.com/steel-dev/steel-python/commit/4f581f14fac853d9ffb09aac7efcd4cba8e7e008))
24+
* **ci:** only run for pushes and fork pull requests ([51c348d](https://github.com/steel-dev/steel-python/commit/51c348d7d8d1811dbd054887b06a3a0fc582d61e))
25+
* **internal:** update conftest.py ([95540f2](https://github.com/steel-dev/steel-python/commit/95540f26791852e6a9864e4ebe12fb8762ed0241))
26+
* **readme:** update badges ([e210ee7](https://github.com/steel-dev/steel-python/commit/e210ee78b18dc19b9b39b67c2b37f16c855f0c58))
27+
* **tests:** add tests for httpx client instantiation & proxies ([ad4f8a1](https://github.com/steel-dev/steel-python/commit/ad4f8a1256746d265dd9a2c0a9bfca53fa4c61f3))
28+
* **tests:** run tests in parallel ([825c97f](https://github.com/steel-dev/steel-python/commit/825c97fc4b37a582267bf338b2640de17a254546))
29+
* **tests:** skip some failing tests on the latest python versions ([c64047c](https://github.com/steel-dev/steel-python/commit/c64047c3036b3054f1f466f7521db5f76d013c8d))
30+
31+
32+
### Documentation
33+
34+
* **client:** fix httpx.Timeout documentation reference ([2c5ba6f](https://github.com/steel-dev/steel-python/commit/2c5ba6f2f450b6b7a2172ee9dfcf9de93426773b))
35+
336
## 0.4.0 (2025-06-03)
437

538
Full Changelog: [v0.3.0...v0.4.0](https://github.com/steel-dev/steel-python/compare/v0.3.0...v0.4.0)

README.md

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

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

55
The Steel Python library provides convenient access to the Steel REST API from any Python 3.8+
66
application. The library includes type definitions for all request params and response fields,
@@ -64,6 +64,39 @@ asyncio.run(main())
6464

6565
Functionality between the synchronous and asynchronous clients is otherwise identical.
6666

67+
### With aiohttp
68+
69+
By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.
70+
71+
You can enable this by installing `aiohttp`:
72+
73+
```sh
74+
# install from PyPI
75+
pip install steel-sdk[aiohttp]
76+
```
77+
78+
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
79+
80+
```python
81+
import asyncio
82+
from steel import DefaultAioHttpClient
83+
from steel import AsyncSteel
84+
85+
86+
async def main() -> None:
87+
async with AsyncSteel(
88+
http_client=DefaultAioHttpClient(),
89+
) as client:
90+
session = await client.sessions.create(
91+
api_timeout=20000,
92+
use_proxy=True,
93+
)
94+
print(session.id)
95+
96+
97+
asyncio.run(main())
98+
```
99+
67100
## Using types
68101

69102
Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:
@@ -224,7 +257,7 @@ client.with_options(max_retries=5).sessions.create()
224257
### Timeouts
225258

226259
By default requests time out after 1 minute. You can configure this with a `timeout` option,
227-
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
260+
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
228261

229262
```python
230263
from steel import Steel

bin/check-release-environment

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
errors=()
44

55
if [ -z "${PYPI_TOKEN}" ]; then
6-
errors+=("The STEEL_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
6+
errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
77
fi
88

99
lenErrors=${#errors[@]}

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "steel-sdk"
3-
version = "0.4.0"
3+
version = "0.5.0"
44
description = "The official Python library for the steel API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -37,6 +37,8 @@ classifiers = [
3737
Homepage = "https://github.com/steel-dev/steel-python"
3838
Repository = "https://github.com/steel-dev/steel-python"
3939

40+
[project.optional-dependencies]
41+
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.6"]
4042

4143
[tool.rye]
4244
managed = true
@@ -54,6 +56,7 @@ dev-dependencies = [
5456
"importlib-metadata>=6.7.0",
5557
"rich>=13.7.1",
5658
"nest_asyncio==1.6.0",
59+
"pytest-xdist>=3.6.1",
5760
]
5861

5962
[tool.rye.scripts]
@@ -125,7 +128,7 @@ replacement = '[\1](https://github.com/steel-dev/steel-python/tree/main/\g<2>)'
125128

126129
[tool.pytest.ini_options]
127130
testpaths = ["tests"]
128-
addopts = "--tb=short"
131+
addopts = "--tb=short -n auto"
129132
xfail_strict = true
130133
asyncio_mode = "auto"
131134
asyncio_default_fixture_loop_scope = "session"

requirements-dev.lock

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,24 @@
1010
# universal: false
1111

1212
-e file:.
13+
aiohappyeyeballs==2.6.1
14+
# via aiohttp
15+
aiohttp==3.12.8
16+
# via httpx-aiohttp
17+
# via steel-sdk
18+
aiosignal==1.3.2
19+
# via aiohttp
1320
annotated-types==0.6.0
1421
# via pydantic
1522
anyio==4.4.0
1623
# via httpx
1724
# via steel-sdk
1825
argcomplete==3.1.2
1926
# via nox
27+
async-timeout==5.0.1
28+
# via aiohttp
29+
attrs==25.3.0
30+
# via aiohttp
2031
certifi==2023.7.22
2132
# via httpcore
2233
# via httpx
@@ -30,25 +41,37 @@ distro==1.8.0
3041
exceptiongroup==1.2.2
3142
# via anyio
3243
# via pytest
44+
execnet==2.1.1
45+
# via pytest-xdist
3346
filelock==3.12.4
3447
# via virtualenv
48+
frozenlist==1.6.2
49+
# via aiohttp
50+
# via aiosignal
3551
h11==0.14.0
3652
# via httpcore
3753
httpcore==1.0.2
3854
# via httpx
3955
httpx==0.28.1
56+
# via httpx-aiohttp
4057
# via respx
4158
# via steel-sdk
59+
httpx-aiohttp==0.1.6
60+
# via steel-sdk
4261
idna==3.4
4362
# via anyio
4463
# via httpx
64+
# via yarl
4565
importlib-metadata==7.0.0
4666
iniconfig==2.0.0
4767
# via pytest
4868
markdown-it-py==3.0.0
4969
# via rich
5070
mdurl==0.1.2
5171
# via markdown-it-py
72+
multidict==6.4.4
73+
# via aiohttp
74+
# via yarl
5275
mypy==1.14.1
5376
mypy-extensions==1.0.0
5477
# via mypy
@@ -63,6 +86,9 @@ platformdirs==3.11.0
6386
# via virtualenv
6487
pluggy==1.5.0
6588
# via pytest
89+
propcache==0.3.1
90+
# via aiohttp
91+
# via yarl
6692
pydantic==2.10.3
6793
# via steel-sdk
6894
pydantic-core==2.27.1
@@ -72,7 +98,9 @@ pygments==2.18.0
7298
pyright==1.1.399
7399
pytest==8.3.3
74100
# via pytest-asyncio
101+
# via pytest-xdist
75102
pytest-asyncio==0.24.0
103+
pytest-xdist==3.7.0
76104
python-dateutil==2.8.2
77105
# via time-machine
78106
pytz==2023.3.post1
@@ -93,12 +121,15 @@ tomli==2.0.2
93121
# via pytest
94122
typing-extensions==4.12.2
95123
# via anyio
124+
# via multidict
96125
# via mypy
97126
# via pydantic
98127
# via pydantic-core
99128
# via pyright
100129
# via steel-sdk
101130
virtualenv==20.24.5
102131
# via nox
132+
yarl==1.20.0
133+
# via aiohttp
103134
zipp==3.17.0
104135
# via importlib-metadata

requirements.lock

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,51 @@
1010
# universal: false
1111

1212
-e file:.
13+
aiohappyeyeballs==2.6.1
14+
# via aiohttp
15+
aiohttp==3.12.8
16+
# via httpx-aiohttp
17+
# via steel-sdk
18+
aiosignal==1.3.2
19+
# via aiohttp
1320
annotated-types==0.6.0
1421
# via pydantic
1522
anyio==4.4.0
1623
# via httpx
1724
# via steel-sdk
25+
async-timeout==5.0.1
26+
# via aiohttp
27+
attrs==25.3.0
28+
# via aiohttp
1829
certifi==2023.7.22
1930
# via httpcore
2031
# via httpx
2132
distro==1.8.0
2233
# via steel-sdk
2334
exceptiongroup==1.2.2
2435
# via anyio
36+
frozenlist==1.6.2
37+
# via aiohttp
38+
# via aiosignal
2539
h11==0.14.0
2640
# via httpcore
2741
httpcore==1.0.2
2842
# via httpx
2943
httpx==0.28.1
44+
# via httpx-aiohttp
45+
# via steel-sdk
46+
httpx-aiohttp==0.1.6
3047
# via steel-sdk
3148
idna==3.4
3249
# via anyio
3350
# via httpx
51+
# via yarl
52+
multidict==6.4.4
53+
# via aiohttp
54+
# via yarl
55+
propcache==0.3.1
56+
# via aiohttp
57+
# via yarl
3458
pydantic==2.10.3
3559
# via steel-sdk
3660
pydantic-core==2.27.1
@@ -40,6 +64,9 @@ sniffio==1.3.0
4064
# via steel-sdk
4165
typing-extensions==4.12.2
4266
# via anyio
67+
# via multidict
4368
# via pydantic
4469
# via pydantic-core
4570
# via steel-sdk
71+
yarl==1.20.0
72+
# via aiohttp

src/steel/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
UnprocessableEntityError,
2727
APIResponseValidationError,
2828
)
29-
from ._base_client import DefaultHttpxClient, DefaultAsyncHttpxClient
29+
from ._base_client import DefaultHttpxClient, DefaultAioHttpClient, DefaultAsyncHttpxClient
3030
from ._utils._logs import setup_logging as _setup_logging
3131

3232
__all__ = [
@@ -68,6 +68,7 @@
6868
"DEFAULT_CONNECTION_LIMITS",
6969
"DefaultHttpxClient",
7070
"DefaultAsyncHttpxClient",
71+
"DefaultAioHttpClient",
7172
]
7273

7374
if not _t.TYPE_CHECKING:

0 commit comments

Comments
 (0)