openai-agents-python/pyproject.toml
Mark Stuart 86ad2d065c
Precompile SDK dataclass methods for cold startup (#5993)
* Precompile SDK dataclass methods for cold startup

* Fall back when generated factory bytecode is damaged

* Preserve dataclass declarations in the released API check

* Exercise dataclass factory staging in wheel hook tests

---------

Co-authored-by: markstuart-oai <323302876+markstuart-oai@users.noreply.github.com>
2026-11-14 04:42:02 -08:00

357 lines
10 KiB
TOML

[project]
name = "openai-agents"
version = "0.24.0-alpha.8" # x-release-please-version
description = "OpenAI Agents SDK"
readme = "packages/codex/README.md"
requires-python = ">=3.10"
license = "MIT"
authors = [{ name = "OpenAI", email = "support@openai.com" }]
dependencies = [
"jsonschema>=4.25.1,<5",
"referencing>=0.36.2,<1",
"pydantic>=2.12.2,<3",
"typing-extensions>=4.15,<5",
]
classifiers = [
"Typing :: Typed",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: MIT License",
]
[project.urls]
Homepage = "https://github.com/openai/openai-agents-python/tree/feat/codex-harness"
Repository = "https://github.com/openai/openai-agents-python"
[project.optional-dependencies]
dapr = [
"dapr>=1.16.0",
"grpcio>=1.60.0",
"aiohttp>=3.14.3,<4",
"protobuf>=5.29.6,!=6.30.*,!=6.31.*,!=6.32.*,!=6.33.0.*,!=6.33.1.*,!=6.33.2.*,!=6.33.3.*,!=6.33.4.*",
]
tracing = ["httpx2>=2.12.0"]
a2a = ["a2a-sdk==1.3.0"]
decisions = ["openai>=3.41.0,<4"]
# Native speech workflows reuse the retained speech engine and its dependencies.
voice = [
"openai-agents[classic]",
"numpy>=2.2.0, <3; python_version>='3.10'",
"websockets>=15.0, <17",
]
# Classic retains the established Python runtime and its patched dependency floors.
classic = [
"openai>=3.0.0,<4",
"pydantic>=2.12.2, <3",
"griffelib>=2, <3",
"typing-extensions>=4.12.2, <5",
"requests>=2.0, <3",
"websockets>=15.0, <17",
"mcp>=1.30.0, <3, !=2.0.*, !=2.1.*; python_version >= '3.10'",
"certifi>=2026.10.19",
"httpx2>=2.12.0",
"pyjwt>=2.15.0",
"python-multipart>=0.0.31",
"starlette>=1.3.1",
"urllib3>=2.8.0",
]
classic-voice = [
"openai-agents[classic]",
"numpy>=2.2.0, <3; python_version>='3.10'",
"websockets>=15.0, <17",
]
classic-viz = [
"openai-agents[classic]",
"graphviz>=0.17",
]
classic-litellm = [
"openai-agents[classic]",
"litellm>=1.83.0",
"aiohttp>=3.14.3,<4",
"filelock>=3.20.3",
]
classic-any-llm = [
"openai-agents[classic]",
"any-llm-sdk>=1.11.0, <2; python_version >= '3.11'",
"pygments>=2.20.0; python_version >= '3.11'",
]
classic-realtime = [
"openai-agents[classic]",
"websockets>=15.0, <17",
]
classic-sqlalchemy = [
"openai-agents[classic]",
"SQLAlchemy[asyncio]>=2.0",
"asyncpg>=0.29.0",
]
classic-encrypt = [
"openai-agents[classic]",
"cryptography>=45.0,<51",
]
classic-redis = [
"openai-agents[classic]",
"redis>=7",
]
classic-dapr = ["openai-agents[classic,dapr]"]
classic-mongodb = [
"openai-agents[classic]",
"pymongo>=4.18.3",
]
classic-docker = [
"openai-agents[classic]",
"docker>=6.1",
]
classic-blaxel = [
"openai-agents[classic]",
"blaxel>=0.2.51",
"aiohttp>=3.14.3,<4",
]
classic-daytona = [
"openai-agents[classic]",
"daytona>=0.155.0",
"aiohttp>=3.14.3,<4",
"protobuf>=5.29.6,!=6.30.*,!=6.31.*,!=6.32.*,!=6.33.0.*,!=6.33.1.*,!=6.33.2.*,!=6.33.3.*,!=6.33.4.*",
]
classic-cloudflare = [
"openai-agents[classic]",
"aiohttp>=3.14.3,<4",
]
classic-e2b = [
"openai-agents[classic]",
"e2b==2.31.0",
"e2b-code-interpreter==2.8.1",
"h2>=4.4.1",
"protobuf>=5.29.6,!=6.30.*,!=6.31.*,!=6.32.*,!=6.33.0.*,!=6.33.1.*,!=6.33.2.*,!=6.33.3.*,!=6.33.4.*",
"pygments>=2.20.0",
]
classic-modal = [
"openai-agents[classic]",
"modal==1.4.3",
"aiohttp>=3.14.3,<4",
"cbor2>=5.9.0",
"h2>=4.4.1",
"protobuf>=5.29.6,!=6.30.*,!=6.31.*,!=6.32.*,!=6.33.0.*,!=6.33.1.*,!=6.33.2.*,!=6.33.3.*,!=6.33.4.*",
"pygments>=2.20.0",
]
classic-vercel = [
"openai-agents[classic]",
"vercel-sandbox>=0.7.0,<0.9",
"cbor2>=5.9.0",
]
classic-s3 = [
"openai-agents[classic]",
"boto3>=1.34",
]
classic-temporal = [
"openai-agents[classic]",
"temporalio==1.34.0",
"textual>=8.2.3,<8.3",
"protobuf>=5.29.6,!=6.30.*,!=6.31.*,!=6.32.*,!=6.33.0.*,!=6.33.1.*,!=6.33.2.*,!=6.33.3.*,!=6.33.4.*",
"pygments>=2.20.0",
]
[dependency-groups]
dev = [
"a2a-sdk[http-server]==1.3.0",
"uvicorn>=0.30,<1",
"openai-agents[classic,classic-voice,classic-viz,classic-litellm,classic-any-llm,classic-realtime,classic-sqlalchemy,classic-encrypt,classic-redis,classic-dapr,classic-mongodb,classic-docker,classic-blaxel,classic-daytona,classic-cloudflare,classic-e2b,classic-modal,classic-vercel,classic-s3,classic-temporal]",
"aiosqlite>=0.21.0",
"exceptiongroup>=1.2.0",
"mypy>=2.2,<3",
"types-jsonschema>=4.25,<5",
"types-protobuf>=5,<8",
"ruff==0.16.8",
"pytest>=9.0.3",
"pytest-asyncio",
"async-timeout>=5,<6; python_version < '3.11'",
"pytest-xdist",
"aiohttp>=3.14.3,<4",
"packaging>=25",
"hatchling",
"maturin>=1.16.0,<2",
"tomli==2.2.1; python_version < '3.11'",
"pyright==1.1.408",
"coverage>=7.6.12",
"mkdocs>=1.6.0",
"mkdocs-material>=9.7.7",
"mkdocstrings[python]>=0.28.0",
"pygments>=2.20.0",
"pyyaml>=6",
]
pgo = ["aiohttp>=3.14.3,<4", "pytest>=9.0.3", "pytest-asyncio"]
[build-system]
requires = ["hatchling", "maturin>=1.16.0,<2", "patchelf>=0.19.1; sys_platform == 'linux'", "tomli==2.2.1; python_version < '3.11'"]
build-backend = "hatchling.build"
[tool.hatch.build]
exclude = [
"/.agents",
"/.github",
"/.tmp*",
"/.uv*",
"/integration_tests",
]
[tool.hatch.build.targets.sdist]
skip-excluded-dirs = true
only-include = [
"src/agents",
"src/_agents_shared",
"packages/codex/src/_agents_codex",
"CLASSIC.md",
"packages/codex/README.md",
"packages/codex/Cargo.toml",
"packages/codex/Cargo.lock",
"packages/codex/CODEX_REVISION",
"packages/codex/patches",
"packages/codex/rmcp-patches",
"packages/codex/rust",
"packages/codex/scripts",
"packages/codex/tests/native_fixtures.py",
"uv.lock",
]
exclude = ["*.so", "*.dylib", "*.pyd", "/src/agents/bin", "/src/agents/licenses"]
[tool.hatch.build.targets.wheel]
packages = ["src/agents", "src/_agents_shared", "packages/codex/src/_agents_codex"]
dev-mode-dirs = ["src", "packages/codex/src"]
# The qualified native overlay owns these files, including in an extracted sdist.
exclude = ["*.so", "*.dylib", "*.pyd", "/src/agents/bin", "/src/agents/licenses"]
[tool.hatch.build.targets.wheel.hooks.custom]
path = "packages/codex/scripts/hatch_build.py"
require-runtime-dependencies = true
# Maturin supplies the extension and audited native assets to the Hatch hook.
# It reads the same SDK metadata; there is no second Python distribution.
[tool.maturin]
manifest-path = "packages/codex/Cargo.toml"
python-source = "src"
python-packages = ["agents", "_agents_shared"]
module-name = "agents._native"
pgo-command = "python packages/codex/scripts/pgo_train.py"
pgo-dependency-group = "pgo"
include = [
{ path = "src/agents/bin/*", format = "wheel" },
{ path = "src/agents/licenses/*", format = "wheel" },
]
[tool.ruff]
line-length = 100
target-version = "py310"
extend-exclude = [
"packages/codex/scripts",
"packages/codex/rust",
"packages/codex/.upstream",
"packages/codex/target",
]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"ASYNC", # flake8-async
"DTZ005", # datetime.now() without a timezone
"G004", # logging statement uses f-string
"RUF006", # unowned asyncio tasks
"RUF012", # mutable class attributes without ClassVar
"RUF100", # unused noqa directives
"TRY201", # needless exception name in raise statements
"UP", # pyupgrade
]
isort = { combine-as-imports = true, known-first-party = ["agents", "_agents_codex", "examples"] }
logger-objects = ["agents.logger.logger"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"examples/**/*.py" = ["ASYNC", "DTZ005", "E501", "G004", "RUF006", "RUF012", "RUF100"]
"examples/**/*.ipynb" = ["RUF100"]
"packages/codex/tests/**/*.py" = ["ASYNC", "RUF006", "RUF012", "RUF100"]
"packages/codex/scripts/*.py" = ["E402"]
[tool.mypy]
mypy_path = ["src", "packages/codex/src"]
strict = true
disallow_incomplete_defs = false
disallow_untyped_defs = false
disallow_untyped_calls = false
[[tool.mypy.overrides]]
module = "sounddevice.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["modal", "modal.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["e2b", "e2b.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["daytona", "daytona.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["blaxel", "blaxel.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["vercel", "vercel.*"]
ignore_missing_imports = true
[tool.coverage.run]
source = ["src/agents", "src/_agents_shared", "packages/codex/src/_agents_codex"]
omit = ["packages/codex/tests/*"]
[tool.coverage.report]
show_missing = true
sort = "-Cover"
exclude_also = [
# This is only executed while typechecking
"if TYPE_CHECKING:",
"@abc.abstractmethod",
"raise NotImplementedError",
"logger.debug",
]
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
testpaths = ["packages/codex/tests"]
pythonpath = [".", "packages/codex"]
markers = [
"allow_call_model_methods: mark test as allowing calls to real model implementations",
"requires_native_macos_sandbox: mark test as requiring its own macOS sandbox-exec process",
"requires_native_linux_sandbox: require real Linux confinement; missing native support fails unless explicitly nested in Codex",
"review_optional: mark a slow subsystem-specific test that an unrelated iterative review check may omit",
"serial: mark test as requiring exclusive execution after all xdist workers exit",
]
[tool.inline-snapshot]
format-command = "ruff format --stdin-filename {filename}"
[tool.uv]
exclude-newer = "7 days"
index-strategy = "first-index"
[tool.uv.pip]
exclude-newer = "7 days"
index-strategy = "first-index"