Lock Python release build tools with uv (#56290)

## Why

Python release jobs installed build tools without a shared lockfile and allowed isolated builds to resolve additional dependencies. Release retries can also build older source revisions, so their tool pins need to come from the running workflow revision.

## What changed

- Add a shared setup action with pinned `uv` and locked `sdk` and `runtime` dependency groups. Apply a seven-day dependency age cutoff, with a two-day exception for `certifi` CA trust updates.
- Use the action for Python SDK and runtime packaging across Linux, macOS, and Windows. Build with `uv build --offline --no-build-isolation` using the prepared environments.
- In the standalone Python build workflows, check out the release tools from `github.workflow_sha` separately from the requested source revision.

GitOrigin-RevId: a9c0344930e5b9870ce9f7754a1fee1a9219305c
This commit is contained in:
Adam Perry @ OpenAI
2026-10-22 23:06:25 +00:00
committed by copyberry
parent 9100b9c3d3
commit 66f6da6036
7 changed files with 918 additions and 22 deletions
@@ -0,0 +1,13 @@
[project]
name = "codex-python-release-tools"
version = "0.0.0"
requires-python = ">=3.10"
[dependency-groups]
sdk = ["certifi>=2026.10.19", "packaging>=26.2", "twine>=7.0.0", "uv-build>=0.11.33,<0.12"]
runtime = ["hatchling>=1.32.4"]
[tool.uv]
exclude-newer = "7 days"
# Use a shorter waiting period for emergency CA trust updates.
exclude-newer-package = { certifi = "2 days" }