Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 0.0.12 #21

Merged
merged 2 commits into from
May 23, 2024
Merged
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 .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}

USER vscode

RUN curl -sSf https://rye-up.com/get | RYE_VERSION="0.24.0" RYE_INSTALL_OPTION="--yes" bash
RUN curl -sSf https://raw.githubusercontent.com/astral-sh/rye/main/scripts/install.sh | RYE_VERSION="0.24.0" RYE_INSTALL_OPTION="--yes" bash
ENV PATH=/home/vscode/.rye/shims:$PATH

RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- name: Install Rye
run: |
curl -sSf https://rye-up.com/get | bash
curl -sSf https://raw.githubusercontent.com/astral-sh/rye/main/scripts/install.sh | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: 0.24.0
Expand All @@ -38,7 +38,7 @@ jobs:

- name: Install Rye
run: |
curl -sSf https://rye-up.com/get | bash
curl -sSf https://raw.githubusercontent.com/astral-sh/rye/main/scripts/install.sh | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: 0.24.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- name: Install Rye
run: |
curl -sSf https://rye-up.com/get | bash
curl -sSf https://raw.githubusercontent.com/astral-sh/rye/main/scripts/install.sh | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: 0.24.0
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 @@
{
".": "0.0.11"
".": "0.0.12"
}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.0.12 (2024-05-23)

Full Changelog: [v0.0.11...v0.0.12](https://github.com/plastic-labs/honcho-python/compare/v0.0.11...v0.0.12)

### Features

* **api:** update via SDK Studio ([#22](https://github.com/plastic-labs/honcho-python/issues/22)) ([a9e7757](https://github.com/plastic-labs/honcho-python/commit/a9e7757b02f4cd560d12717af38bb85368eed581))


### Chores

* **examples:** update honcho package versions to latest ([331ce69](https://github.com/plastic-labs/honcho-python/commit/331ce69e0400690885a9cc62d92a9403e4e3953b))

## 0.0.11 (2024-05-23)

Full Changelog: [v0.0.10...v0.0.11](https://github.com/plastic-labs/honcho-python/compare/v0.0.10...v0.0.11)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "honcho-ai"
version = "0.0.11"
version = "0.0.12"
description = "The official Python library for the honcho API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
23 changes: 0 additions & 23 deletions src/honcho/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from ._types import (
NOT_GIVEN,
Omit,
Headers,
Timeout,
NotGiven,
Transport,
Expand Down Expand Up @@ -157,17 +156,6 @@ def default_headers(self) -> dict[str, str | Omit]:
**self._custom_headers,
}

@override
def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None:
if self.api_key and headers.get("Authorization"):
return
if isinstance(custom_headers.get("Authorization"), Omit):
return

raise TypeError(
'"Could not resolve authentication method. Expected the api_key to be set. Or for the `Authorization` headers to be explicitly omitted"'
)

def copy(
self,
*,
Expand Down Expand Up @@ -360,17 +348,6 @@ def default_headers(self) -> dict[str, str | Omit]:
**self._custom_headers,
}

@override
def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None:
if self.api_key and headers.get("Authorization"):
return
if isinstance(custom_headers.get("Authorization"), Omit):
return

raise TypeError(
'"Could not resolve authentication method. Expected the api_key to be set. Or for the `Authorization` headers to be explicitly omitted"'
)

def copy(
self,
*,
Expand Down
2 changes: 1 addition & 1 deletion src/honcho/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "honcho"
__version__ = "0.0.11" # x-release-please-version
__version__ = "0.0.12" # x-release-please-version
23 changes: 2 additions & 21 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from pydantic import ValidationError

from honcho import Honcho, AsyncHoncho, APIResponseValidationError
from honcho._types import Omit
from honcho._models import BaseModel, FinalRequestOptions
from honcho._constants import RAW_RESPONSE_HEADER
from honcho._exceptions import APIStatusError, APITimeoutError, APIResponseValidationError
Expand Down Expand Up @@ -329,16 +328,7 @@ def test_validate_headers(self) -> None:

client2 = Honcho(base_url=base_url, api_key=None, _strict_response_validation=True)

with pytest.raises(
TypeError,
match="Could not resolve authentication method. Expected the api_key to be set. Or for the `Authorization` headers to be explicitly omitted",
):
client2._build_request(FinalRequestOptions(method="get", url="/foo"))

request2 = client2._build_request(
FinalRequestOptions(method="get", url="/foo", headers={"Authorization": Omit()})
)
assert request2.headers.get("Authorization") is None
client2._build_request(FinalRequestOptions(method="get", url="/foo"))

def test_default_query_option(self) -> None:
client = Honcho(
Expand Down Expand Up @@ -1029,16 +1019,7 @@ def test_validate_headers(self) -> None:

client2 = AsyncHoncho(base_url=base_url, api_key=None, _strict_response_validation=True)

with pytest.raises(
TypeError,
match="Could not resolve authentication method. Expected the api_key to be set. Or for the `Authorization` headers to be explicitly omitted",
):
client2._build_request(FinalRequestOptions(method="get", url="/foo"))

request2 = client2._build_request(
FinalRequestOptions(method="get", url="/foo", headers={"Authorization": Omit()})
)
assert request2.headers.get("Authorization") is None
client2._build_request(FinalRequestOptions(method="get", url="/foo"))

def test_default_query_option(self) -> None:
client = AsyncHoncho(
Expand Down
Loading