Skip to content

Commit ca268a3

Browse files
release: 2.3.2-rc1 (#247)
* chore: update github action * chore(internal): change ci workflow machines * fix: avoid newer type syntax * chore(internal): update pyright exclude list * chore(internal): add Sequence related utils * feat(types): replace List[str] with SequenceNotStr in params * feat: improve future compat with pydantic v3 * chore(internal): move mypy configurations to `pyproject.toml` file * docs(api): updates to API spec * fix(client): custom patch to prepare pydantic v3 * chore(tests): simplify `get_platform` test `nest_asyncio` is archived and broken on some platforms so it's not worth keeping in our test suite. * codegen metadata * codegen metadata * docs(api): updates to API spec * chore(client): update stop params in stream/parse to match chat * chore(client): format * release: 2.3.2-rc1 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: David Meadows <dmeadows@stainless.com>
1 parent a623709 commit ca268a3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1075
-348
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ jobs:
3636
run: ./scripts/lint
3737

3838
build:
39-
if: github.repository == 'stainless-sdks/writer-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
39+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
4040
timeout-minutes: 10
4141
name: build
4242
permissions:
4343
contents: read
4444
id-token: write
45-
runs-on: depot-ubuntu-24.04
45+
runs-on: ${{ github.repository == 'stainless-sdks/writer-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
4646
steps:
4747
- uses: actions/checkout@v4
4848

@@ -61,12 +61,14 @@ jobs:
6161
run: rye build
6262

6363
- name: Get GitHub OIDC Token
64+
if: github.repository == 'stainless-sdks/writer-python'
6465
id: github-oidc
6566
uses: actions/github-script@v6
6667
with:
6768
script: core.setOutput('github_token', await core.getIDToken());
6869

6970
- name: Upload tarball
71+
if: github.repository == 'stainless-sdks/writer-python'
7072
env:
7173
URL: https://pkg.stainless.com/s
7274
AUTH: ${{ steps.github-oidc.outputs.github_token }}

.release-please-manifest.json

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

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 33
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/writerai%2Fwriter-9e04c6a51c55704029c529f2917d0e2b976cb7b6595128697db031ad7bd61a63.yml
3-
openapi_spec_hash: e8a95522dd13ffe4633cccc34bbd651d
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/writerai%2Fwriter-3f87c8deb39e443022f2e04252994a6c9d25473872503edf9eec00d874576b2d.yml
3+
openapi_spec_hash: 5de52bf1d78e00b13a04f6e9ce2f2fb5
44
config_hash: 7a38bab086b53b43d2a719cb4d883264

CHANGELOG.md

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

3+
## 2.3.2-rc1 (2025-09-11)
4+
5+
Full Changelog: [v2.3.1...v2.3.2-rc1](https://github.com/writer/writer-python/compare/v2.3.1...v2.3.2-rc1)
6+
7+
### Features
8+
9+
* improve future compat with pydantic v3 ([74315c4](https://github.com/writer/writer-python/commit/74315c493b0f439614d492378ae34fc0728c8bb1))
10+
* **types:** replace List[str] with SequenceNotStr in params ([2c1a7de](https://github.com/writer/writer-python/commit/2c1a7de9a61c13b20b7734ba4f87da6ca7771e30))
11+
12+
13+
### Bug Fixes
14+
15+
* avoid newer type syntax ([4aec590](https://github.com/writer/writer-python/commit/4aec5902d7329039817f2049c299458fa8eb1381))
16+
* **client:** custom patch to prepare pydantic v3 ([8a26e46](https://github.com/writer/writer-python/commit/8a26e46ec365ea9905be7531bd80ebd9c74b129d))
17+
18+
19+
### Chores
20+
21+
* **client:** format ([fa024a5](https://github.com/writer/writer-python/commit/fa024a58b0bc88104744f17279f5ca3819f28284))
22+
* **client:** update stop params in stream/parse to match chat ([8920408](https://github.com/writer/writer-python/commit/8920408285a5adfe7d0a416bc4539e42326b180e))
23+
* **internal:** add Sequence related utils ([40901e2](https://github.com/writer/writer-python/commit/40901e2ad2c45f6d8258df2e0666cc88c6c1fa0f))
24+
* **internal:** change ci workflow machines ([84dcbed](https://github.com/writer/writer-python/commit/84dcbedf80ab51ed3d4379839682b0c584041bb9))
25+
* **internal:** move mypy configurations to `pyproject.toml` file ([2518950](https://github.com/writer/writer-python/commit/251895049da0d7302cb37c599b0ca23dd0b6d470))
26+
* **internal:** update pyright exclude list ([815b794](https://github.com/writer/writer-python/commit/815b794df77ae9e20842db345988c93f1f077ee7))
27+
* **tests:** simplify `get_platform` test ([f1ddbb2](https://github.com/writer/writer-python/commit/f1ddbb236dbc6c1780eb1120e2fba20c0e4c921a))
28+
* update github action ([d81d1ec](https://github.com/writer/writer-python/commit/d81d1ec4fe56a7761fd5c3ad2afc65e8b12954fd))
29+
30+
31+
### Documentation
32+
33+
* **api:** updates to API spec ([daf31d5](https://github.com/writer/writer-python/commit/daf31d587a7bc32c9debe961ac870d08fedef865))
34+
* **api:** updates to API spec ([5f8a109](https://github.com/writer/writer-python/commit/5f8a109801baff44a41313e2a4774ecc2c7e70bd))
35+
336
## 2.3.1 (2025-08-20)
437

538
Full Changelog: [v2.3.1-rc1...v2.3.1](https://github.com/writer/writer-python/compare/v2.3.1-rc1...v2.3.1)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ To install the package from PyPI, use `pip`:
1919

2020
```sh
2121
# install from PyPI
22-
pip install writer-sdk
22+
pip install --pre writer-sdk
2323
```
2424

2525
## Prequisites
@@ -116,7 +116,7 @@ You can enable this by installing `aiohttp`:
116116

117117
```sh
118118
# install from PyPI
119-
pip install writer-sdk[aiohttp]
119+
pip install --pre writer-sdk[aiohttp]
120120
```
121121

122122
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:

mypy.ini

Lines changed: 0 additions & 50 deletions
This file was deleted.

pyproject.toml

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "writer-sdk"
3-
version = "2.3.1"
3+
version = "2.3.2-rc1"
44
description = "The official Python library for the writer API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -151,6 +151,7 @@ exclude = [
151151
"_dev",
152152
".venv",
153153
".nox",
154+
".git",
154155
]
155156

156157
reportImplicitOverride = true
@@ -159,6 +160,58 @@ reportOverlappingOverload = false
159160
reportImportCycles = false
160161
reportPrivateUsage = false
161162

163+
[tool.mypy]
164+
pretty = true
165+
show_error_codes = true
166+
167+
# Exclude _files.py because mypy isn't smart enough to apply
168+
# the correct type narrowing and as this is an internal module
169+
# it's fine to just use Pyright.
170+
#
171+
# We also exclude our `tests` as mypy doesn't always infer
172+
# types correctly and Pyright will still catch any type errors.
173+
exclude = ['src/writerai/_files.py', '_dev/.*.py', 'tests/.*']
174+
175+
strict_equality = true
176+
implicit_reexport = true
177+
check_untyped_defs = true
178+
no_implicit_optional = true
179+
180+
warn_return_any = true
181+
warn_unreachable = true
182+
warn_unused_configs = true
183+
184+
# Turn these options off as it could cause conflicts
185+
# with the Pyright options.
186+
warn_unused_ignores = false
187+
warn_redundant_casts = false
188+
189+
disallow_any_generics = true
190+
disallow_untyped_defs = true
191+
disallow_untyped_calls = true
192+
disallow_subclassing_any = true
193+
disallow_incomplete_defs = true
194+
disallow_untyped_decorators = true
195+
cache_fine_grained = true
196+
197+
# By default, mypy reports an error if you assign a value to the result
198+
# of a function call that doesn't return anything. We do this in our test
199+
# cases:
200+
# ```
201+
# result = ...
202+
# assert result is None
203+
# ```
204+
# Changing this codegen to make mypy happy would increase complexity
205+
# and would not be worth it.
206+
disable_error_code = "func-returns-value,overload-cannot-match"
207+
208+
# https://github.com/python/mypy/issues/12162
209+
[[tool.mypy.overrides]]
210+
module = "black.files.*"
211+
ignore_errors = true
212+
ignore_missing_imports = true
213+
214+
162215
[tool.ruff]
163216
line-length = 120
164217
output-format = "grouped"

requirements-dev.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ anyio==4.4.0
2424
# via writer-sdk
2525
argcomplete==3.1.2
2626
# via nox
27+
asttokens==3.0.0
28+
# via inline-snapshot
2729
async-timeout==5.0.1
2830
# via aiohttp
2931
attrs==25.3.0
3032
# via aiohttp
31-
asttokens==3.0.0
32-
# via inline-snapshot
3333
certifi==2023.7.22
3434
# via httpcore
3535
# via httpx
@@ -43,10 +43,10 @@ distro==1.8.0
4343
exceptiongroup==1.2.2
4444
# via anyio
4545
# via pytest
46-
executing==2.2.0
47-
# via inline-snapshot
4846
execnet==2.1.1
4947
# via pytest-xdist
48+
executing==2.2.0
49+
# via inline-snapshot
5050
filelock==3.12.4
5151
# via virtualenv
5252
frozenlist==1.6.2

requirements.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ idna==3.4
4949
# via anyio
5050
# via httpx
5151
# via yarl
52+
jiter==0.8.2
53+
# via writer-sdk
5254
multidict==6.4.4
5355
# via aiohttp
5456
# via yarl
5557
propcache==0.3.1
5658
# via aiohttp
5759
# via yarl
58-
jiter==0.8.2
59-
# via writer-sdk
6060
pydantic==2.10.3
6161
# via writer-sdk
6262
pydantic-core==2.27.1

src/writerai/_base_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
ModelBuilderProtocol,
6161
)
6262
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
63-
from ._compat import PYDANTIC_V2, model_copy, model_dump
63+
from ._compat import PYDANTIC_V1, model_copy, model_dump
6464
from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type
6565
from ._response import (
6666
APIResponse,
@@ -233,7 +233,7 @@ def _set_private_attributes(
233233
model: Type[_T],
234234
options: FinalRequestOptions,
235235
) -> None:
236-
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
236+
if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
237237
self.__pydantic_private__ = {}
238238

239239
self._model = model
@@ -321,7 +321,7 @@ def _set_private_attributes(
321321
client: AsyncAPIClient,
322322
options: FinalRequestOptions,
323323
) -> None:
324-
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
324+
if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
325325
self.__pydantic_private__ = {}
326326

327327
self._model = model

0 commit comments

Comments
 (0)