Skip to content

Add support for --upgrade-group#18266

Open
zanieb wants to merge 2 commits intomainfrom
zb/upgrade-group
Open

Add support for --upgrade-group#18266
zanieb wants to merge 2 commits intomainfrom
zb/upgrade-group

Conversation

@zanieb
Copy link
Member

@zanieb zanieb commented Mar 3, 2026

Closes #13705

Note this only affects top-level group members, not transitive dependencies of them.

@zanieb zanieb added the enhancement New feature or improvement to existing functionality label Mar 3, 2026
/// Allow upgrades for all packages in a dependency group, ignoring pinned versions in any
/// existing output file.
#[arg(long, help_heading = "Resolver options")]
pub upgrade_group: Vec<GroupName>,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we support package:group for workspace member group selection? We support that syntax elsewhere right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not supported in the project interface right now, deferring.

Ok(())
}

/// `--upgrade-group` is not supported in pip commands.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably make sense in some form, but deferring for now

@zanieb zanieb force-pushed the zb/upgrade-group branch from b5c5f8f to e4a3462 Compare March 3, 2026 17:28
@zanieb zanieb marked this pull request as ready for review March 4, 2026 15:53
/// Returns `true` if no packages should be upgraded.
pub fn is_none(&self) -> bool {
matches!(self.strategy, UpgradeStrategy::None)
matches!(self.strategy, UpgradeStrategy::None) && self.groups.is_empty()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the set of groups somehow be on UpgradeStrategy? Similar to how we store the set of packages?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E.g., it could be All, None, and Some, where Some includes groups and packages?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that modeling seems a bit better, though I think it might be more disruptive. I'll look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or improvement to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrading only one group packages, i.e., --upgrade-group

2 participants