From 001965be0a2e147e9250cf3a94f84af869fc5e05 Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Thu, 23 May 2024 20:03:38 +0100 Subject: [PATCH 1/5] chore(ci): update rye install location (#1440) --- .devcontainer/Dockerfile | 2 +- .github/workflows/ci.yml | 4 ++-- .github/workflows/create-releases.yml | 2 +- .github/workflows/publish-pypi.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index e9841a168d..83bca8f716 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -3,7 +3,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} USER vscode -RUN curl -sSf https://raw.githubusercontent.com/astral-sh/rye/main/scripts/install.sh | RYE_VERSION="0.24.0" RYE_INSTALL_OPTION="--yes" bash +RUN curl -sSf https://rye.astral.sh/get | 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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c084831fa9..6fc5b36597 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - name: Install Rye run: | - curl -sSf https://raw.githubusercontent.com/astral-sh/rye/main/scripts/install.sh | bash + curl -sSf https://rye.astral.sh/get | bash echo "$HOME/.rye/shims" >> $GITHUB_PATH env: RYE_VERSION: 0.24.0 @@ -39,7 +39,7 @@ jobs: - name: Install Rye run: | - curl -sSf https://raw.githubusercontent.com/astral-sh/rye/main/scripts/install.sh | bash + curl -sSf https://rye.astral.sh/get | bash echo "$HOME/.rye/shims" >> $GITHUB_PATH env: RYE_VERSION: 0.24.0 diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml index ddc4de19ef..1ac03ede3f 100644 --- a/.github/workflows/create-releases.yml +++ b/.github/workflows/create-releases.yml @@ -25,7 +25,7 @@ jobs: - name: Install Rye if: ${{ steps.release.outputs.releases_created }} run: | - curl -sSf https://raw.githubusercontent.com/astral-sh/rye/main/scripts/install.sh | bash + curl -sSf https://rye.astral.sh/get | bash echo "$HOME/.rye/shims" >> $GITHUB_PATH env: RYE_VERSION: 0.24.0 diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index db855cbbd9..aae985b27e 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -14,7 +14,7 @@ jobs: - name: Install Rye run: | - curl -sSf https://raw.githubusercontent.com/astral-sh/rye/main/scripts/install.sh | bash + curl -sSf https://rye.astral.sh/get | bash echo "$HOME/.rye/shims" >> $GITHUB_PATH env: RYE_VERSION: 0.24.0 From 17c2876d97fb68b9d38d052cff66e414962b7f4e Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Fri, 24 May 2024 08:46:27 +0000 Subject: [PATCH 2/5] chore(internal): bump pyright (#1442) --- requirements-dev.lock | 2 +- src/openai/_utils/_utils.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index 6a4e12022a..c5416cd4db 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -117,7 +117,7 @@ pydantic-core==2.18.2 # via pydantic pyjwt==2.8.0 # via msal -pyright==1.1.359 +pyright==1.1.364 pytest==7.1.1 # via pytest-asyncio pytest-asyncio==0.21.1 diff --git a/src/openai/_utils/_utils.py b/src/openai/_utils/_utils.py index 17904ce60d..34797c2905 100644 --- a/src/openai/_utils/_utils.py +++ b/src/openai/_utils/_utils.py @@ -20,7 +20,7 @@ import sniffio -from .._types import Headers, NotGiven, FileTypes, NotGivenOr, HeadersLike +from .._types import NotGiven, FileTypes, NotGivenOr, HeadersLike from .._compat import parse_date as parse_date, parse_datetime as parse_datetime _T = TypeVar("_T") @@ -370,7 +370,6 @@ def file_from_path(path: str) -> FileTypes: def get_required_header(headers: HeadersLike, header: str) -> str: lower_header = header.lower() if isinstance(headers, Mapping): - headers = cast(Headers, headers) for k, v in headers.items(): if k.lower() == lower_header and isinstance(v, str): return v From 302f45a425850c13f94a2bbdd67618bfe3c33758 Mon Sep 17 00:00:00 2001 From: Robert Craigie Date: Fri, 24 May 2024 15:39:44 +0100 Subject: [PATCH 3/5] chore(internal): fix lint issue (#1444) --- src/openai/lib/azure.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openai/lib/azure.py b/src/openai/lib/azure.py index b76b83c61c..165b9b82e2 100644 --- a/src/openai/lib/azure.py +++ b/src/openai/lib/azure.py @@ -2,7 +2,7 @@ import os import inspect -from typing import Any, Union, Mapping, TypeVar, Callable, Awaitable, overload +from typing import Any, Union, Mapping, TypeVar, Callable, Awaitable, cast, overload from typing_extensions import Self, override import httpx @@ -515,7 +515,7 @@ async def _get_azure_ad_token(self) -> str | None: token = provider() if inspect.isawaitable(token): token = await token - if not token or not isinstance(token, str): + if not token or not isinstance(cast(Any, token), str): raise ValueError( f"Expected `azure_ad_token_provider` argument to return a string but it returned {token}", ) From 99f493961c926e87b5ea8d826301f8be7b07088e Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Fri, 24 May 2024 14:54:22 +0000 Subject: [PATCH 4/5] docs(contributing): update references to rye-up.com --- src/openai/lib/azure.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openai/lib/azure.py b/src/openai/lib/azure.py index 165b9b82e2..b76b83c61c 100644 --- a/src/openai/lib/azure.py +++ b/src/openai/lib/azure.py @@ -2,7 +2,7 @@ import os import inspect -from typing import Any, Union, Mapping, TypeVar, Callable, Awaitable, cast, overload +from typing import Any, Union, Mapping, TypeVar, Callable, Awaitable, overload from typing_extensions import Self, override import httpx @@ -515,7 +515,7 @@ async def _get_azure_ad_token(self) -> str | None: token = provider() if inspect.isawaitable(token): token = await token - if not token or not isinstance(cast(Any, token), str): + if not token or not isinstance(token, str): raise ValueError( f"Expected `azure_ad_token_provider` argument to return a string but it returned {token}", ) From 7fff7c842918e718e1e9dc3954f0e66aebfc2601 Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Fri, 24 May 2024 15:54:48 +0100 Subject: [PATCH 5/5] release: 1.30.3 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 15 +++++++++++++++ pyproject.toml | 2 +- src/openai/_version.py | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 623a7e2107..6c6045ba02 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.30.2" + ".": "1.30.3" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 68b9700f77..7276bd8c03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 1.30.3 (2024-05-24) + +Full Changelog: [v1.30.2...v1.30.3](https://github.com/openai/openai-python/compare/v1.30.2...v1.30.3) + +### Chores + +* **ci:** update rye install location ([#1440](https://github.com/openai/openai-python/issues/1440)) ([8a0e5bf](https://github.com/openai/openai-python/commit/8a0e5bf4c03d9c714799fad43be68ac9c2b1f37a)) +* **internal:** bump pyright ([#1442](https://github.com/openai/openai-python/issues/1442)) ([64a151e](https://github.com/openai/openai-python/commit/64a151eae705d55484f870df461434c0a6961e2b)) +* **internal:** fix lint issue ([#1444](https://github.com/openai/openai-python/issues/1444)) ([b0eb458](https://github.com/openai/openai-python/commit/b0eb4582e050b0a25af3d80d2cb584bfc7cd11ab)) + + +### Documentation + +* **contributing:** update references to rye-up.com ([dcc34a2](https://github.com/openai/openai-python/commit/dcc34a26d1a6a0debf440724fad658c77547048c)) + ## 1.30.2 (2024-05-23) Full Changelog: [v1.30.1...v1.30.2](https://github.com/openai/openai-python/compare/v1.30.1...v1.30.2) diff --git a/pyproject.toml b/pyproject.toml index 5c16d92b76..850cf8419b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openai" -version = "1.30.2" +version = "1.30.3" description = "The official Python library for the openai API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/openai/_version.py b/src/openai/_version.py index fc87a446a4..541680fae0 100644 --- a/src/openai/_version.py +++ b/src/openai/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "openai" -__version__ = "1.30.2" # x-release-please-version +__version__ = "1.30.3" # x-release-please-version