Skip to content
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 .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.3"
".": "0.1.0-alpha.4"
}
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

## 0.1.0-alpha.4 (2025-01-21)

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

### Features

* **api:** update api base url ([#28](https://github.com/cleanlab/codex-python/issues/28)) ([89c6e8b](https://github.com/cleanlab/codex-python/commit/89c6e8bff457c9269dfa76060b6fe8c757a58c4a))


### Bug Fixes

* **tests:** make test_get_platform less flaky ([#26](https://github.com/cleanlab/codex-python/issues/26)) ([d192517](https://github.com/cleanlab/codex-python/commit/d1925178d12c441e58cd36c210158ad9d07ee4dd))


### Chores

* **internal:** avoid pytest-asyncio deprecation warning ([#27](https://github.com/cleanlab/codex-python/issues/27)) ([1ab1a4e](https://github.com/cleanlab/codex-python/commit/1ab1a4ebd7b1bdf27847ce74a6c9aad630c0261c))


### Documentation

* **raw responses:** fix duplicate `the` ([#24](https://github.com/cleanlab/codex-python/issues/24)) ([ddeaa6d](https://github.com/cleanlab/codex-python/commit/ddeaa6db67dbf992ff0630d5b7c03848db41d751))

## 0.1.0-alpha.3 (2025-01-17)

Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/cleanlab/codex-python/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)
Expand Down
3 changes: 2 additions & 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.3"
version = "0.1.0-alpha.4"
description = "The official Python library for the Codex API"
dynamic = ["readme"]
license = "MIT"
Expand Down Expand Up @@ -129,6 +129,7 @@ testpaths = ["tests"]
addopts = "--tb=short"
xfail_strict = true
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
filterwarnings = [
"error"
]
Expand Down
4 changes: 2 additions & 2 deletions src/codex/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
]

ENVIRONMENTS: Dict[str, str] = {
"production": "https://api-alpha-o3gxj3oajfu.cleanlab.ai",
"staging": "https://api-alpha-staging-o3gxj3oajfu.cleanlab.ai",
"production": "https://api-codex-o3gxj3oajfu.cleanlab.ai",
"staging": "https://api-codex-staging-o3gxj3oajfu.cleanlab.ai",
"local": "http://localhost:8080",
}

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.3" # x-release-please-version
__version__ = "0.1.0-alpha.4" # x-release-please-version
4 changes: 2 additions & 2 deletions src/codex/resources/health.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class HealthResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> HealthResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/cleanlab/codex-python#accessing-raw-response-data-eg-headers
Expand Down Expand Up @@ -101,7 +101,7 @@ class AsyncHealthResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncHealthResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/cleanlab/codex-python#accessing-raw-response-data-eg-headers
Expand Down
4 changes: 2 additions & 2 deletions src/codex/resources/organizations/billing.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class BillingResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> BillingResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/cleanlab/codex-python#accessing-raw-response-data-eg-headers
Expand Down Expand Up @@ -111,7 +111,7 @@ class AsyncBillingResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncBillingResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/cleanlab/codex-python#accessing-raw-response-data-eg-headers
Expand Down
4 changes: 2 additions & 2 deletions src/codex/resources/organizations/organizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def billing(self) -> BillingResource:
@cached_property
def with_raw_response(self) -> OrganizationsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/cleanlab/codex-python#accessing-raw-response-data-eg-headers
Expand Down Expand Up @@ -93,7 +93,7 @@ def billing(self) -> AsyncBillingResource:
@cached_property
def with_raw_response(self) -> AsyncOrganizationsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/cleanlab/codex-python#accessing-raw-response-data-eg-headers
Expand Down
4 changes: 2 additions & 2 deletions src/codex/resources/projects/access_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class AccessKeysResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> AccessKeysResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/cleanlab/codex-python#accessing-raw-response-data-eg-headers
Expand Down Expand Up @@ -306,7 +306,7 @@ class AsyncAccessKeysResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncAccessKeysResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/cleanlab/codex-python#accessing-raw-response-data-eg-headers
Expand Down
4 changes: 2 additions & 2 deletions src/codex/resources/projects/entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class EntriesResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> EntriesResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/cleanlab/codex-python#accessing-raw-response-data-eg-headers
Expand Down Expand Up @@ -351,7 +351,7 @@ class AsyncEntriesResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncEntriesResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/cleanlab/codex-python#accessing-raw-response-data-eg-headers
Expand Down
4 changes: 2 additions & 2 deletions src/codex/resources/projects/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def entries(self) -> EntriesResource:
@cached_property
def with_raw_response(self) -> ProjectsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/cleanlab/codex-python#accessing-raw-response-data-eg-headers
Expand Down Expand Up @@ -324,7 +324,7 @@ def entries(self) -> AsyncEntriesResource:
@cached_property
def with_raw_response(self) -> AsyncProjectsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/cleanlab/codex-python#accessing-raw-response-data-eg-headers
Expand Down
4 changes: 2 additions & 2 deletions src/codex/resources/users/myself/api_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class APIKeyResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> APIKeyResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/cleanlab/codex-python#accessing-raw-response-data-eg-headers
Expand Down Expand Up @@ -63,7 +63,7 @@ class AsyncAPIKeyResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncAPIKeyResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/cleanlab/codex-python#accessing-raw-response-data-eg-headers
Expand Down
4 changes: 2 additions & 2 deletions src/codex/resources/users/myself/myself.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def organizations(self) -> OrganizationsResource:
@cached_property
def with_raw_response(self) -> MyselfResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/cleanlab/codex-python#accessing-raw-response-data-eg-headers
Expand Down Expand Up @@ -95,7 +95,7 @@ def organizations(self) -> AsyncOrganizationsResource:
@cached_property
def with_raw_response(self) -> AsyncMyselfResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/cleanlab/codex-python#accessing-raw-response-data-eg-headers
Expand Down
4 changes: 2 additions & 2 deletions src/codex/resources/users/myself/organizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class OrganizationsResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> OrganizationsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/cleanlab/codex-python#accessing-raw-response-data-eg-headers
Expand Down Expand Up @@ -63,7 +63,7 @@ class AsyncOrganizationsResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncOrganizationsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/cleanlab/codex-python#accessing-raw-response-data-eg-headers
Expand Down
4 changes: 2 additions & 2 deletions src/codex/resources/users/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def myself(self) -> MyselfResource:
@cached_property
def with_raw_response(self) -> UsersResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/cleanlab/codex-python#accessing-raw-response-data-eg-headers
Expand All @@ -49,7 +49,7 @@ def myself(self) -> AsyncMyselfResource:
@cached_property
def with_raw_response(self) -> AsyncUsersResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/cleanlab/codex-python#accessing-raw-response-data-eg-headers
Expand Down
29 changes: 20 additions & 9 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
import sys
import json
import time
import asyncio
import inspect
import subprocess
Expand Down Expand Up @@ -521,7 +522,7 @@ def test_base_url_env(self) -> None:
Codex(_strict_response_validation=True, environment="production")

client = Codex(base_url=None, _strict_response_validation=True, environment="production")
assert str(client.base_url).startswith("https://api-alpha-o3gxj3oajfu.cleanlab.ai")
assert str(client.base_url).startswith("https://api-codex-o3gxj3oajfu.cleanlab.ai")

@pytest.mark.parametrize(
"client",
Expand Down Expand Up @@ -1262,7 +1263,7 @@ def test_base_url_env(self) -> None:
AsyncCodex(_strict_response_validation=True, environment="production")

client = AsyncCodex(base_url=None, _strict_response_validation=True, environment="production")
assert str(client.base_url).startswith("https://api-alpha-o3gxj3oajfu.cleanlab.ai")
assert str(client.base_url).startswith("https://api-codex-o3gxj3oajfu.cleanlab.ai")

@pytest.mark.parametrize(
"client",
Expand Down Expand Up @@ -1565,10 +1566,20 @@ async def test_main() -> None:
[sys.executable, "-c", test_code],
text=True,
) as process:
try:
process.wait(2)
if process.returncode:
raise AssertionError("calling get_platform using asyncify resulted in a non-zero exit code")
except subprocess.TimeoutExpired as e:
process.kill()
raise AssertionError("calling get_platform using asyncify resulted in a hung process") from e
timeout = 10 # seconds

start_time = time.monotonic()
while True:
return_code = process.poll()
if return_code is not None:
if return_code != 0:
raise AssertionError("calling get_platform using asyncify resulted in a non-zero exit code")

# success
break

if time.monotonic() - start_time > timeout:
process.kill()
raise AssertionError("calling get_platform using asyncify resulted in a hung process")

time.sleep(0.1)
Loading