Skip to content

ci(unit-tests): use python -m pip for vision golden deps#1518

Merged
key4ng merged 1 commit into
mainfrom
ci/use-python-m-pip-vision-golden
May 21, 2026
Merged

ci(unit-tests): use python -m pip for vision golden deps#1518
key4ng merged 1 commit into
mainfrom
ci/use-python-m-pip-vision-golden

Conversation

@key4ng
Copy link
Copy Markdown
Collaborator

@key4ng key4ng commented May 21, 2026

Description

Problem

The unit-tests job's "Generate vision golden fixtures" step intermittently fails with:

/runner/_work/_temp/<id>.sh: line 1: pip: command not found
##[error]Process completed with exit code 127.

Example: run 26246631641 on PR #1516.

The step uses bare pip install .... On the self-hosted k8s-runner-cpu pool, actions/setup-python@v6 reliably puts python on PATH but doesn't always expose pip — the prior step in the same job ("Set up Python") completes successfully, so the interpreter is provisioned, but the pip shim isn't always discoverable. The same step has succeeded on other runs (e.g. main run 26212745181), so it's an intermittent runner-environment issue, not a deterministic break.

Solution

Invoke pip via python -m pip so the shim is resolved through the interpreter that setup-python set up, removing the PATH dependency. This is the same idiom already used elsewhere in this workflow (e.g. python-unit-tests job uses python3 -m pip install ...).

Changes

  • .github/workflows/pr-test-rust.yml: change two pip install invocations in the "Generate vision golden fixtures" step to python -m pip install. Also drops the stray blank line between them.

Test Plan

  • CI on this PR exercises the modified step.
  • No behavior change to the fixture-generation script itself; same packages, same target.
Checklist
  • cargo +nightly fmt passes (workflow-only change)
  • cargo clippy --all-targets --all-features -- -D warnings passes (workflow-only change)
  • (Optional) Documentation updated
  • (Optional) Please join us on Slack #sig-smg to discuss, review, and merge PRs

Summary by CodeRabbit

  • Chores
    • Updated continuous integration workflow to enhance package installation reliability during testing.

Review Change Stack

Bare `pip install` is flaky on the self-hosted k8s-runner-cpu pool:
`actions/setup-python@v6` reliably exposes `python` on PATH but not
always `pip`, producing intermittent `pip: command not found` (exit
127) at the "Generate vision golden fixtures" step.

Invoke pip via `python -m pip` so the shim is resolved through the
interpreter that setup-python provisioned, which removes the PATH
dependency. No behavior change otherwise.

Signed-off-by: key4ng <rukeyang@gmail.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c76a7e57-3f32-464e-be03-d77d998f11f5

📥 Commits

Reviewing files that changed from the base of the PR and between 9ed4954 and 828f42b.

📒 Files selected for processing (1)
  • .github/workflows/pr-test-rust.yml

📝 Walkthrough

Walkthrough

The PR updates the PR test workflow to modernize Python package installation commands. The "Generate vision golden fixtures" step in the unit-tests job switches from plain pip install to python -m pip install for both torch/torchvision and the subsequent dependency group, ensuring explicit Python interpreter module usage.

Changes

CI Workflow Maintenance

Layer / File(s) Summary
Pip install command modernization
.github/workflows/pr-test-rust.yml
The "Generate vision golden fixtures" step updates package installation to use python -m pip install for torch/torchvision and transformers/pillow/numpy/scipy, replacing plain pip install invocations.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

ci

Suggested reviewers

  • CatherineSue
  • slin1237
  • XinyueZhang369

Poem

🐰 A hop through workflows, ever neat,
Python's pip commands now run complete,
With -m module, no paths to fear,
The fixtures shine bright, crystal clear! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: switching to python -m pip for vision golden fixture dependencies in the CI workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/use-python-m-pip-vision-golden

Warning

Review ran into problems

🔥 Problems

Stopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a @coderabbit review after the pipeline has finished.


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the ci CI/CD configuration changes label May 21, 2026
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Using python -m pip ensures the correct pip is used for the active Python interpreter — standard best practice for CI environments.

@key4ng key4ng merged commit 2e25397 into main May 21, 2026
45 of 47 checks passed
@key4ng key4ng deleted the ci/use-python-m-pip-vision-golden branch May 21, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI/CD configuration changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants