Skip to content

Commit 0be8b33

Browse files
release: 1.10.0 (#54)
* codegen metadata * chore(ci): change upload type * feat(api): api update * codegen metadata * codegen metadata * codegen metadata * codegen metadata * feat(api): api update * chore(internal): bump pinned h11 dep * chore(package): mark python 3.13 as supported * fix(parsing): correctly handle nested discriminated unions * chore(readme): fix version rendering on pypi * fix(client): don't send Content-Type header on GET requests * codegen metadata * feat: clean up environment call outs * release: 1.10.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 6f9787e commit 0be8b33

22 files changed

+169
-72
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,31 @@ jobs:
3535
- name: Run lints
3636
run: ./scripts/lint
3737

38-
upload:
38+
build:
3939
if: github.repository == 'stainless-sdks/knock-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
4040
timeout-minutes: 10
41-
name: upload
41+
name: build
4242
permissions:
4343
contents: read
4444
id-token: write
4545
runs-on: depot-ubuntu-24.04
4646
steps:
4747
- uses: actions/checkout@v4
4848

49+
- name: Install Rye
50+
run: |
51+
curl -sSf https://rye.astral.sh/get | bash
52+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
53+
env:
54+
RYE_VERSION: '0.44.0'
55+
RYE_INSTALL_OPTION: '--yes'
56+
57+
- name: Install dependencies
58+
run: rye sync --all-features
59+
60+
- name: Run build
61+
run: rye build
62+
4963
- name: Get GitHub OIDC Token
5064
id: github-oidc
5165
uses: actions/github-script@v6

.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.9.0"
2+
".": "1.10.0"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 89
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-fa68e7353b6d2eb51af35279f2f591a7d6168c5ade69c3cf40b5aae119ebcce1.yml
3-
openapi_spec_hash: f9315c4f1d89624aa2447499dbfe734c
4-
config_hash: b4c547c1d4c8cd0834bc793ddf5388ee
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-592610bb4a05ea45115eba7544acd8efbab327749d0f78bd83e164aa305dc0a7.yml
3+
openapi_spec_hash: 6a65b9127625d9479ba6bff2ba3f8d37
4+
config_hash: c835f0912492c3f1189f78f876c7c90c

CHANGELOG.md

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

3+
## 1.10.0 (2025-07-15)
4+
5+
Full Changelog: [v1.9.0...v1.10.0](https://github.com/knocklabs/knock-python/compare/v1.9.0...v1.10.0)
6+
7+
### Features
8+
9+
* **api:** api update ([7673085](https://github.com/knocklabs/knock-python/commit/7673085795939d4ce7e23cf0f2926fa8c6a08978))
10+
* **api:** api update ([b9f028b](https://github.com/knocklabs/knock-python/commit/b9f028b69089460aa522b023a272182803b6143c))
11+
* clean up environment call outs ([fb2f0d5](https://github.com/knocklabs/knock-python/commit/fb2f0d522f82069c40d931fe26722fc52be70967))
12+
13+
14+
### Bug Fixes
15+
16+
* **client:** don't send Content-Type header on GET requests ([64799d2](https://github.com/knocklabs/knock-python/commit/64799d2f0f8288c23e86ed7df45eeb211866ac0b))
17+
* **parsing:** correctly handle nested discriminated unions ([e8e1932](https://github.com/knocklabs/knock-python/commit/e8e1932417093bf612a0705cc7fada4a980f3a39))
18+
19+
20+
### Chores
21+
22+
* **ci:** change upload type ([e71a7c5](https://github.com/knocklabs/knock-python/commit/e71a7c512b98a9910e1596462504105cf3e9d58d))
23+
* **internal:** bump pinned h11 dep ([f2b5336](https://github.com/knocklabs/knock-python/commit/f2b53364b5dd9cfcc15bea2204dc42bc6e49d0f6))
24+
* **package:** mark python 3.13 as supported ([ee5b244](https://github.com/knocklabs/knock-python/commit/ee5b244a23c584a6ccd61e85c56bb9e3e85dcb8d))
25+
* **readme:** fix version rendering on pypi ([a2fae26](https://github.com/knocklabs/knock-python/commit/a2fae26e5dfa3c003f3f1cf2b45bf55fe47db724))
26+
327
## 1.9.0 (2025-06-30)
428

529
Full Changelog: [v1.8.1...v1.9.0](https://github.com/knocklabs/knock-python/compare/v1.8.1...v1.9.0)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Knock Python API library
22

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

56
The Knock Python library provides convenient access to the Knock REST API from any Python 3.8+
67
application. The library includes type definitions for all request params and response fields,
@@ -86,15 +87,14 @@ pip install knockapi[aiohttp]
8687
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
8788

8889
```python
89-
import os
9090
import asyncio
9191
from knockapi import DefaultAioHttpClient
9292
from knockapi import AsyncKnock
9393

9494

9595
async def main() -> None:
9696
async with AsyncKnock(
97-
api_key=os.environ.get("KNOCK_API_KEY"), # This is the default and can be omitted
97+
api_key="My API Key",
9898
http_client=DefaultAioHttpClient(),
9999
) as client:
100100
response = await client.workflows.trigger(

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.9.0"
3+
version = "1.10.0"
44
description = "The official Python library for the knock API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -24,6 +24,7 @@ classifiers = [
2424
"Programming Language :: Python :: 3.10",
2525
"Programming Language :: Python :: 3.11",
2626
"Programming Language :: Python :: 3.12",
27+
"Programming Language :: Python :: 3.13",
2728
"Operating System :: OS Independent",
2829
"Operating System :: POSIX",
2930
"Operating System :: MacOS",
@@ -38,7 +39,7 @@ Homepage = "https://github.com/knocklabs/knock-python"
3839
Repository = "https://github.com/knocklabs/knock-python"
3940

4041
[project.optional-dependencies]
41-
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.6"]
42+
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"]
4243

4344
[tool.rye]
4445
managed = true

requirements-dev.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ filelock==3.12.4
4848
frozenlist==1.6.2
4949
# via aiohttp
5050
# via aiosignal
51-
h11==0.14.0
51+
h11==0.16.0
5252
# via httpcore
53-
httpcore==1.0.2
53+
httpcore==1.0.9
5454
# via httpx
5555
httpx==0.28.1
5656
# via httpx-aiohttp
5757
# via knockapi
5858
# via respx
59-
httpx-aiohttp==0.1.6
59+
httpx-aiohttp==0.1.8
6060
# via knockapi
6161
idna==3.4
6262
# via anyio

requirements.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ exceptiongroup==1.2.2
3636
frozenlist==1.6.2
3737
# via aiohttp
3838
# via aiosignal
39-
h11==0.14.0
39+
h11==0.16.0
4040
# via httpcore
41-
httpcore==1.0.2
41+
httpcore==1.0.9
4242
# via httpx
4343
httpx==0.28.1
4444
# via httpx-aiohttp
4545
# via knockapi
46-
httpx-aiohttp==0.1.6
46+
httpx-aiohttp==0.1.8
4747
# via knockapi
4848
idna==3.4
4949
# via anyio

scripts/utils/upload-artifact.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/usr/bin/env bash
22
set -exuo pipefail
33

4-
RESPONSE=$(curl -X POST "$URL" \
4+
FILENAME=$(basename dist/*.whl)
5+
6+
RESPONSE=$(curl -X POST "$URL?filename=$FILENAME" \
57
-H "Authorization: Bearer $AUTH" \
68
-H "Content-Type: application/json")
79

@@ -12,13 +14,13 @@ if [[ "$SIGNED_URL" == "null" ]]; then
1214
exit 1
1315
fi
1416

15-
UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \
16-
-H "Content-Type: application/gzip" \
17-
--data-binary @- "$SIGNED_URL" 2>&1)
17+
UPLOAD_RESPONSE=$(curl -v -X PUT \
18+
-H "Content-Type: binary/octet-stream" \
19+
--data-binary "@dist/$FILENAME" "$SIGNED_URL" 2>&1)
1820

1921
if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
2022
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
21-
echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/knock-python/$SHA'\033[0m"
23+
echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/knock-python/$SHA/$FILENAME'\033[0m"
2224
else
2325
echo -e "\033[31mFailed to upload artifact.\033[0m"
2426
exit 1

src/knockapi/_base_client.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,15 @@ def _build_request(
529529
# work around https://github.com/encode/httpx/discussions/2880
530530
kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")}
531531

532+
is_body_allowed = options.method.lower() != "get"
533+
534+
if is_body_allowed:
535+
kwargs["json"] = json_data if is_given(json_data) else None
536+
kwargs["files"] = files
537+
else:
538+
headers.pop("Content-Type", None)
539+
kwargs.pop("data", None)
540+
532541
# TODO: report this error to httpx
533542
return self._client.build_request( # pyright: ignore[reportUnknownMemberType]
534543
headers=headers,
@@ -540,8 +549,6 @@ def _build_request(
540549
# so that passing a `TypedDict` doesn't cause an error.
541550
# https://github.com/microsoft/pyright/issues/3526#event-6715453066
542551
params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None,
543-
json=json_data if is_given(json_data) else None,
544-
files=files,
545552
**kwargs,
546553
)
547554

0 commit comments

Comments
 (0)