Show current and new version in Studio installer banner - #9914
Open
Greninja44 wants to merge 2 commits into
Open
Show current and new version in Studio installer banner#9914Greninja44 wants to merge 2 commits into
Greninja44 wants to merge 2 commits into
Conversation
install.ps1 printed straight from the banner into "winget available" with no indication of what Studio version was already installed or what this run was about to install (unslothai#9910). Add a shared Get-StudioVersionProbe, used both by a new pre-install check and by the existing post-install report (refactored to call it instead of duplicating the embedded Python), so "current version" always reflects whatever venv is actually on disk. "New version" reuses the same $_unslothReleaseInstallSpec the real install command further down consumes (hoisted, not duplicated), so the two can never drift apart. A fresh install shows "not installed"; a probe that can't run cleanly (missing venv, broken interpreter) degrades to "unknown" without ever blocking or altering the install itself.
for more information, see https://pre-commit.ci
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.
Issue
Closes #9910.
The Windows Unsloth Studio installer (
install.ps1) printed the banner and went straight intowinget available,python ... already installed, etc., with no indication of what version of Studio was already installed or what version this run was about to install:Why
Users had no visibility into what they currently had versus what they were about to get, especially on an upgrade β the first hint of a version only showed up deep in the log, after the fact.
Changes
Get-StudioVersionProbe, a small shared PowerShell function wrapping the existing Python probe (studio.install_manifest.installed_version_probe, falling back toimportlib.metadata) that already ran after install. It's now used in two places: a new pre-install check, and the pre-existing post-install report (refactored to call it instead of duplicating the embedded Python).$VenvDir\Scripts\python.exe, before anything is touched. No prior install βnot installed. A probe that can't run cleanly (missing venv, broken interpreter) βunknownβ this is purely informational and never blocks or alters the actual install.$_unslothDesktopInstallSpec/$_unslothReleaseInstallSpeccomputation (env override, else the pinnedunsloth>=...floor) was hoisted up near the banner instead of duplicated β the exact same variable is still consumed, unchanged, by the realuv pip installcall further down, so the banner can't drift from what actually gets installed.winget available:Testing
[System.Management.Automation.Language.Parser]::ParseFile) on both PowerShell 7.4.6 and real Windows PowerShell 5.1 (build 26100) β passes on both.tests/test_installer_profile_hardening.py::test_install_ps1_parsesβ passes.tests/test_installer_version_banner.py(6 tests): banner lines are ordered between the title andwinget; the install-floor literal isn't duplicated; a fresh install reportsnot installed+ the pinned floor;UNSLOTH_DESKTOP_BACKEND_VERSIONoverride is reflected in "new version"; an existing venv reports its real installed version through the probe; a broken interpreter degrades tounknownwithout crashing.tests/test_installer_unsloth_version.py::test_windows_version_reporter_uses_distribution_metadatato account for the post-install block now calling the shared helper; verified it exercises identical behavior to before the refactor.