Skip to content

Pin uv to 0.13.7 in the workflow and guard it with required-version - #11

Merged
docxology merged 1 commit into
mainfrom
chore/pin-uv-version
Nov 5, 2026
Merged

docxology merged 1 commit into
mainfrom
chore/pin-uv-version

Conversation

@docxology

@docxology docxology commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

astral-sh/setup-uv is pinned to a full commit SHA, but the pin covers the installer: the uv version it installs comes from the version input, and with no version passed the action resolves required-version from uv.toml/pyproject.toml and, finding none, installs the latest uv. So this workflow reads as pinned while the tool it installs floats. That is the same shape as a pandoc/actions/setup pin that installs the latest pandoc.

This change makes the installed uv a declared value and puts a guard beside it:

file line job inputs before
.github/workflows/gates.yml 22 gates enable-cache
.github/workflows/gates.yml 72 gnn-conformance enable-cache
  • version: "0.13.7" is added to every such step. 0.13.7 is the current latest release and therefore what these steps install today — the change declares the version rather than moving it.
  • required-version = "==0.13.7" is added in [tool.uv] in pyproject.toml. It is the same value in the same commit, deliberately: uv refuses to run when the running version does not satisfy the guard ("Required uv version ==X does not match the running version Y", exit 2), so a version: that drifts from the guard turns the run red on the push that drifts it instead of silently installing a different tool. Bump the two together. A uv invocation that disables project discovery (--no-project) is not covered by the guard.

Verified before opening: the workflow parses as YAML and the manifest as TOML; the guard is enforced and satisfied by a project-aware command in the repository (uv lock --check exit 0 where a uv.lock exists, uv pip list exit 0 where it does not); and a deliberately mismatched guard was confirmed to make uv lock --check exit 2, so the guard is demonstrated to fail rather than assumed to.

Step order is load-bearing in this file. The two uvx ruff steps (gates.yml:31-32) run outside the guard's reach — uvx does not construct the project, so required-version is not consulted (measured). What covers this repository is uv sync --frozen at gates.yml:27, the first project-aware command in the same job; if a future edit moves the lint steps above it, or moves that sync into another job, the lint half stops being guarded while still reading as pinned.

astral-sh/setup-uv is pinned by commit, which pins the installer, not the tool: with no
`version` input the action installs the latest uv. Adds `version: "0.13.7"` to
2 steps and `required-version = "==0.13.7"` to [tool.uv]` in `pyproject.toml,
the same value in the same commit, so the two can only drift together.
@docxology
docxology merged commit bf8f081 into main Nov 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant