From cb142c49ffb7b172a9da1e75854b8e5c0618715d Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Fri, 12 Jun 2026 12:18:28 -0400 Subject: [PATCH 1/3] Use uv as Python SDK build backend --- sdk/python/pyproject.toml | 25 ++++++------------- .../test_artifact_workflow_and_binaries.py | 10 ++------ 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/sdk/python/pyproject.toml b/sdk/python/pyproject.toml index f3bc3a71f254..3ca4c4832201 100644 --- a/sdk/python/pyproject.toml +++ b/sdk/python/pyproject.toml @@ -1,6 +1,6 @@ [build-system] -requires = ["hatchling>=1.27.0"] -build-backend = "hatchling.build" +requires = ["uv_build>=0.11.19,<0.12"] +build-backend = "uv_build" [project] name = "openai-codex" @@ -36,8 +36,12 @@ dev = [ { include-group = "format" }, ] -[tool.hatch.build] -exclude = [ +[tool.uv.build-backend] +module-name = "openai_codex" +source-include = [ + "examples/README.md", +] +source-exclude = [ ".venv/**", ".venv2/**", ".pytest_cache/**", @@ -45,19 +49,6 @@ exclude = [ "build/**", ] -[tool.hatch.build.targets.wheel] -packages = ["src/openai_codex"] -include = [ - "src/openai_codex/py.typed", -] - -[tool.hatch.build.targets.sdist] -include = [ - "src/openai_codex/**", - "README.md", - "pyproject.toml", -] - [tool.pytest.ini_options] addopts = "-q" testpaths = ["tests"] diff --git a/sdk/python/tests/test_artifact_workflow_and_binaries.py b/sdk/python/tests/test_artifact_workflow_and_binaries.py index 7bedc0cc6ff8..340d016ecbe5 100644 --- a/sdk/python/tests/test_artifact_workflow_and_binaries.py +++ b/sdk/python/tests/test_artifact_workflow_and_binaries.py @@ -362,8 +362,8 @@ def test_source_sdk_template_pins_published_runtime() -> None: } -def test_source_sdk_package_declares_beta_documentation_and_release_files() -> None: - """Public package metadata should link beta docs and ship package metadata.""" +def test_source_sdk_package_declares_beta_documentation() -> None: + """Public package metadata should link beta docs.""" pyproject = tomllib.loads((ROOT / "pyproject.toml").read_text()) readme = (ROOT / "README.md").read_text() @@ -372,7 +372,6 @@ def test_source_sdk_package_declares_beta_documentation_and_release_files() -> N "is_beta": "Development Status :: 4 - Beta" in pyproject["project"]["classifiers"], "license": pyproject["project"]["license"], "documentation": pyproject["project"]["urls"]["Documentation"], - "sdist_include": pyproject["tool"]["hatch"]["build"]["targets"]["sdist"]["include"], "readme_is_beta": "# OpenAI Codex Python SDK (Beta)" in readme, "local_license_file": (ROOT / "LICENSE").exists(), } == { @@ -380,11 +379,6 @@ def test_source_sdk_package_declares_beta_documentation_and_release_files() -> N "is_beta": True, "license": "Apache-2.0", "documentation": "https://github.com/openai/codex/tree/main/sdk/python/docs", - "sdist_include": [ - "src/openai_codex/**", - "README.md", - "pyproject.toml", - ], "readme_is_beta": True, "local_license_file": False, } From 8050d6acbd3f4849f23abe51020d1670f4fb8226 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Fri, 12 Jun 2026 12:23:26 -0400 Subject: [PATCH 2/3] Remove redundant uv build exclusions --- sdk/python/pyproject.toml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sdk/python/pyproject.toml b/sdk/python/pyproject.toml index 3ca4c4832201..38239f70a4da 100644 --- a/sdk/python/pyproject.toml +++ b/sdk/python/pyproject.toml @@ -41,13 +41,6 @@ module-name = "openai_codex" source-include = [ "examples/README.md", ] -source-exclude = [ - ".venv/**", - ".venv2/**", - ".pytest_cache/**", - "dist/**", - "build/**", -] [tool.pytest.ini_options] addopts = "-q" From b1d8c54465e9bf2a28dd8f845d8abd3949761b09 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Fri, 12 Jun 2026 13:14:07 -0400 Subject: [PATCH 3/3] Use inferred uv build configuration --- sdk/python/pyproject.toml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sdk/python/pyproject.toml b/sdk/python/pyproject.toml index 38239f70a4da..44bdf00c11c8 100644 --- a/sdk/python/pyproject.toml +++ b/sdk/python/pyproject.toml @@ -36,12 +36,6 @@ dev = [ { include-group = "format" }, ] -[tool.uv.build-backend] -module-name = "openai_codex" -source-include = [ - "examples/README.md", -] - [tool.pytest.ini_options] addopts = "-q" testpaths = ["tests"]