Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
permissions:
contents: read
id-token: write
runs-on: depot-ubuntu-24.04
runs-on: ${{ github.repository == 'stainless-sdks/knock-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.12.1"
".": "1.13.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 89
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-e4ea1ded040ebfa923df0d24ef37ae3c742383828cda85e1489bc2cb5e14da29.yml
openapi_spec_hash: 4cfd1f5f0d42e1b821f70ba12089b606
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-2d3aac5f3ddf05db97231694fc7fab3f0f2abac4691944dd52bf5a250a4edaa5.yml
openapi_spec_hash: 6418b750ca4a74b7248e3913fefb0bed
config_hash: 5c872aa99cad9b9602e84668f5b38a8a
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# Changelog

## 1.13.0 (2025-09-05)

Full Changelog: [v1.12.1...v1.13.0](https://github.com/knocklabs/knock-python/compare/v1.12.1...v1.13.0)

### Features

* **api:** api update ([1cdaf26](https://github.com/knocklabs/knock-python/commit/1cdaf26e8af57ab84654b48b30fd54afc5c721ac))
* **api:** api update ([78563fd](https://github.com/knocklabs/knock-python/commit/78563fd72a7c20144d49770a2fb1d444cfa96d83))
* **api:** api update ([c2a6ebb](https://github.com/knocklabs/knock-python/commit/c2a6ebbc4de4158cabbc9a22f60c2cee346c3531))
* **api:** api update ([122f574](https://github.com/knocklabs/knock-python/commit/122f574b1018dededf82d02d01f56d055115ce40))
* **api:** api update ([b6b52d7](https://github.com/knocklabs/knock-python/commit/b6b52d7259d8c48f92f208d99756eb7fd234b0c4))
* **api:** api update ([da8cdc0](https://github.com/knocklabs/knock-python/commit/da8cdc052fe12a158e2f3e8081182fa0cada65f0))
* **api:** api update ([df20d51](https://github.com/knocklabs/knock-python/commit/df20d5158a8a0df0600147be6497c56feed1a257))
* **api:** api update ([b9007c9](https://github.com/knocklabs/knock-python/commit/b9007c9da8d172eeb43c0acb509ec12c7c3d0d9a))
* improve future compat with pydantic v3 ([125d0c3](https://github.com/knocklabs/knock-python/commit/125d0c3e2d2cbfaaee8b8c2460b9328fa7f1a47a))
* **types:** replace List[str] with SequenceNotStr in params ([e19113c](https://github.com/knocklabs/knock-python/commit/e19113cded8eccae475f30b36ae5585427bffe57))


### Bug Fixes

* avoid newer type syntax ([66ba143](https://github.com/knocklabs/knock-python/commit/66ba143f5c6e28cb7e04c0682f1da3dbe0a82f55))


### Chores

* **internal:** add Sequence related utils ([2032a76](https://github.com/knocklabs/knock-python/commit/2032a76fac21550c5198347c3f5a392e86616ca4))
* **internal:** change ci workflow machines ([a1760f4](https://github.com/knocklabs/knock-python/commit/a1760f41b2ca681bf983ae3b24c49516156fa7bd))
* **internal:** move mypy configurations to `pyproject.toml` file ([c9193ff](https://github.com/knocklabs/knock-python/commit/c9193ff2a63d7b83981dea86f0b7cfa11542c4cd))
* **internal:** update pyright exclude list ([40513b5](https://github.com/knocklabs/knock-python/commit/40513b513e482356c3abf8c4427e133da91f8a85))
* **tests:** simplify `get_platform` test ([e6d99e5](https://github.com/knocklabs/knock-python/commit/e6d99e582689202e25a841d02d225d72c9d5ca0b))

## 1.12.1 (2025-08-21)

Full Changelog: [v1.12.0...v1.12.1](https://github.com/knocklabs/knock-python/compare/v1.12.0...v1.12.1)
Expand Down
50 changes: 0 additions & 50 deletions mypy.ini

This file was deleted.

56 changes: 54 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "knockapi"
version = "1.12.1"
version = "1.13.0"
description = "The official Python library for the knock API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -56,7 +56,6 @@ dev-dependencies = [
"dirty-equals>=0.6.0",
"importlib-metadata>=6.7.0",
"rich>=13.7.1",
"nest_asyncio==1.6.0",
"pytest-xdist>=3.6.1",
]

Expand Down Expand Up @@ -148,6 +147,7 @@ exclude = [
"_dev",
".venv",
".nox",
".git",
]

reportImplicitOverride = true
Expand All @@ -156,6 +156,58 @@ reportOverlappingOverload = false
reportImportCycles = false
reportPrivateUsage = false

[tool.mypy]
pretty = true
show_error_codes = true

# Exclude _files.py because mypy isn't smart enough to apply
# the correct type narrowing and as this is an internal module
# it's fine to just use Pyright.
#
# We also exclude our `tests` as mypy doesn't always infer
# types correctly and Pyright will still catch any type errors.
exclude = ['src/knockapi/_files.py', '_dev/.*.py', 'tests/.*']

strict_equality = true
implicit_reexport = true
check_untyped_defs = true
no_implicit_optional = true

warn_return_any = true
warn_unreachable = true
warn_unused_configs = true

# Turn these options off as it could cause conflicts
# with the Pyright options.
warn_unused_ignores = false
warn_redundant_casts = false

disallow_any_generics = true
disallow_untyped_defs = true
disallow_untyped_calls = true
disallow_subclassing_any = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
cache_fine_grained = true

# By default, mypy reports an error if you assign a value to the result
# of a function call that doesn't return anything. We do this in our test
# cases:
# ```
# result = ...
# assert result is None
# ```
# Changing this codegen to make mypy happy would increase complexity
# and would not be worth it.
disable_error_code = "func-returns-value,overload-cannot-match"

# https://github.com/python/mypy/issues/12162
[[tool.mypy.overrides]]
module = "black.files.*"
ignore_errors = true
ignore_missing_imports = true


[tool.ruff]
line-length = 120
output-format = "grouped"
Expand Down
1 change: 0 additions & 1 deletion requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ multidict==6.4.4
mypy==1.14.1
mypy-extensions==1.0.0
# via mypy
nest-asyncio==1.6.0
nodeenv==1.8.0
# via pyright
nox==2023.4.22
Expand Down
6 changes: 3 additions & 3 deletions src/knockapi/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
ModelBuilderProtocol,
)
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
from ._compat import PYDANTIC_V2, model_copy, model_dump
from ._compat import PYDANTIC_V1, model_copy, model_dump
from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type
from ._response import (
APIResponse,
Expand Down Expand Up @@ -232,7 +232,7 @@ def _set_private_attributes(
model: Type[_T],
options: FinalRequestOptions,
) -> None:
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
self.__pydantic_private__ = {}

self._model = model
Expand Down Expand Up @@ -320,7 +320,7 @@ def _set_private_attributes(
client: AsyncAPIClient,
options: FinalRequestOptions,
) -> None:
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
self.__pydantic_private__ = {}

self._model = model
Expand Down
Loading
Loading