-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Treat --upgrade-package on the command-line as overriding upgrade = false in configuration
#15395
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
Conversation
408dd75 to
7d497ab
Compare
7d497ab to
8804d3b
Compare
|
The new behavior makes sense to me! One thing that I found unexpected is that This is different from When reading the code, my main confusion was that the struct isn't fully usable, the upgrade package list is only consider if neither #[derive(Debug, Clone)]
pub enum UpgradeSelection {
All,
None,
// Packages are relevant, otherwise `Option<UpgradeSelection>` would be `None`.
Packages(Vec<Requirement>),
}
impl UpgradeSelection {
#[must_use]
pub fn combine(self, other: Self) -> Self {
match self {
// Setting `--upgrade` or `--no-upgrade` clear previous `--upgrade-package` selections.
Self::All | Self::None => self,
Self::Packages(self_packages) => match other {
// With `--upgrade` previously, `--upgrade-package` is subsumed by upgrading all packages.
Self::All => other,
// With `--no-upgrade` previously, and now `--upgrade-package`, upgrade the explicit package list.
Self::None => Self::Packages(self_packages),
// If both had `--upgrade-package`, upgrade the combined package list.
Self::Packages(other_packages) => {
let mut combined = self_packages;
combined.extend(other_packages);
Self::Packages(combined)
}
},
}
}
} |
|
I agree with
I'd expect Otherwise, I'm a +1 on the behavior. It sounds actually doesn't require encoding a relationship between the persistent configuration and the CLI like we were discussing? Or does |
|
I thought we had discussed the the no-upgrade / upgrade-package behavior and decided we wanted to change it but that it was breaking? That’s why I left a TODO. It’s easy to change now either way.
Yeah, that doesn’t perform any upgrades (which I think is correct). |
|
I didn't see a TODO item for that, but delaying the breaking change to 0.9 makes sense, should we add a warning now that |
Oh I see, I didn't realize you were separating it out into a bug fix and a breaking change. Sorry. I don't mind doing it that way as long as we're aligned on the end behavior. |
Yeah that sounds correct to me. It does introduce that complexity of different semantics depending on the origin layer, but it sounds worth it. |
|
Ah sorry, I guess the TODO is in the test suite (specifically, above the test with the undesirable result) and was introduced in the PR that added the tests, so doesn't appear here. |
I think I'd rather not do this because I don't want them to be an error in 0.9, I want |
I agree. |
|
That's even better! |
|
(I'll take a look at @konstin's suggested refactor, might make things simpler.) |
59f4063 to
0c6ac04
Compare
|
Okay, we now use an |
| } | ||
| } | ||
|
|
||
| #[derive(Debug, Default, Clone, serde::Serialize, serde::Deserialize)] |
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.
Should this type be (de)serialize?
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.
No, thanks :)
0c6ac04 to
c207819
Compare
c207819 to
b2a6bcd
Compare
## Summary This is like #15395, but for `--reinstall` and `--reinstall-package`.
## Summary Like #15395, but `--no-build-isolation`.
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.8.12` -> `0.8.13` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>astral-sh/uv (astral-sh/uv)</summary> ### [`v0.8.13`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0813) [Compare Source](astral-sh/uv@0.8.12...0.8.13) ##### Enhancements - Add `--no-install-*` arguments to `uv add` ([#​15375](astral-sh/uv#15375)) - Initialize Git prior to reading author in `uv init` ([#​15377](astral-sh/uv#15377)) - Add CUDA 129 to available torch backends ([#​15416](astral-sh/uv#15416)) - Update Pyodide to 0.28.2 ([#​15385](astral-sh/uv#15385)) ##### Preview features - Add an experimental `uv format` command ([#​15017](astral-sh/uv#15017)) - Allow version specifiers in `extra-build-dependencies` if match-runtime is explicitly `false` ([#​15420](astral-sh/uv#15420)) ##### Bug fixes - Add `triton` to `torch-backend` manifest ([#​15405](astral-sh/uv#15405)) - Avoid panicking when resolver returns stale distributions ([#​15389](astral-sh/uv#15389)) - Fix `uv_build` wheel hashes ([#​15400](astral-sh/uv#15400)) - Treat `--upgrade-package` on the command-line as overriding `upgrade = false` in configuration ([#​15395](astral-sh/uv#15395)) - Restore DockerHub publishing ([#​15381](astral-sh/uv#15381)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS44Mi4xIiwidXBkYXRlZEluVmVyIjoiNDEuODIuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Summary
Right now, if you put
upgrade = falsein auv.toml, then pass--upgrade-package numpyon the CLI, we won't upgrade NumPy. This PR fixes that interaction by ensuring that when we "combine", we look at those arguments holistically (i.e., we bundleupgradeandupgrade-packageinto a single struct, which then goes through the.combinelogic), rather than combiningupgradeandupgrade-packageindependently.If approved, I then need to add the same thing for
no-build-isolation,reinstall,no-build, andno-binary.