mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-24 13:43:45 +00:00
Do not require workspace members to sync with --frozen
(#6737)
## Summary Closes https://github.com/astral-sh/uv/issues/6685.
This commit is contained in:
parent
485e0d2748
commit
53ef633c6d
9 changed files with 85 additions and 27 deletions
|
@ -44,12 +44,23 @@ pub enum WorkspaceError {
|
|||
Normalize(#[source] std::io::Error),
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub enum MemberDiscovery<'a> {
|
||||
/// Discover all workspace members.
|
||||
#[default]
|
||||
All,
|
||||
/// Don't discover any workspace members.
|
||||
None,
|
||||
/// Discover workspace members, but ignore the given paths.
|
||||
Ignore(FxHashSet<&'a Path>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub struct DiscoveryOptions<'a> {
|
||||
/// The path to stop discovery at.
|
||||
pub stop_discovery_at: Option<&'a Path>,
|
||||
/// The set of member paths to ignore.
|
||||
pub ignore: FxHashSet<&'a Path>,
|
||||
/// The strategy to use when discovering workspace members.
|
||||
pub members: MemberDiscovery<'a>,
|
||||
}
|
||||
|
||||
/// A workspace, consisting of a root directory and members. See [`ProjectWorkspace`].
|
||||
|
@ -546,7 +557,12 @@ impl Workspace {
|
|||
.clone();
|
||||
|
||||
// If the directory is explicitly ignored, skip it.
|
||||
if options.ignore.contains(member_root.as_path()) {
|
||||
let skip = match &options.members {
|
||||
MemberDiscovery::All => false,
|
||||
MemberDiscovery::None => true,
|
||||
MemberDiscovery::Ignore(ignore) => ignore.contains(member_root.as_path()),
|
||||
};
|
||||
if skip {
|
||||
debug!(
|
||||
"Ignoring workspace member: `{}`",
|
||||
member_root.simplified_display()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue