Repository navigation
Studio: exempt shared top-level trees from the integrity check for our own wheels too - #8179
Merged
Merged
Conversation
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Apply the shared-top-level-tree exemption in Studio's post-update integrity check to Unsloth's own distributions as well. Without it,
unsloth studio updatefails on every attempt with a finding no reinstall can clear.Motivation
#8092 added
_SHARED_NON_RUNTIME_ROOTSso a row under a squatted top-level namespace (test/,tests/,docs/,scripts/, ...) no longer counts as damage. Ownership of those paths is unreliable: whichever wheel installs last wins, and any of them uninstalling takes the others' files with it.It exempted third parties only. The reasoning was that a missing
__init__.pydoes not make a directory unimportable and that the repo importsscripts.*itself, so our own top-level trees should stay guaranteed. That does not hold in practice. Nothing underunsloth/,unsloth_cli/orstudio/imports a top-levelscriptsortestsat runtime, and unsloth ships neither. unsloth_zoo did: every release from 2026.5.2 to 2026.8.5 packaged the repo'stests/andscripts/trees into site-packages, straight into the same shared namespace.So the carve-out singled out the one distribution of ours that was actually exposed to the collision:
11429 is exactly
tests/conftest.pyin the 2026.8.5 wheel, so the recorded size is ours and the file on disk is not. This was reported on 2026.8.8, which already carries #8092, on an install that was otherwise up to date. Theeinxandpackage-lock.jsonfindings were gone and only this one remained, on every retry. The printed remedy cannot help, because pip sees intact metadata and nothing is really damaged.Ownership being unreliable is a property of the path, not of the distribution claiming it. unsloth-zoo#1016 stops shipping the two trees, but anyone who already has unsloth_zoo 2026.5.2 through 2026.8.5 installed keeps the polluted site-packages, so the check has to tolerate it.
Changes
unsloth_cli/_studio_deps.py: drop the_OUR_DISTRIBUTIONScarve-out from_shared_non_runtime, which no longer needs the distribution name.studio/backend/utils/transformers_version.py: same carve-out removed from the sidecar scan, keeping the two implementations in sync.The exemption stays scoped to the shared roots.
unsloth_zoo/tests/helper.pyis inside a package we own and is still reported when it goes missing, as is every other runtime path.How to test
413 passed. Full
unsloth_cli/tests: 942 passed, 4 skipped. Reverting only the two source files while keeping the new tests fails all three of the added cases and passes both "still checked" guards.Related
tests/andscripts/from the wheel, which fixes the cause for new installs.