Skip to content

Commit 9e9eb32

Browse files
release: 1.1.0 (#42)
* chore(internal): version bump * feat(api): api update * chore(internal): avoid errors for isinstance checks on proxies * fix(package): support direct resource imports * feat(api): removes duplicate activities section This section is extra since the endpoint is already included in the list of methods above * chore(ci): upload sdks to package manager * feat(api): api update * chore(ci): fix installation instructions * release: 1.1.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent cc14ec2 commit 9e9eb32

35 files changed

+215
-534
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,30 @@ jobs:
3030
- name: Run lints
3131
run: ./scripts/lint
3232

33+
upload:
34+
if: github.repository == 'stainless-sdks/knock-python'
35+
timeout-minutes: 10
36+
name: upload
37+
permissions:
38+
contents: read
39+
id-token: write
40+
runs-on: depot-ubuntu-24.04
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
- name: Get GitHub OIDC Token
45+
id: github-oidc
46+
uses: actions/github-script@v6
47+
with:
48+
script: core.setOutput('github_token', await core.getIDToken());
49+
50+
- name: Upload tarball
51+
env:
52+
URL: https://pkg.stainless.com/s
53+
AUTH: ${{ steps.github-oidc.outputs.github_token }}
54+
SHA: ${{ github.sha }}
55+
run: ./scripts/utils/upload-artifact.sh
56+
3357
test:
3458
timeout-minutes: 10
3559
name: test

.release-please-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.0.0"
3-
}
2+
".": "1.1.0"
3+
}

.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-641970ffdc1043cad290c3384d3d9c55b50cb709016a7513c03b2b84cf24fb31.yml
3-
openapi_spec_hash: e10e8093bf0dbde38523b98bec436123
4-
config_hash: 7460c5bd6d1a7041faa274f677789407
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-923618cb1489556307ce0be07853170d15516da8fe450578fed856e560ec361c.yml
3+
openapi_spec_hash: 1406cf9ab287412197a1907f5d66d541
4+
config_hash: 2ae8965d371a03bd30c6a56819c04cf2

CHANGELOG.md

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

3+
## 1.1.0 (2025-05-16)
4+
5+
Full Changelog: [v1.0.0...v1.1.0](https://github.com/knocklabs/knock-python/compare/v1.0.0...v1.1.0)
6+
7+
### Features
8+
9+
* **api:** api update ([e88471a](https://github.com/knocklabs/knock-python/commit/e88471a8b9c90f68d9ff6438298754f8b63148cc))
10+
* **api:** api update ([07aa7ef](https://github.com/knocklabs/knock-python/commit/07aa7ef945058ad65a8b7586c74dabf156c69cfb))
11+
* **api:** removes duplicate activities section ([5e79f8b](https://github.com/knocklabs/knock-python/commit/5e79f8b6dc84a299099052a204f50c8522671d51))
12+
13+
14+
### Bug Fixes
15+
16+
* **package:** support direct resource imports ([03d835a](https://github.com/knocklabs/knock-python/commit/03d835a305fe7024814c863ed902481ec509b439))
17+
18+
19+
### Chores
20+
21+
* **ci:** fix installation instructions ([aad60e0](https://github.com/knocklabs/knock-python/commit/aad60e07fd672462e4689125a20f4f62a99d18de))
22+
* **ci:** upload sdks to package manager ([6793aeb](https://github.com/knocklabs/knock-python/commit/6793aeb32db67c2f41dc3c721c64b25471031c13))
23+
* **internal:** avoid errors for isinstance checks on proxies ([49ba469](https://github.com/knocklabs/knock-python/commit/49ba46929f05e16a4d134ce201d7a10bbfd09b4b))
24+
* **internal:** version bump ([797719a](https://github.com/knocklabs/knock-python/commit/797719ac713c52ac1abae12df3b3667ee3d536aa))
25+
326
## 1.0.0 (2025-05-01)
427

528
Full Changelog: [v0.5.14...v1.0.0](https://github.com/knocklabs/knock-python/compare/v0.5.14...v1.0.0)

api.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,12 +260,6 @@ Methods:
260260
- <code title="post /v1/messages/batch/unseen">client.messages.batch.<a href="./src/knockapi/resources/messages/batch.py">mark_as_unseen</a>(\*\*<a href="src/knockapi/types/messages/batch_mark_as_unseen_params.py">params</a>) -> <a href="./src/knockapi/types/messages/batch_mark_as_unseen_response.py">BatchMarkAsUnseenResponse</a></code>
261261
- <code title="post /v1/messages/batch/unarchived">client.messages.batch.<a href="./src/knockapi/resources/messages/batch.py">unarchive</a>(\*\*<a href="src/knockapi/types/messages/batch_unarchive_params.py">params</a>) -> <a href="./src/knockapi/types/messages/batch_unarchive_response.py">BatchUnarchiveResponse</a></code>
262262

263-
## Activities
264-
265-
Methods:
266-
267-
- <code title="get /v1/messages/{message_id}/activities">client.messages.activities.<a href="./src/knockapi/resources/messages/activities.py">list</a>(message_id, \*\*<a href="src/knockapi/types/messages/activity_list_params.py">params</a>) -> <a href="./src/knockapi/types/activity.py">SyncItemsCursor[Activity]</a></code>
268-
269263
# Providers
270264

271265
## Slack

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "knockapi"
3-
version = "1.0.0"
3+
version = "1.1.0"
44
description = "The official Python library for the knock API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

scripts/utils/upload-artifact.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
set -exuo pipefail
3+
4+
RESPONSE=$(curl -X POST "$URL" \
5+
-H "Authorization: Bearer $AUTH" \
6+
-H "Content-Type: application/json")
7+
8+
SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url')
9+
10+
if [[ "$SIGNED_URL" == "null" ]]; then
11+
echo -e "\033[31mFailed to get signed URL.\033[0m"
12+
exit 1
13+
fi
14+
15+
UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \
16+
-H "Content-Type: application/gzip" \
17+
--data-binary @- "$SIGNED_URL" 2>&1)
18+
19+
if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
20+
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"
22+
else
23+
echo -e "\033[31mFailed to upload artifact.\033[0m"
24+
exit 1
25+
fi

src/knockapi/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
import typing as _t
4+
35
from . import types
46
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
57
from ._utils import file_from_path
@@ -68,6 +70,9 @@
6870
"DefaultAsyncHttpxClient",
6971
]
7072

73+
if not _t.TYPE_CHECKING:
74+
from ._utils._resources_proxy import resources as resources
75+
7176
_setup_logging()
7277

7378
# Update the __module__ attribute for exported symbols so that

src/knockapi/_utils/_proxy.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ def __dir__(self) -> Iterable[str]:
4646
@property # type: ignore
4747
@override
4848
def __class__(self) -> type: # pyright: ignore
49-
proxied = self.__get_proxied__()
49+
try:
50+
proxied = self.__get_proxied__()
51+
except Exception:
52+
return type(self)
5053
if issubclass(type(proxied), LazyProxy):
5154
return type(proxied)
5255
return proxied.__class__
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from __future__ import annotations
2+
3+
from typing import Any
4+
from typing_extensions import override
5+
6+
from ._proxy import LazyProxy
7+
8+
9+
class ResourcesProxy(LazyProxy[Any]):
10+
"""A proxy for the `knockapi.resources` module.
11+
12+
This is used so that we can lazily import `knockapi.resources` only when
13+
needed *and* so that users can just import `knockapi` and reference `knockapi.resources`
14+
"""
15+
16+
@override
17+
def __load__(self) -> Any:
18+
import importlib
19+
20+
mod = importlib.import_module("knockapi.resources")
21+
return mod
22+
23+
24+
resources = ResourcesProxy().__as_proxied__()

0 commit comments

Comments
 (0)