Skip to content
Open
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 .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
permissions:
contents: read
id-token: write
runs-on: depot-ubuntu-24.04
runs-on: ${{ github.repository == 'stainless-sdks/codex-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4

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.1.0-alpha.25"
".": "0.1.0-alpha.26"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
configured_endpoints: 55
openapi_spec_hash: 7daf4896ba4932714f8fe4fff277d7c7
openapi_spec_hash: 3d3361adb6a836f42a49850b5aea1df5
config_hash: bed87752f4056d0c4bf2ddf856307800
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# Changelog

## 0.1.0-alpha.26 (2025-09-05)

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

### Features

* **api:** api update ([3b745af](https://github.com/cleanlab/codex-python/commit/3b745afa4569af091b3a62228af62c036c84718d))
* **api:** api update ([9bb8f17](https://github.com/cleanlab/codex-python/commit/9bb8f17149849ea312caf7b895f02a2c38ac3270))
* **api:** api update ([ecbda1c](https://github.com/cleanlab/codex-python/commit/ecbda1ca9f1aaf40a325e105cc0659ea0e318511))
* **api:** api update ([4151cf2](https://github.com/cleanlab/codex-python/commit/4151cf288ea4f75ac7c6eb5c07c9861d67b5ad92))
* **api:** api update ([cfc87fb](https://github.com/cleanlab/codex-python/commit/cfc87fb65a3a29f0584b7dffccc79f2442307fa9))
* improve future compat with pydantic v3 ([d9ffa38](https://github.com/cleanlab/codex-python/commit/d9ffa3812e5eb836fc85532d57a92937ef3ad7ec))
* **types:** replace List[str] with SequenceNotStr in params ([07bdde8](https://github.com/cleanlab/codex-python/commit/07bdde83153c609ff2b86a4190911cab160aaae2))


### Bug Fixes

* avoid newer type syntax ([7a7b9a3](https://github.com/cleanlab/codex-python/commit/7a7b9a3ee6cfed2e57359a54c1b9292f06cc71b6))


### Chores

* **internal:** add Sequence related utils ([ead0105](https://github.com/cleanlab/codex-python/commit/ead0105a68c77ae308cc0d40c34245265e9cb2b6))
* **internal:** change ci workflow machines ([052599a](https://github.com/cleanlab/codex-python/commit/052599aee2e484d9cc305983da900878374db17d))
* **internal:** move mypy configurations to `pyproject.toml` file ([6285dbe](https://github.com/cleanlab/codex-python/commit/6285dbe7fdc7e6eede39d589ac92d8481595e5e3))
* **internal:** update pyright exclude list ([cc58363](https://github.com/cleanlab/codex-python/commit/cc58363a9c78ce08437508d3c64cb9b29b43e9bd))

## 0.1.0-alpha.25 (2025-08-22)

Full Changelog: [v0.1.0-alpha.24...v0.1.0-alpha.25](https://github.com/cleanlab/codex-python/compare/v0.1.0-alpha.24...v0.1.0-alpha.25)
Expand Down
50 changes: 0 additions & 50 deletions mypy.ini

This file was deleted.

55 changes: 54 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.25"
version = "0.1.0-alpha.26"
description = "Internal SDK used within cleanlab-codex package. Refer to https://pypi.org/project/cleanlab-codex/ instead."
dynamic = ["readme"]
license = "MIT"
Expand Down Expand Up @@ -148,6 +148,7 @@ exclude = [
"_dev",
".venv",
".nox",
".git",
]

reportImplicitOverride = true
Expand All @@ -156,6 +157,58 @@ reportOverlappingOverload = false
reportImportCycles = false
reportPrivateUsage = false

[tool.mypy]
pretty = true
show_error_codes = true

# Exclude _files.py because mypy isn't smart enough to apply
# the correct type narrowing and as this is an internal module
# it's fine to just use Pyright.
#
# We also exclude our `tests` as mypy doesn't always infer
# types correctly and Pyright will still catch any type errors.
exclude = ['src/codex/_files.py', '_dev/.*.py', 'tests/.*']

strict_equality = true
implicit_reexport = true
check_untyped_defs = true
no_implicit_optional = true

warn_return_any = true
warn_unreachable = true
warn_unused_configs = true

# Turn these options off as it could cause conflicts
# with the Pyright options.
warn_unused_ignores = false
warn_redundant_casts = false

disallow_any_generics = true
disallow_untyped_defs = true
disallow_untyped_calls = true
disallow_subclassing_any = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
cache_fine_grained = true

# By default, mypy reports an error if you assign a value to the result
# of a function call that doesn't return anything. We do this in our test
# cases:
# ```
# result = ...
# assert result is None
# ```
# Changing this codegen to make mypy happy would increase complexity
# and would not be worth it.
disable_error_code = "func-returns-value,overload-cannot-match"

# https://github.com/python/mypy/issues/12162
[[tool.mypy.overrides]]
module = "black.files.*"
ignore_errors = true
ignore_missing_imports = true


[tool.ruff]
line-length = 120
output-format = "grouped"
Expand Down
6 changes: 3 additions & 3 deletions src/codex/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
ModelBuilderProtocol,
)
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
from ._compat import PYDANTIC_V2, model_copy, model_dump
from ._compat import PYDANTIC_V1, model_copy, model_dump
from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type
from ._response import (
APIResponse,
Expand Down Expand Up @@ -232,7 +232,7 @@ def _set_private_attributes(
model: Type[_T],
options: FinalRequestOptions,
) -> None:
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
self.__pydantic_private__ = {}

self._model = model
Expand Down Expand Up @@ -320,7 +320,7 @@ def _set_private_attributes(
client: AsyncAPIClient,
options: FinalRequestOptions,
) -> None:
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
self.__pydantic_private__ = {}

self._model = model
Expand Down
Loading