-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Clarify 'uv python upgrade' message when no versions exist #16815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| writeln!( | ||
| printer.stderr(), | ||
| "There are no installed versions to upgrade" | ||
| "No Python installations found; run `uv python install` to install a Python version." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this case entirely redundant with the one above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, makes sense. I've applied those changes in the new commit.
| writeln!( | ||
| printer.stderr(), | ||
| "There are no installed versions to upgrade" | ||
| "No Python installations found; run `uv python install` to install a Python version." | ||
| )?; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should use our hint: ... styling for the second part of the message?
We should style the command with color like we do for other commands in output.
nit: I'd probably say "use" instead of "run".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure , i have added those changes in the new commit, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hint formatting I was referring to is like
uv/crates/uv-python/src/interpreter.rs
Lines 863 to 869 in 60a811e
| write!( | |
| f, | |
| "\n\n{}{} Consider recreating the environment (e.g., with `{}`)", | |
| "hint".bold().cyan(), | |
| ":".bold(), | |
| "uv venv".green() | |
| )?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made the changes
Summary
Resolves : #16783
That message is only visible if uv found no managed Python installations. If you had Python installed (even if it was fully up-to-date), requests would not be empty, and the code would skip this block and move on to the resolution phase.
The output message "There are no installed versions to upgrade" was ambiguous. It was unclear whether
uvcould not find any installed versions or if the existing versions were simply already up-to-date as mentioned in issue.So updated the message to
"No Python installations found; run `uv python install` to install a Python version.to explicitly indicate when no
uv-managed Python installations exist.Test Plan
Updated the existing test snapshot in
python_upgrade_without_versionto match the new output string. Verified that tests pass locally withcargo test.