-
Notifications
You must be signed in to change notification settings - Fork 760
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
Retain and respect settings in tool upgrades #5937
Conversation
`flask>=3` is already installed | ||
"###); | ||
|
||
// It should update the receipt though. |
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 don't know, I guess? So the receipt represents the "most recent" settings.
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.
fwiw for the lockfile we only write non-default values
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 think updating here makes sense.
"###); | ||
}); | ||
|
||
// Reinstall with `highest`. This is a no-op, since we _do_ have a compatible version installed. |
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.
Hard to say what the right behavior is here. We could also consider discarding the tool whenever settings differ.
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.
This is really tough. It seems okay to change after some user feedback. I'm leaning towards consistent --upgrade
/ --reinstall
semantics where it is required to change the versions. This matches uv pip install
, yes?
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.
Yeah
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.
Now that we have upgrade
, I'm sort of open to making install
more aggressive about replacing though.
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.
That makes sense too.
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.
So we could make it replace whenever the settings or versions differ...
/// The options persisted alongside an installed tool. | ||
/// | ||
/// A mirror of [`ResolverInstallerOptions`], without upgrades and reinstalls, which shouldn't be | ||
/// persisted in a tool receipt. |
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.
We go through some effort to avoid adding --upgrade
to tool receipts. Does that seem right? Otherwise, uv tool install black --upgrade
saves upgrade
in the receipt...
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 that would be weird.
ac8b266
to
8dc4c57
Compare
`flask>=3` is already installed | ||
"###); | ||
|
||
// It should update the receipt though. |
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.
fwiw for the lockfile we only write non-default values
I will review this morning. |
Would most appreciate review of the correct / desired behaviors. |
let executable = bin_dir.child(format!("flask{}", std::env::consts::EXE_SUFFIX)); | ||
assert!(executable.exists()); | ||
|
||
// On Windows, we can't snapshot an executable file. | ||
#[cfg(not(windows))] |
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.
Aside: We should probably open an issue to define a macro for this, since it's non-trivial and repeated.
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.
Yeah good idea. I can do it.
Sorry got half way through this then had meetings and forgot — reading now. |
e609011
to
492088e
Compare
Force upgrade Make settings serializable Rebase
492088e
to
4cf3560
Compare
CodSpeed Performance ReportMerging #5937 will degrade performances by 11.18%Comparing Summary
Benchmarks breakdown
|
We now persist the `ResolverInstallerOptions` when writing out a tool receipt. When upgrading, we grab the saved options, and merge with the command-line arguments and user-level filesystem settings (CLI > receipt > filesystem).
Summary
We now persist the
ResolverInstallerOptions
when writing out a tool receipt. When upgrading, we grab the saved options, and merge with the command-line arguments and user-level filesystem settings (CLI > receipt > filesystem).