Skip to content

Commit 10e4c1e

Browse files
authored
Merge pull request #24 from onkernel/release-please--branches--main--changes--next
release: 0.6.0
2 parents 5d0076d + 834f1e9 commit 10e4c1e

Some content is hidden

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

41 files changed

+1525
-181
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ 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:

.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.5.0"
2+
".": "0.6.0"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 11
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-4502c65bef0843a6ae96d23bba075433af6bab49b55b544b1522f63e7881c00c.yml
3-
openapi_spec_hash: 3e67b77bbc8cd6155b8f66f3271f2643
4-
config_hash: c6bab7ac8da570a5abbcfb19db119b6b
1+
configured_endpoints: 15
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-5d4e11bc46eeecee7363d56a9dfe946acee997d5b352c2b0a50c20e742c54d2d.yml
3+
openapi_spec_hash: 333e53ad9c706296b9afdb8ff73bec8f
4+
config_hash: 0fdf285ddd8dee229fd84ea57df9080f

CHANGELOG.md

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

3+
## 0.6.0 (2025-06-18)
4+
5+
Full Changelog: [v0.5.0...v0.6.0](https://github.com/onkernel/kernel-python-sdk/compare/v0.5.0...v0.6.0)
6+
7+
### Features
8+
9+
* **api:** update via SDK Studio ([a811017](https://github.com/onkernel/kernel-python-sdk/commit/a81101709db8cb64b4cb6af6b749b55f86c24be6))
10+
* **api:** update via SDK Studio ([0c8937a](https://github.com/onkernel/kernel-python-sdk/commit/0c8937a4d8891357223c41fadcb05a6dd1f359b1))
11+
* **api:** update via SDK Studio ([dff3e39](https://github.com/onkernel/kernel-python-sdk/commit/dff3e3965fc710beadac2410a8a065d81b889d43))
12+
* **api:** update via SDK Studio ([d26c519](https://github.com/onkernel/kernel-python-sdk/commit/d26c519a798d8bf66baaef49af818b4108c3d92a))
13+
* **api:** update via SDK Studio ([ff07935](https://github.com/onkernel/kernel-python-sdk/commit/ff0793585ded6d9ea6c50947b9915f560221ed0f))
14+
* **api:** update via SDK Studio ([fe8d70b](https://github.com/onkernel/kernel-python-sdk/commit/fe8d70b1f0a0725c37c794aeb5a7a466bc13cdf3))
15+
* **api:** update via SDK Studio ([8073db6](https://github.com/onkernel/kernel-python-sdk/commit/8073db60205835e3abb6c494e24bb034283c55f2))
16+
* **api:** update via SDK Studio ([c1cdbcc](https://github.com/onkernel/kernel-python-sdk/commit/c1cdbcc6e555ab5fc7ecc229095ff7d0bf272e1a))
17+
* **api:** update via SDK Studio ([eed8e67](https://github.com/onkernel/kernel-python-sdk/commit/eed8e6769fd4982cadb277aa4c271c211992077a))
18+
* **api:** update via SDK Studio ([7699111](https://github.com/onkernel/kernel-python-sdk/commit/76991114e757c0c054e89d614619e38b2ec7d918))
19+
* **api:** update via SDK Studio ([d51332b](https://github.com/onkernel/kernel-python-sdk/commit/d51332b18af547affb215d9a7596bbbdb7ccff24))
20+
* **api:** update via SDK Studio ([452e83c](https://github.com/onkernel/kernel-python-sdk/commit/452e83c41d808b97e1ff54cdfa79d74abccfc9b5))
21+
* **api:** update via SDK Studio ([496e5cd](https://github.com/onkernel/kernel-python-sdk/commit/496e5cd31745446c16234120f9299be4a9830bb5))
22+
23+
24+
### Bug Fixes
25+
26+
* **client:** correctly parse binary response | stream ([0079349](https://github.com/onkernel/kernel-python-sdk/commit/007934910a1ec8e17a6be821feacef9b42a2c142))
27+
* **tests:** fix: tests which call HTTP endpoints directly with the example parameters ([53d6547](https://github.com/onkernel/kernel-python-sdk/commit/53d65471447af6f764aa48bd708c540215c8fd4a))
28+
29+
30+
### Chores
31+
32+
* **ci:** enable for pull requests ([fb3fba1](https://github.com/onkernel/kernel-python-sdk/commit/fb3fba16b9149449f8327b909210d42ee7744ba4))
33+
* **internal:** update conftest.py ([bcfcef2](https://github.com/onkernel/kernel-python-sdk/commit/bcfcef2eb9cd584ad6ec508956d59b34211d2e14))
34+
* **readme:** update badges ([099868c](https://github.com/onkernel/kernel-python-sdk/commit/099868c0c2fbb92a4b9e97cda89bf4e71781d76f))
35+
* **tests:** add tests for httpx client instantiation & proxies ([235bf24](https://github.com/onkernel/kernel-python-sdk/commit/235bf248a71505c9d5d536f1b6a7120e43b9cedc))
36+
* **tests:** run tests in parallel ([83e4f2c](https://github.com/onkernel/kernel-python-sdk/commit/83e4f2c26f02a7df56917e993af1e1d85ba241e6))
37+
338
## 0.5.0 (2025-06-03)
439

540
Full Changelog: [v0.4.0...v0.5.0](https://github.com/onkernel/kernel-python-sdk/compare/v0.4.0...v0.5.0)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Kernel Python API library
22

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

55
The Kernel Python library provides convenient access to the Kernel REST API from any Python 3.8+
66
application. The library includes type definitions for all request params and response fields,

api.md

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
# Shared Types
2+
3+
```python
4+
from kernel.types import ErrorDetail, ErrorEvent, ErrorModel, LogEvent
5+
```
6+
7+
# Deployments
8+
9+
Types:
10+
11+
```python
12+
from kernel.types import (
13+
DeploymentStateEvent,
14+
DeploymentCreateResponse,
15+
DeploymentRetrieveResponse,
16+
DeploymentFollowResponse,
17+
)
18+
```
19+
20+
Methods:
21+
22+
- <code title="post /deployments">client.deployments.<a href="./src/kernel/resources/deployments.py">create</a>(\*\*<a href="src/kernel/types/deployment_create_params.py">params</a>) -> <a href="./src/kernel/types/deployment_create_response.py">DeploymentCreateResponse</a></code>
23+
- <code title="get /deployments/{id}">client.deployments.<a href="./src/kernel/resources/deployments.py">retrieve</a>(id) -> <a href="./src/kernel/types/deployment_retrieve_response.py">DeploymentRetrieveResponse</a></code>
24+
- <code title="get /deployments/{id}/events">client.deployments.<a href="./src/kernel/resources/deployments.py">follow</a>(id) -> <a href="./src/kernel/types/deployment_follow_response.py">DeploymentFollowResponse</a></code>
25+
126
# Apps
227

328
Types:
@@ -23,23 +48,26 @@ Methods:
2348
- <code title="post /deploy">client.apps.deployments.<a href="./src/kernel/resources/apps/deployments.py">create</a>(\*\*<a href="src/kernel/types/apps/deployment_create_params.py">params</a>) -> <a href="./src/kernel/types/apps/deployment_create_response.py">DeploymentCreateResponse</a></code>
2449
- <code title="get /apps/{id}/events">client.apps.deployments.<a href="./src/kernel/resources/apps/deployments.py">follow</a>(id) -> <a href="./src/kernel/types/apps/deployment_follow_response.py">DeploymentFollowResponse</a></code>
2550

26-
## Invocations
51+
# Invocations
2752

2853
Types:
2954

3055
```python
31-
from kernel.types.apps import (
56+
from kernel.types import (
57+
InvocationStateEvent,
3258
InvocationCreateResponse,
3359
InvocationRetrieveResponse,
3460
InvocationUpdateResponse,
61+
InvocationFollowResponse,
3562
)
3663
```
3764

3865
Methods:
3966

40-
- <code title="post /invocations">client.apps.invocations.<a href="./src/kernel/resources/apps/invocations.py">create</a>(\*\*<a href="src/kernel/types/apps/invocation_create_params.py">params</a>) -> <a href="./src/kernel/types/apps/invocation_create_response.py">InvocationCreateResponse</a></code>
41-
- <code title="get /invocations/{id}">client.apps.invocations.<a href="./src/kernel/resources/apps/invocations.py">retrieve</a>(id) -> <a href="./src/kernel/types/apps/invocation_retrieve_response.py">InvocationRetrieveResponse</a></code>
42-
- <code title="patch /invocations/{id}">client.apps.invocations.<a href="./src/kernel/resources/apps/invocations.py">update</a>(id, \*\*<a href="src/kernel/types/apps/invocation_update_params.py">params</a>) -> <a href="./src/kernel/types/apps/invocation_update_response.py">InvocationUpdateResponse</a></code>
67+
- <code title="post /invocations">client.invocations.<a href="./src/kernel/resources/invocations.py">create</a>(\*\*<a href="src/kernel/types/invocation_create_params.py">params</a>) -> <a href="./src/kernel/types/invocation_create_response.py">InvocationCreateResponse</a></code>
68+
- <code title="get /invocations/{id}">client.invocations.<a href="./src/kernel/resources/invocations.py">retrieve</a>(id) -> <a href="./src/kernel/types/invocation_retrieve_response.py">InvocationRetrieveResponse</a></code>
69+
- <code title="patch /invocations/{id}">client.invocations.<a href="./src/kernel/resources/invocations.py">update</a>(id, \*\*<a href="src/kernel/types/invocation_update_params.py">params</a>) -> <a href="./src/kernel/types/invocation_update_response.py">InvocationUpdateResponse</a></code>
70+
- <code title="get /invocations/{id}/events">client.invocations.<a href="./src/kernel/resources/invocations.py">follow</a>(id) -> <a href="./src/kernel/types/invocation_follow_response.py">InvocationFollowResponse</a></code>
4371

4472
# Browsers
4573

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "kernel"
3-
version = "0.5.0"
3+
version = "0.6.0"
44
description = "The official Python library for the kernel 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/onkernel/kernel-python-sdk/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/kernel/_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/kernel/_client.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
)
2222
from ._utils import is_given, get_async_library
2323
from ._version import __version__
24-
from .resources import browsers
24+
from .resources import browsers, deployments, invocations
2525
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
2626
from ._exceptions import KernelError, APIStatusError
2727
from ._base_client import (
@@ -50,7 +50,9 @@
5050

5151

5252
class Kernel(SyncAPIClient):
53+
deployments: deployments.DeploymentsResource
5354
apps: apps.AppsResource
55+
invocations: invocations.InvocationsResource
5456
browsers: browsers.BrowsersResource
5557
with_raw_response: KernelWithRawResponse
5658
with_streaming_response: KernelWithStreamedResponse
@@ -133,7 +135,9 @@ def __init__(
133135
_strict_response_validation=_strict_response_validation,
134136
)
135137

138+
self.deployments = deployments.DeploymentsResource(self)
136139
self.apps = apps.AppsResource(self)
140+
self.invocations = invocations.InvocationsResource(self)
137141
self.browsers = browsers.BrowsersResource(self)
138142
self.with_raw_response = KernelWithRawResponse(self)
139143
self.with_streaming_response = KernelWithStreamedResponse(self)
@@ -246,7 +250,9 @@ def _make_status_error(
246250

247251

248252
class AsyncKernel(AsyncAPIClient):
253+
deployments: deployments.AsyncDeploymentsResource
249254
apps: apps.AsyncAppsResource
255+
invocations: invocations.AsyncInvocationsResource
250256
browsers: browsers.AsyncBrowsersResource
251257
with_raw_response: AsyncKernelWithRawResponse
252258
with_streaming_response: AsyncKernelWithStreamedResponse
@@ -329,7 +335,9 @@ def __init__(
329335
_strict_response_validation=_strict_response_validation,
330336
)
331337

338+
self.deployments = deployments.AsyncDeploymentsResource(self)
332339
self.apps = apps.AsyncAppsResource(self)
340+
self.invocations = invocations.AsyncInvocationsResource(self)
333341
self.browsers = browsers.AsyncBrowsersResource(self)
334342
self.with_raw_response = AsyncKernelWithRawResponse(self)
335343
self.with_streaming_response = AsyncKernelWithStreamedResponse(self)
@@ -443,25 +451,33 @@ def _make_status_error(
443451

444452
class KernelWithRawResponse:
445453
def __init__(self, client: Kernel) -> None:
454+
self.deployments = deployments.DeploymentsResourceWithRawResponse(client.deployments)
446455
self.apps = apps.AppsResourceWithRawResponse(client.apps)
456+
self.invocations = invocations.InvocationsResourceWithRawResponse(client.invocations)
447457
self.browsers = browsers.BrowsersResourceWithRawResponse(client.browsers)
448458

449459

450460
class AsyncKernelWithRawResponse:
451461
def __init__(self, client: AsyncKernel) -> None:
462+
self.deployments = deployments.AsyncDeploymentsResourceWithRawResponse(client.deployments)
452463
self.apps = apps.AsyncAppsResourceWithRawResponse(client.apps)
464+
self.invocations = invocations.AsyncInvocationsResourceWithRawResponse(client.invocations)
453465
self.browsers = browsers.AsyncBrowsersResourceWithRawResponse(client.browsers)
454466

455467

456468
class KernelWithStreamedResponse:
457469
def __init__(self, client: Kernel) -> None:
470+
self.deployments = deployments.DeploymentsResourceWithStreamingResponse(client.deployments)
458471
self.apps = apps.AppsResourceWithStreamingResponse(client.apps)
472+
self.invocations = invocations.InvocationsResourceWithStreamingResponse(client.invocations)
459473
self.browsers = browsers.BrowsersResourceWithStreamingResponse(client.browsers)
460474

461475

462476
class AsyncKernelWithStreamedResponse:
463477
def __init__(self, client: AsyncKernel) -> None:
478+
self.deployments = deployments.AsyncDeploymentsResourceWithStreamingResponse(client.deployments)
464479
self.apps = apps.AsyncAppsResourceWithStreamingResponse(client.apps)
480+
self.invocations = invocations.AsyncInvocationsResourceWithStreamingResponse(client.invocations)
465481
self.browsers = browsers.AsyncBrowsersResourceWithStreamingResponse(client.browsers)
466482

467483

src/kernel/_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__ = "kernel"
4-
__version__ = "0.5.0" # x-release-please-version
4+
__version__ = "0.6.0" # x-release-please-version

src/kernel/resources/__init__.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,42 @@
1616
BrowsersResourceWithStreamingResponse,
1717
AsyncBrowsersResourceWithStreamingResponse,
1818
)
19+
from .deployments import (
20+
DeploymentsResource,
21+
AsyncDeploymentsResource,
22+
DeploymentsResourceWithRawResponse,
23+
AsyncDeploymentsResourceWithRawResponse,
24+
DeploymentsResourceWithStreamingResponse,
25+
AsyncDeploymentsResourceWithStreamingResponse,
26+
)
27+
from .invocations import (
28+
InvocationsResource,
29+
AsyncInvocationsResource,
30+
InvocationsResourceWithRawResponse,
31+
AsyncInvocationsResourceWithRawResponse,
32+
InvocationsResourceWithStreamingResponse,
33+
AsyncInvocationsResourceWithStreamingResponse,
34+
)
1935

2036
__all__ = [
37+
"DeploymentsResource",
38+
"AsyncDeploymentsResource",
39+
"DeploymentsResourceWithRawResponse",
40+
"AsyncDeploymentsResourceWithRawResponse",
41+
"DeploymentsResourceWithStreamingResponse",
42+
"AsyncDeploymentsResourceWithStreamingResponse",
2143
"AppsResource",
2244
"AsyncAppsResource",
2345
"AppsResourceWithRawResponse",
2446
"AsyncAppsResourceWithRawResponse",
2547
"AppsResourceWithStreamingResponse",
2648
"AsyncAppsResourceWithStreamingResponse",
49+
"InvocationsResource",
50+
"AsyncInvocationsResource",
51+
"InvocationsResourceWithRawResponse",
52+
"AsyncInvocationsResourceWithRawResponse",
53+
"InvocationsResourceWithStreamingResponse",
54+
"AsyncInvocationsResourceWithStreamingResponse",
2755
"BrowsersResource",
2856
"AsyncBrowsersResource",
2957
"BrowsersResourceWithRawResponse",

src/kernel/resources/apps/__init__.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@
1616
DeploymentsResourceWithStreamingResponse,
1717
AsyncDeploymentsResourceWithStreamingResponse,
1818
)
19-
from .invocations import (
20-
InvocationsResource,
21-
AsyncInvocationsResource,
22-
InvocationsResourceWithRawResponse,
23-
AsyncInvocationsResourceWithRawResponse,
24-
InvocationsResourceWithStreamingResponse,
25-
AsyncInvocationsResourceWithStreamingResponse,
26-
)
2719

2820
__all__ = [
2921
"DeploymentsResource",
@@ -32,12 +24,6 @@
3224
"AsyncDeploymentsResourceWithRawResponse",
3325
"DeploymentsResourceWithStreamingResponse",
3426
"AsyncDeploymentsResourceWithStreamingResponse",
35-
"InvocationsResource",
36-
"AsyncInvocationsResource",
37-
"InvocationsResourceWithRawResponse",
38-
"AsyncInvocationsResourceWithRawResponse",
39-
"InvocationsResourceWithStreamingResponse",
40-
"AsyncInvocationsResourceWithStreamingResponse",
4127
"AppsResource",
4228
"AsyncAppsResource",
4329
"AppsResourceWithRawResponse",

0 commit comments

Comments
 (0)