-
Notifications
You must be signed in to change notification settings - Fork 0
release: 4.1.0 #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
release: 4.1.0 #62
Conversation
6c2b6c5 to
a594c75
Compare
85e4dfe to
1322c80
Compare
2bb4c49 to
7e69125
Compare
7cdfb0a to
ca310cd
Compare
fix(client): mark some request bodies as optional
3bdb00f to
3ad7f25
Compare
1be6ce9 to
97b7254
Compare
35a4088 to
bc25b84
Compare
ef0d130 to
08062c4
Compare
9257acd to
b41543a
Compare
df1d708 to
69a44e3
Compare
cf36bae to
bba1424
Compare
e0b03f0 to
3d90dff
Compare
84a0625 to
db19786
Compare
359644d to
21a20b3
Compare
f0262a9 to
3524f04
Compare
3524f04 to
9bd1046
Compare
9bd1046 to
f263f8c
Compare
f263f8c to
5cddd6f
Compare
5cddd6f to
590d7c8
Compare
590d7c8 to
07aac58
Compare
07aac58 to
d01a3f6
Compare
d01a3f6 to
1e2a487
Compare
1e2a487 to
1efa099
Compare
1efa099 to
d60e2bc
Compare
d60e2bc to
2df8211
Compare
| line-length = 120 | ||
| output-format = "grouped" | ||
| target-version = "py37" | ||
| target-version = "py38" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ruff target-version inconsistent with minimum Python version
Low Severity
The ruff target-version was changed from "py37" to "py38", but the project's requires-python was updated to ">= 3.9" and pyright's pythonVersion is set to "3.9". The ruff target should be "py39" to match. This inconsistency means ruff applies formatting/linting rules for Python 3.8 compatibility even though the project no longer supports it — for example, the FA102 rule may unnecessarily flag missing from __future__ import annotations in files that only need 3.9+ support.
Additional Locations (2)
2df8211 to
74bef2f
Compare
| request = self._build_request(options, retries_taken=retries_taken) | ||
| self._prepare_request(request) | ||
| retries_taken = 0 | ||
| for retries_taken in range(max_retries + 1): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Iterative retry loop breaks math.inf unlimited retries
Medium Severity
The refactored retry logic uses range(max_retries + 1) which crashes with TypeError when max_retries is math.inf, since range() requires integer arguments. The old recursive approach handled this correctly because it only compared remaining_retries > 0. The error message in __init__ still explicitly recommends math.inf for unlimited retries, making this a documented-but-broken feature.
Additional Locations (2)
74bef2f to
7be0f6c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| return o.isoformat() | ||
| if isinstance(o, pydantic.BaseModel): | ||
| return model_dump(o, exclude_unset=True, mode="json", by_alias=True) | ||
| return super().default(o) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Custom JSON encoder handles datetime but not date
Low Severity
The new _CustomEncoder handles datetime serialization via isinstance(o, datetime) but does not handle date objects. Since datetime is a subclass of date (not the other way around), pure date values will fall through to super().default(o) and raise a TypeError. Given the stated goal of "extended type support," omitting date while including datetime appears to be an oversight. If any date objects survive the transform pipeline and reach openapi_dumps, serialization will fail.


Automated Release PR
4.1.0 (2026-02-13)
Full Changelog: v4.0.0...v4.1.0
Features
NotGivenfor body (#67) (3ad7f25)X-Stainless-Read-Timeoutheader (#63) (a594c75)Bug Fixes
model_dumpandmodel_dump_jsonfor Pydantic v1 (898ca7b)Chores
httpx-aiohttpversion to 0.1.9 (7aeb4c8)actions/github-script(bdad5ed)api.mdfiles (034e708)--fixargument to lint script (0b1e68e)pyproject.tomlfile (f87b268)actions/checkoutversion (54d6bd9)get_platformtest (ef07d85)Documentation
This pull request is managed by Stainless's GitHub App.
The semver version number is based on included commit messages. Alternatively, you can manually set the version number in the title of this pull request.
For a better experience, it is recommended to use either rebase-merge or squash-merge when merging this pull request.
🔗 Stainless website
📚 Read the docs
🙋 Reach out for help or questions
Note
High Risk
Touches core request/response, retry, streaming, and serialization paths, so regressions could affect all API calls (timeouts, headers, body encoding, pagination, and resource loading). Tooling/CI/docs changes are low risk, but the client refactor and new HTTP backend increase overall risk.
Overview
Bumps the package to v4.1.0 and raises the minimum supported Python version to 3.9, adding
aiohttpas an optional extra and updating lockfiles/tooling (Rye, ruff/pyright/mypy, parallel pytest).Significantly refactors the core client layer (
_base_client,_client,_models,_types,_utils) to add anaiohttp-backed async HTTP client (DefaultAioHttpClient), support raw/binary request bodies viacontent, addfollow_redirectsandX-Stainless-Read-Timeouthandling, improve retry/idempotency behavior, close SSE streams reliably, broaden JSON content-type handling, and extend pagination to support JSON-body pagination.CI/dev experience is updated with new build+artifact upload in GitHub Actions, job timeouts/branch filters, devcontainer Node feature, lint
--fix, safer bootstrap prompts, and assorted documentation/API doc updates (including new aiohttp usage guidance).Written by Cursor Bugbot for commit 7be0f6c. This will update automatically on new commits. Configure here.