From ddeaa6db67dbf992ff0630d5b7c03848db41d751 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 10:17:53 +0000 Subject: [PATCH 1/5] docs(raw responses): fix duplicate `the` (#24) --- src/codex/resources/health.py | 4 ++-- src/codex/resources/organizations/billing.py | 4 ++-- src/codex/resources/organizations/organizations.py | 4 ++-- src/codex/resources/projects/access_keys.py | 4 ++-- src/codex/resources/projects/entries.py | 4 ++-- src/codex/resources/projects/projects.py | 4 ++-- src/codex/resources/users/myself/api_key.py | 4 ++-- src/codex/resources/users/myself/myself.py | 4 ++-- src/codex/resources/users/myself/organizations.py | 4 ++-- src/codex/resources/users/users.py | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/codex/resources/health.py b/src/codex/resources/health.py index b50884e0..6a777c63 100644 --- a/src/codex/resources/health.py +++ b/src/codex/resources/health.py @@ -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 @@ -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 diff --git a/src/codex/resources/organizations/billing.py b/src/codex/resources/organizations/billing.py index 9c916d83..57424963 100644 --- a/src/codex/resources/organizations/billing.py +++ b/src/codex/resources/organizations/billing.py @@ -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 @@ -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 diff --git a/src/codex/resources/organizations/organizations.py b/src/codex/resources/organizations/organizations.py index e91099e3..73c2542a 100644 --- a/src/codex/resources/organizations/organizations.py +++ b/src/codex/resources/organizations/organizations.py @@ -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 @@ -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 diff --git a/src/codex/resources/projects/access_keys.py b/src/codex/resources/projects/access_keys.py index 8a580f49..bb0dc2ff 100644 --- a/src/codex/resources/projects/access_keys.py +++ b/src/codex/resources/projects/access_keys.py @@ -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 @@ -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 diff --git a/src/codex/resources/projects/entries.py b/src/codex/resources/projects/entries.py index 56c893c0..d307d3d0 100644 --- a/src/codex/resources/projects/entries.py +++ b/src/codex/resources/projects/entries.py @@ -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 @@ -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 diff --git a/src/codex/resources/projects/projects.py b/src/codex/resources/projects/projects.py index de366ee8..38d7b036 100644 --- a/src/codex/resources/projects/projects.py +++ b/src/codex/resources/projects/projects.py @@ -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 @@ -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 diff --git a/src/codex/resources/users/myself/api_key.py b/src/codex/resources/users/myself/api_key.py index c2784b81..d39b124a 100644 --- a/src/codex/resources/users/myself/api_key.py +++ b/src/codex/resources/users/myself/api_key.py @@ -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 @@ -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 diff --git a/src/codex/resources/users/myself/myself.py b/src/codex/resources/users/myself/myself.py index ba4548e5..3ee27229 100644 --- a/src/codex/resources/users/myself/myself.py +++ b/src/codex/resources/users/myself/myself.py @@ -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 @@ -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 diff --git a/src/codex/resources/users/myself/organizations.py b/src/codex/resources/users/myself/organizations.py index 12e799aa..2d5b7127 100644 --- a/src/codex/resources/users/myself/organizations.py +++ b/src/codex/resources/users/myself/organizations.py @@ -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 @@ -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 diff --git a/src/codex/resources/users/users.py b/src/codex/resources/users/users.py index ea5019c2..8a73b474 100644 --- a/src/codex/resources/users/users.py +++ b/src/codex/resources/users/users.py @@ -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 @@ -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 From d1925178d12c441e58cd36c210158ad9d07ee4dd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 10:18:31 +0000 Subject: [PATCH 2/5] fix(tests): make test_get_platform less flaky (#26) --- tests/test_client.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index 4e76d238..d000ab1c 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -6,6 +6,7 @@ import os import sys import json +import time import asyncio import inspect import subprocess @@ -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) From 1ab1a4ebd7b1bdf27847ce74a6c9aad630c0261c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 10:19:07 +0000 Subject: [PATCH 3/5] chore(internal): avoid pytest-asyncio deprecation warning (#27) --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 9cfbc410..fbdd3c76 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -129,6 +129,7 @@ testpaths = ["tests"] addopts = "--tb=short" xfail_strict = true asyncio_mode = "auto" +asyncio_default_fixture_loop_scope = "session" filterwarnings = [ "error" ] From 89c6e8bff457c9269dfa76060b6fe8c757a58c4a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 17:15:44 +0000 Subject: [PATCH 4/5] feat(api): update api base url (#28) --- src/codex/_client.py | 4 ++-- tests/test_client.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/codex/_client.py b/src/codex/_client.py index d9e44320..884d2f3d 100644 --- a/src/codex/_client.py +++ b/src/codex/_client.py @@ -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", } diff --git a/tests/test_client.py b/tests/test_client.py index d000ab1c..3eaa6536 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -522,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", @@ -1263,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", From aff4b469804f05634c67ff453a8b873d2b02e7f2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 17:16:06 +0000 Subject: [PATCH 5/5] release: 0.1.0-alpha.4 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 23 +++++++++++++++++++++++ pyproject.toml | 2 +- src/codex/_version.py | 2 +- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index aaf968a1..b56c3d0b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.3" + ".": "0.1.0-alpha.4" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b61d323f..d791715e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/pyproject.toml b/pyproject.toml index fbdd3c76..6461357d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/src/codex/_version.py b/src/codex/_version.py index 4d9fa623..751ac5dd 100644 --- a/src/codex/_version.py +++ b/src/codex/_version.py @@ -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