diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bf0d0361..f391d416 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.5.0" + ".": "3.6.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d8e8b1d5..b8cc8f24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 3.6.0 (2025-10-16) + +Full Changelog: [v3.5.0...v3.6.0](https://github.com/digitalocean/gradient-python/compare/v3.5.0...v3.6.0) + +### Features + +* **api:** manual updates ([da88e9e](https://github.com/digitalocean/gradient-python/commit/da88e9eee0adc6152d0d8212305397483be0d686)) + + +### Bug Fixes + +* lints ([a1b1fc6](https://github.com/digitalocean/gradient-python/commit/a1b1fc6b7747c00d9bfc2b86c6262e9c123416dc)) +* test setup needs all three access keys ([01ac735](https://github.com/digitalocean/gradient-python/commit/01ac735fb965686699df82ec8763b18ceb660972)) + ## 3.5.0 (2025-10-14) Full Changelog: [v3.4.0...v3.5.0](https://github.com/digitalocean/gradient-python/compare/v3.4.0...v3.5.0) diff --git a/pyproject.toml b/pyproject.toml index b9dbc5ea..0eb040eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gradient" -version = "3.5.0" +version = "3.6.0" description = "The official Python library for the Gradient API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gradient/_client.py b/src/gradient/_client.py index 77cc446e..58bc42d9 100644 --- a/src/gradient/_client.py +++ b/src/gradient/_client.py @@ -291,6 +291,16 @@ def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None: if isinstance(custom_headers.get("Authorization"), Omit): return + if self.model_access_key and headers.get("Authorization"): + return + if isinstance(custom_headers.get("Authorization"), Omit): + return + + if self.agent_access_key and headers.get("Authorization"): + return + if isinstance(custom_headers.get("Authorization"), Omit): + return + raise TypeError( '"Could not resolve authentication method. Expected access_token, agent_access_key, or model_access_key to be set. Or for the `Authorization` headers to be explicitly omitted"' ) @@ -614,6 +624,16 @@ def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None: if isinstance(custom_headers.get("Authorization"), Omit): return + if self.model_access_key and headers.get("Authorization"): + return + if isinstance(custom_headers.get("Authorization"), Omit): + return + + if self.agent_access_key and headers.get("Authorization"): + return + if isinstance(custom_headers.get("Authorization"), Omit): + return + raise TypeError( '"Could not resolve authentication method. Expected access_token, agent_access_key, or model_access_key to be set. Or for the `Authorization` headers to be explicitly omitted"' ) diff --git a/src/gradient/_version.py b/src/gradient/_version.py index 68c981bc..0190d688 100644 --- a/src/gradient/_version.py +++ b/src/gradient/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gradient" -__version__ = "3.5.0" # x-release-please-version +__version__ = "3.6.0" # x-release-please-version diff --git a/tests/conftest.py b/tests/conftest.py index bc2aa92e..3915c92b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -14,7 +14,9 @@ from gradient._utils import is_dict if TYPE_CHECKING: - from _pytest.fixtures import FixtureRequest # pyright: ignore[reportPrivateImportUsage] + from _pytest.fixtures import ( + FixtureRequest, # pyright: ignore[reportPrivateImportUsage] + ) pytest.register_assert_rewrite("tests.utils")