Put the branch's own Python under test on the clean-machine legs

install.sh and install.ps1 come from the ref under test, but they install
unsloth from PyPI, which is the consumer path and has to stay that way. That
left everything Python-side coming out of the released wheel: studio/setup.sh,
studio/setup.ps1, studio/install_python_stack.py, and every requirements and
constraints file those resolve through Path(__file__). A branch that changes
constraints.txt or setup.ps1 therefore got a green run that proved nothing
about the change, and some legs proved less than they looked. The Fedora
assertion was already carrying a hand-written workaround for exactly this,
tolerating a triton/git failure on the grounds that the released package lags
the ref.

Legs marked overlay: true now re-point the venv at the ref just before studio
setup runs, through UNSLOTH_CI_SOURCE_OVERLAY: a --no-deps editable install of
the checkout. That makes import studio resolve to the working tree, so the
existing setup-script lookup finds the ref's setup.sh / setup.ps1 and
install_python_stack reads the ref's constraints, with no other change to
either installer.

Not --local: --local additionally installs unsloth-zoo from a git+https URL,
which genuinely needs git, and git absence is the whole point of the masked
legs. The overlay resolves no dependencies and clones nothing, so it holds up
with git, cmake and the compilers all gone. It is not a consumer knob either:
no flag, no usage entry, ignored unless the variable names a directory with a
pyproject.toml in it.

Four legs stay on the released package deliberately, each for its own reason,
recorded in the header: the mac pipe legs keep an end-to-end signal on what a
user actually runs; the trace leg would otherwise answer its own question,
since the editable build calls git through setuptools-scm's file finder; the
non-root Linux leg dies before a venv exists; and WSL only ever receives
install.sh, not a source tree.

Two supporting fixes the overlay depends on or exposes:

install_python_stack.py discarded uv's output whenever a step succeeded, so
the nobuild assertion, which reads the install log, could not see a source
build in the dependency phase at all. That is the phase that installs
studio.txt, where an sdist-only dependency actually turns up, and it reported
"built: none" regardless. It now echoes successful output under
UNSLOTH_VERBOSE, matching what install.sh's run_install_cmd already does.

nobuild now ignores "Building <name> @ file://" lines. A local-path build is
something the caller pointed at, never a dependency resolution chose, and
index dependencies always print <name>==<version>, so a real sdist from PyPI
is still caught, including one named unsloth.

Each overlaid leg also asserts it really was overlaid, so an unset variable
cannot quietly put the whole matrix back on the released wheel.
This commit is contained in:
danielhanchen 2026-07-28 22:25:13 +00:00
commit 3be21e87cf
5 changed files with 245 additions and 21 deletions

View file

@ -2736,6 +2736,11 @@ def pip_install_try(
env = _install_env_for_cmd(cmd),
)
if result.returncode == 0:
# Same reasoning as pip_install: a successful install that built from
# source is exactly what the clean-machine `nobuild` assert exists to
# catch, and it can only see what reaches the log.
if VERBOSE and result.stdout:
print(_redact_install_output(result.stdout))
return True
if VERBOSE and result.stdout:
# pip/uv echo index URLs (credentials included) in failure output.
@ -2791,6 +2796,17 @@ def pip_install(
**_windows_hidden_subprocess_kwargs(),
)
if result.returncode == 0:
# Echo the successful output under UNSLOTH_VERBOSE, the same way
# install.sh's run_install_cmd does. Dropping it made the whole
# dependency phase invisible to anything reading the install log:
# .github/scripts/clean-machine-assert.sh's `nobuild` check greps
# for uv's "Building <pkg>==<ver>", so a source build here -- and
# this is the step that installs studio.txt, where an sdist-only
# dependency actually shows up -- left it reporting "built: none"
# and the leg green. Redacted, because uv echoes index URLs with
# credentials in them.
if VERBOSE and result.stdout:
print(_redact_install_output(result.stdout))
return
print(_red(f" uv failed, falling back to pip..."))
if result.stdout: