Skip to content

Keep the MLX install ordering tests off the package index - #18354

Merged
danielhanchen merged 1 commit into
mainfrom
ci/mlx-install-test-stub-no-torch-pair
Nov 18, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci/mlx-install-test-stub-no-torch-pair

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

tests/studio/install/test_mlx_install.py::test_mlx_install_respects_platform_mode_and_pins fails its 8 *-gguf_only-update-* cases whenever the runner cannot reach the package index:

RuntimeError: Could not resolve a compatible unsloth / unsloth-zoo pair for no-torch mode

This has shown up on the cross-platform staging runs (Ubuntu and macOS legs).

Cause

Since #16157, _desktop_unsloth_spec in no-torch mode calls _no_torch_pair, which resolves the unsloth / unsloth-zoo pair against the live index. The _run_to_extras helper stubs every other installer side effect (run, pip_install, _bootstrap_uv, the torch ensure steps), but not this one. The no-torch update cases therefore make a real resolver call, and a None from it aborts the install before the step ordering being tested is reached.

The installer behaviour is correct. The test was missing a stub.

Fix

Stub _no_torch_pair in the helper with the same fixed pair the other suites use (("2026.11.1", "2026.11.1", 0), as in tests/python/test_no_torch_filtering.py and tests/studio/install/test_rocm_support.py). The resolver keeps its own coverage in tests/python/test_desktop_unsloth_spec_no_deps_pair.py.

Verification

With the index made unreachable (PIP_INDEX_URL/UV_INDEX_URL/UV_DEFAULT_INDEX pointed at 127.0.0.1:9, UV_OFFLINE=1, PIP_NO_INDEX=1):

Tree Result
main 8 failed, 66 passed
this branch 74 passed

With network access, this branch also passes 74 out of 74. ruff is clean.

The no-torch update cases reach _desktop_unsloth_spec, which since #16157
resolves the unsloth / unsloth-zoo pair against the live index. When the
runner cannot reach it the resolver returns None and 8 parametrized cases
fail with 'Could not resolve a compatible unsloth / unsloth-zoo pair'.
Stub _no_torch_pair in the helper; the resolver has its own tests.
@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-18T16:14:11.395706Z 89cb289 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Unknown error
ℹ️ 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

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 89cb28925c

ℹ️ 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 2c5ae1d into main Nov 18, 2026
@danielhanchen
danielhanchen deleted the ci/mlx-install-test-stub-no-torch-pair branch November 18, 2026 16:15
danielhanchen added a commit that referenced this pull request Nov 18, 2026
… and pip (#18358)

## 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.
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