Skip to content

Conversation

darinkishore
Copy link

What

  • add a Python SDK for Codex that mirrors the TypeScript surface (thread events, typed items, streaming APIs)
  • expose strongly typed status enums and accept Pydantic v2 BaseModel classes/instances for output_schema
  • provide a bundling helper (sdk/python/scripts/install_native_deps.py) so releases can vendor the Rust CLI like the TS SDK
  • publishable distribution renamed to openai-codex-sdk; docs/CI updated accordingly with latest dev tooling (pytest 8.4, mypy 1.18)

How

  • the transport shells out to codex exec --experimental-json, matching the Rust/TS event schema via dataclasses and StrEnum
  • schema handling converts Pydantic models via model_json_schema() before writing the temp file passed to --output-schema
  • CI uses astral-sh/setup-uv@v6 to install Python 3.12, sync deps with uv sync --extra dev, and run ruff, mypy --config-file sdk/python/pyproject.toml sdk/python/src/codex, and pytest
  • release bundling wraps the existing codex-cli/scripts/install_native_deps.py so the wheel ships official binaries

Testing

  • uv run --project sdk/python ruff check
  • uv run --project sdk/python mypy --config-file sdk/python/pyproject.toml sdk/python/src/codex
  • uv run --project sdk/python pytest
  • cargo test
  • cargo clippy --tests
  • cargo fmt -- --config imports_granularity=Item

Notes

  • the GitHub Actions stage_npm_packages.py step expects internal release artifacts and fails on my fork CI; upstream runs provide the workflow URL during releases

Copy link

github-actions bot commented Oct 9, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@darinkishore
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@darinkishore
Copy link
Author

recheck

github-actions bot added a commit that referenced this pull request Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants