Use dependency groups for Python SDK tooling (#27538)

## Summary

`just fmt` previously used `uv run --with ruff` to make Ruff available.
Because `--with` creates an ephemeral overlay outside the project
lockfile, uv periodically re-resolved Ruff (by default every 10 minutes)
instead of using the version recorded in `uv.lock`.

Move the Python SDK tooling dependencies from the published `dev` extra
into `format`, `test`, and composed `dev` dependency groups. The
formatter now selects only the locked `format` group, contributor and CI
setup explicitly sync the `dev` group, and CI and release commands reuse
that environment with `--frozen --no-sync`. The scripts formatter also
uses its project's locked Ruff dependency instead of an ephemeral
overlay.

Validated the Python 3.12 SDK suite (119 passed, 38 skipped) and the
repository formatter.
This commit is contained in:
Charlie Marsh
2026-06-12 12:10:07 -04:00
committed by GitHub
Unverified
parent 3cac2e0d3f
commit c375deaf66
8 changed files with 46 additions and 29 deletions
+3 -8
View File
@@ -37,17 +37,15 @@ class FormatterResult:
def formatter_groups(*, check: bool) -> tuple[FormatterGroup, ...]:
just_args = ["just", "--unstable", "--fmt"]
cargo_args = ["cargo", "fmt", "--", "--config", "imports_granularity=Item"]
# Use an unpinned overlay so Ruff is available without syncing project
# dependencies. Each `--project` still retains its local configuration context.
# Each `--project` retains its local dependency and Ruff configuration context.
sdk_uv_run_args = [
"uv",
"run",
"--frozen",
"--project",
"sdk/python",
"--no-sync",
"--with",
"ruff",
"--only-group",
"format",
]
scripts_uv_run_args = [
"uv",
@@ -55,9 +53,6 @@ def formatter_groups(*, check: bool) -> tuple[FormatterGroup, ...]:
"--frozen",
"--project",
"scripts",
"--no-sync",
"--with",
"ruff",
]
sdk_format_args = [
*sdk_uv_run_args,