Skip to content

release: 0.1.0-alpha.6 #36

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

Merged
merged 4 commits into from
Jan 24, 2025
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
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
lint:
name: lint
runs-on: ubuntu-latest


steps:
- uses: actions/checkout@v4
Expand All @@ -30,5 +29,3 @@ jobs:

- name: Run lints
run: ./scripts/lint


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.1.0-alpha.5"
".": "0.1.0-alpha.6"
}
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.1.0-alpha.6 (2025-01-24)

Full Changelog: [v0.1.0-alpha.5...v0.1.0-alpha.6](https://github.com/cleanlab/codex-python/compare/v0.1.0-alpha.5...v0.1.0-alpha.6)

### Features

* **api:** manual updates ([#38](https://github.com/cleanlab/codex-python/issues/38)) ([19d1564](https://github.com/cleanlab/codex-python/commit/19d15642892532a695756459c8fadd10bff2d5f0))


### Chores

* **internal:** minor formatting changes ([#37](https://github.com/cleanlab/codex-python/issues/37)) ([39c096c](https://github.com/cleanlab/codex-python/commit/39c096c71a77a0db1b4e546932304eb745a535ca))
* **internal:** minor style changes ([#35](https://github.com/cleanlab/codex-python/issues/35)) ([8aa2b96](https://github.com/cleanlab/codex-python/commit/8aa2b96246c7a9a95c6a0de6c317f8a38581fee4))

## 0.1.0-alpha.5 (2025-01-22)

Full Changelog: [v0.1.0-alpha.4...v0.1.0-alpha.5](https://github.com/cleanlab/codex-python/compare/v0.1.0-alpha.4...v0.1.0-alpha.5)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ print(project_return_schema.id)

While you can provide a `bearer_token` keyword argument,
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
to add `BEARER_TOKEN="My Bearer Token"` to your `.env` file
to add `CODEX_BEARER_TOKEN="My Bearer Token"` to your `.env` file
so that your Bearer Token is not stored in source control.

## Async usage
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 = "codex-sdk"
version = "0.1.0-alpha.5"
version = "0.1.0-alpha.6"
description = "The official Python library for the Codex API"
dynamic = ["readme"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion scripts/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

cd "$(dirname "$0")/.."

if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
brew bundle check >/dev/null 2>&1 || {
echo "==> Installing Homebrew dependencies…"
brew bundle
Expand Down
1 change: 0 additions & 1 deletion scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ rye run lint

echo "==> Making sure it imports"
rye run python -c 'import codex'

24 changes: 12 additions & 12 deletions src/codex/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,20 @@ def __init__(
"""Construct a new synchronous Codex client instance.

This automatically infers the following arguments from their corresponding environment variables if they are not provided:
- `bearer_token` from `BEARER_TOKEN`
- `api_key` from `AUTHENTICATED_API_KEY`
- `access_key` from `PUBLIC_ACCESS_KEY`
- `bearer_token` from `CODEX_BEARER_TOKEN`
- `api_key` from `CODEX_API_KEY`
- `access_key` from `CODEX_ACCESS_KEY`
"""
if bearer_token is None:
bearer_token = os.environ.get("BEARER_TOKEN")
bearer_token = os.environ.get("CODEX_BEARER_TOKEN")
self.bearer_token = bearer_token

if api_key is None:
api_key = os.environ.get("AUTHENTICATED_API_KEY")
api_key = os.environ.get("CODEX_API_KEY")
self.api_key = api_key

if access_key is None:
access_key = os.environ.get("PUBLIC_ACCESS_KEY")
access_key = os.environ.get("CODEX_ACCESS_KEY")
self.access_key = access_key

self._environment = environment
Expand Down Expand Up @@ -362,20 +362,20 @@ def __init__(
"""Construct a new async Codex client instance.

This automatically infers the following arguments from their corresponding environment variables if they are not provided:
- `bearer_token` from `BEARER_TOKEN`
- `api_key` from `AUTHENTICATED_API_KEY`
- `access_key` from `PUBLIC_ACCESS_KEY`
- `bearer_token` from `CODEX_BEARER_TOKEN`
- `api_key` from `CODEX_API_KEY`
- `access_key` from `CODEX_ACCESS_KEY`
"""
if bearer_token is None:
bearer_token = os.environ.get("BEARER_TOKEN")
bearer_token = os.environ.get("CODEX_BEARER_TOKEN")
self.bearer_token = bearer_token

if api_key is None:
api_key = os.environ.get("AUTHENTICATED_API_KEY")
api_key = os.environ.get("CODEX_API_KEY")
self.api_key = api_key

if access_key is None:
access_key = os.environ.get("PUBLIC_ACCESS_KEY")
access_key = os.environ.get("CODEX_ACCESS_KEY")
self.access_key = access_key

self._environment = environment
Expand Down
4 changes: 2 additions & 2 deletions src/codex/_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
if cast_to and is_annotated_type(cast_to):
cast_to = extract_type_arg(cast_to, 0)

origin = get_origin(cast_to) or cast_to

if self._is_sse_stream:
if to:
if not is_stream_class_type(to):
Expand Down Expand Up @@ -195,8 +197,6 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
if cast_to == bool:
return cast(R, response.text.lower() == "true")

origin = get_origin(cast_to) or cast_to

if origin == APIResponse:
raise RuntimeError("Unexpected state - cast_to is `APIResponse`")

Expand Down
2 changes: 1 addition & 1 deletion src/codex/_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__ = "codex"
__version__ = "0.1.0-alpha.5" # x-release-please-version
__version__ = "0.1.0-alpha.6" # x-release-please-version
Loading