Check root Python script formatting in CI (#25165)

## Why

Python files under `scripts/` were not covered by the repository
formatting recipe or the CI formatting job, so formatting drift could
merge unnoticed.

## What

- Add a dedicated `scripts/pyproject.toml` and `scripts/uv.lock` so
root-script formatting uses a locked Ruff version.
- Extend `just fmt` to format root Python scripts and add
`fmt-scripts-check` for CI.
- Run `just fmt-scripts-check` from `.github/workflows/ci.yml`,
installing `uv` through SHA-pinned `astral-sh/setup-uv` while retaining
the `uv` `0.11.3` pin.
- Apply Ruff formatting to the root Python scripts, including
`scripts/just-shell.py`, and extend
`sdk/python/tests/test_artifact_workflow_and_binaries.py` to cover the
root formatting recipe.
- Update `AGENTS.md` so agents run `just fmt` after code changes
anywhere in the repository.

## Validation

- Extended the existing Python SDK workflow test to assert that `just
fmt` includes root Python scripts.
This commit is contained in:
Adam Perry @ OpenAI
2026-06-01 11:50:23 -07:00
committed by GitHub
Unverified
parent c3cdf3c007
commit 281b416c44
17 changed files with 183 additions and 52 deletions
+5 -5
View File
@@ -44,8 +44,7 @@ def parse_args() -> argparse.Namespace:
type=Path,
default=argparse.SUPPRESS,
help=(
"Output directory to create as the package root. Defaults to a new "
"temporary directory."
"Output directory to create as the package root. Defaults to a new temporary directory."
),
)
parser.add_argument(
@@ -72,8 +71,7 @@ def parse_args() -> argparse.Namespace:
"--cargo-profile",
default="dev-small",
help=(
"Cargo profile for source-built package artifacts. Use release for "
"release packages."
"Cargo profile for source-built package artifacts. Use release for release packages."
),
)
parser.add_argument(
@@ -169,7 +167,9 @@ def main() -> int:
)
prepare_package_dir(package_dir, force=args.force)
build_package_dir(package_dir, version, variant, spec, inputs)
validate_package_dir(package_dir, variant, spec, include_zsh=inputs.zsh_bin is not None)
validate_package_dir(
package_dir, variant, spec, include_zsh=inputs.zsh_bin is not None
)
for archive_output in args.archive_output:
archive_path = archive_output.resolve()