Skip to content

Commit b72f541

Browse files
release: 7.1.1 (#114)
* chore: add Python 3.14 classifier and testing * fix: ensure streams are always closed * chore(deps): mypy 1.18.1 has a regression, pin to 1.17 * codegen metadata * release: 7.1.1 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 30e8fcd commit b72f541

8 files changed

Lines changed: 40 additions & 21 deletions

File tree

.release-please-manifest.json

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

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 77
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-ef9e41c6e60cc3c2a745acf0f0b6130555b4f88fd8b092eb11c84418b2e16481.yml
3-
openapi_spec_hash: f9a7f141a9bbae15c1e240ed6a3a3601
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-b232056686e3541154faff791bd660463ba8564947f9c01b8eedea6b6f606f65.yml
3+
openapi_spec_hash: d5992a85e943a1bc21f81d70b86109c9
44
config_hash: 3ec521d062b05b81c22bc1a25bfe3d02

CHANGELOG.md

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

3+
## 7.1.1 (2025-12-02)
4+
5+
Full Changelog: [v7.1.0...v7.1.1](https://github.com/trycourier/courier-python/compare/v7.1.0...v7.1.1)
6+
7+
### Bug Fixes
8+
9+
* ensure streams are always closed ([0b75285](https://github.com/trycourier/courier-python/commit/0b75285d6addee258564f8b5a900b17248d2b1b7))
10+
11+
12+
### Chores
13+
14+
* add Python 3.14 classifier and testing ([b712bc3](https://github.com/trycourier/courier-python/commit/b712bc3294d19db94aa6aae15b4bb5693e57e2c4))
15+
* **deps:** mypy 1.18.1 has a regression, pin to 1.17 ([8fb8ad7](https://github.com/trycourier/courier-python/commit/8fb8ad70a33482ae03cccd8de913b6c3b79101bf))
16+
317
## 7.1.0 (2025-11-18)
418

519
Full Changelog: [v7.0.1...v7.1.0](https://github.com/trycourier/courier-python/compare/v7.0.1...v7.1.0)

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "trycourier"
3-
version = "7.1.0"
3+
version = "7.1.1"
44
description = "The official Python library for the Courier API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -24,6 +24,7 @@ classifiers = [
2424
"Programming Language :: Python :: 3.11",
2525
"Programming Language :: Python :: 3.12",
2626
"Programming Language :: Python :: 3.13",
27+
"Programming Language :: Python :: 3.14",
2728
"Operating System :: OS Independent",
2829
"Operating System :: POSIX",
2930
"Operating System :: MacOS",
@@ -45,7 +46,7 @@ managed = true
4546
# version pins are in requirements-dev.lock
4647
dev-dependencies = [
4748
"pyright==1.1.399",
48-
"mypy",
49+
"mypy==1.17",
4950
"respx",
5051
"pytest",
5152
"pytest-asyncio",

requirements-dev.lock

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ mdurl==0.1.2
7272
multidict==6.4.4
7373
# via aiohttp
7474
# via yarl
75-
mypy==1.14.1
75+
mypy==1.17.0
7676
mypy-extensions==1.0.0
7777
# via mypy
7878
nodeenv==1.8.0
@@ -81,6 +81,8 @@ nox==2023.4.22
8181
packaging==23.2
8282
# via nox
8383
# via pytest
84+
pathspec==0.12.1
85+
# via mypy
8486
platformdirs==3.11.0
8587
# via virtualenv
8688
pluggy==1.5.0

requirements.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,21 @@ multidict==6.4.4
5555
propcache==0.3.1
5656
# via aiohttp
5757
# via yarl
58-
pydantic==2.11.9
58+
pydantic==2.12.5
5959
# via trycourier
60-
pydantic-core==2.33.2
60+
pydantic-core==2.41.5
6161
# via pydantic
6262
sniffio==1.3.0
6363
# via anyio
6464
# via trycourier
65-
typing-extensions==4.12.2
65+
typing-extensions==4.15.0
6666
# via anyio
6767
# via multidict
6868
# via pydantic
6969
# via pydantic-core
7070
# via trycourier
7171
# via typing-inspection
72-
typing-inspection==0.4.1
72+
typing-inspection==0.4.2
7373
# via pydantic
7474
yarl==1.20.0
7575
# via aiohttp

src/courier/_streaming.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@ def __stream__(self) -> Iterator[_T]:
5454
process_data = self._client._process_response_data
5555
iterator = self._iter_events()
5656

57-
for sse in iterator:
58-
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
59-
60-
# As we might not fully consume the response stream, we need to close it explicitly
61-
response.close()
57+
try:
58+
for sse in iterator:
59+
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
60+
finally:
61+
# Ensure the response is closed even if the consumer doesn't read all data
62+
response.close()
6263

6364
def __enter__(self) -> Self:
6465
return self
@@ -117,11 +118,12 @@ async def __stream__(self) -> AsyncIterator[_T]:
117118
process_data = self._client._process_response_data
118119
iterator = self._iter_events()
119120

120-
async for sse in iterator:
121-
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
122-
123-
# As we might not fully consume the response stream, we need to close it explicitly
124-
await response.aclose()
121+
try:
122+
async for sse in iterator:
123+
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
124+
finally:
125+
# Ensure the response is closed even if the consumer doesn't read all data
126+
await response.aclose()
125127

126128
async def __aenter__(self) -> Self:
127129
return self

src/courier/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "courier"
4-
__version__ = "7.1.0" # x-release-please-version
4+
__version__ = "7.1.1" # x-release-please-version

0 commit comments

Comments
 (0)