Skip to content

Keep the MLX install ordering tests independent of the runner certifi and pip - #18358

Merged
danielhanchen merged 1 commit into
mainfrom
ci/mlx-install-test-skip-trust-floor
Nov 18, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci/mlx-install-test-skip-trust-floor

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

On a runner whose own certifi or pip is below the CA trust floor and has no uv on PATH, 59 cases in tests/studio/install/test_mlx_install.py fail:

studio/install_python_stack.py:8272: in _ensure_trust_floor
studio/install_python_stack.py:9653: in pip_install_try
FileNotFoundError: [Errno 2] No such file or directory: 'uv'

This showed up on the macOS leg of the cross-platform staging run for #16799 (runner certifi 2026.7.22, below the certifi>=2026.10.19 floor).

Cause

install_python_stack() calls _ensure_trust_floor() on every setup and update (#14887). That raises certifi, and pip on 3.10+, through pip_install_try whenever the running interpreter does not already meet the floor. The _run_to_extras helper stubs pip_install, run, _bootstrap_uv and the torch steps, but not this path. So whether these tests spawn a real installer depended on the runner image's certifi and pip versions. On hosts that already meet the floor, nothing runs and the tests pass.

The installer behaviour is correct. The test was not hermetic.

Fix

Stub _trust_floor_specs to return [] in the helper, next to the _no_torch_pair stub from #18354. The floor logic keeps its own coverage in tests/studio/install/test_ca_trust_floor.py.

Verification

Reproduced by raising the certifi floor above any installed version and running with uv removed from PATH:

Tree floor unmet, no uv normal
main 59 failed, 15 passed 74 passed
this branch 74 passed 74 passed

test_ca_trust_floor.py passes unchanged, and ruff is clean.

…fi and pip

install_python_stack() raises certifi / pip to the CA trust floor through
pip_install_try, which the helper did not stub. On a runner whose certifi
or pip is below the floor and has no uv on PATH, 59 cases fail with
FileNotFoundError: 'uv'. Stub _trust_floor_specs; the floor has its own
tests in test_ca_trust_floor.py.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T17:11:18.832985Z c7575f0 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: c7575f07bf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit b66a2e9 into main Nov 18, 2026
@danielhanchen
danielhanchen deleted the ci/mlx-install-test-skip-trust-floor branch November 18, 2026 17:12
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