Skip to content

Commit a6934b7

Browse files
release: 1.7.1 (#50)
* chore(tests): run tests in parallel * fix(client): correctly parse binary response | stream * release: 1.7.1 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent a4679d8 commit a6934b7

File tree

6 files changed

+38
-6
lines changed

6 files changed

+38
-6
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-
".": "1.7.0"
2+
".": "1.7.1"
33
}

CHANGELOG.md

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

3+
## 1.7.1 (2025-06-13)
4+
5+
Full Changelog: [v1.7.0...v1.7.1](https://github.com/knocklabs/knock-python/compare/v1.7.0...v1.7.1)
6+
7+
### Bug Fixes
8+
9+
* **client:** correctly parse binary response | stream ([86075af](https://github.com/knocklabs/knock-python/commit/86075af572ff7b0548a48f0fb741f8a3a3eca30a))
10+
11+
12+
### Chores
13+
14+
* **tests:** run tests in parallel ([c6d9045](https://github.com/knocklabs/knock-python/commit/c6d90450c3c7923b81e2ddb74a249577b1571e8f))
15+
316
## 1.7.0 (2025-06-12)
417

518
Full Changelog: [v1.6.0...v1.7.0](https://github.com/knocklabs/knock-python/compare/v1.6.0...v1.7.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 = "knockapi"
3-
version = "1.7.0"
3+
version = "1.7.1"
44
description = "The official Python library for the knock API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -54,6 +54,7 @@ dev-dependencies = [
5454
"importlib-metadata>=6.7.0",
5555
"rich>=13.7.1",
5656
"nest_asyncio==1.6.0",
57+
"pytest-xdist>=3.6.1",
5758
]
5859

5960
[tool.rye.scripts]
@@ -125,7 +126,7 @@ replacement = '[\1](https://github.com/knocklabs/knock-python/tree/main/\g<2>)'
125126

126127
[tool.pytest.ini_options]
127128
testpaths = ["tests"]
128-
addopts = "--tb=short"
129+
addopts = "--tb=short -n auto"
129130
xfail_strict = true
130131
asyncio_mode = "auto"
131132
asyncio_default_fixture_loop_scope = "session"

requirements-dev.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ distro==1.8.0
3030
exceptiongroup==1.2.2
3131
# via anyio
3232
# via pytest
33+
execnet==2.1.1
34+
# via pytest-xdist
3335
filelock==3.12.4
3436
# via virtualenv
3537
h11==0.14.0
@@ -72,7 +74,9 @@ pygments==2.18.0
7274
pyright==1.1.399
7375
pytest==8.3.3
7476
# via pytest-asyncio
77+
# via pytest-xdist
7578
pytest-asyncio==0.24.0
79+
pytest-xdist==3.7.0
7680
python-dateutil==2.8.2
7781
# via time-machine
7882
pytz==2023.3.post1

src/knockapi/_base_client.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,14 @@ def _process_response(
10711071
) -> ResponseT:
10721072
origin = get_origin(cast_to) or cast_to
10731073

1074-
if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse):
1074+
if (
1075+
inspect.isclass(origin)
1076+
and issubclass(origin, BaseAPIResponse)
1077+
# we only want to actually return the custom BaseAPIResponse class if we're
1078+
# returning the raw response, or if we're not streaming SSE, as if we're streaming
1079+
# SSE then `cast_to` doesn't actively reflect the type we need to parse into
1080+
and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER)))
1081+
):
10751082
if not issubclass(origin, APIResponse):
10761083
raise TypeError(f"API Response types must subclass {APIResponse}; Received {origin}")
10771084

@@ -1574,7 +1581,14 @@ async def _process_response(
15741581
) -> ResponseT:
15751582
origin = get_origin(cast_to) or cast_to
15761583

1577-
if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse):
1584+
if (
1585+
inspect.isclass(origin)
1586+
and issubclass(origin, BaseAPIResponse)
1587+
# we only want to actually return the custom BaseAPIResponse class if we're
1588+
# returning the raw response, or if we're not streaming SSE, as if we're streaming
1589+
# SSE then `cast_to` doesn't actively reflect the type we need to parse into
1590+
and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER)))
1591+
):
15781592
if not issubclass(origin, AsyncAPIResponse):
15791593
raise TypeError(f"API Response types must subclass {AsyncAPIResponse}; Received {origin}")
15801594

src/knockapi/_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__ = "knockapi"
4-
__version__ = "1.7.0" # x-release-please-version
4+
__version__ = "1.7.1" # x-release-please-version

0 commit comments

Comments
 (0)